Skip to content

Commit cc6451f

Browse files
committed
Add deviceID report to command interface
1 parent addfba0 commit cc6451f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Firmware/RTK_Everywhere/menuCommands.ino

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1932,9 +1932,21 @@ bool getSettingValue(const char *settingName, char *settingValueStr)
19321932

19331933
if (knownSetting == false)
19341934
{
1935+
//Report deviceID over CLI - Useful for label generation
1936+
if (strcmp(settingName, "deviceId") == 0)
1937+
{
1938+
char hardwareID[15];
1939+
snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1],
1940+
btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5],
1941+
productVariant);
1942+
1943+
writeToString(settingValueStr, hardwareID);
1944+
knownSetting = true;
1945+
}
1946+
19351947
// Unused variables - read to avoid errors
19361948
// TODO: check this! Is this really what we want?
1937-
if (strcmp(settingName, "fixedLatText") == 0)
1949+
else if (strcmp(settingName, "fixedLatText") == 0)
19381950
{
19391951
knownSetting = true;
19401952
}
@@ -2320,6 +2332,8 @@ void printAvailableSettings()
23202332
}
23212333
}
23222334

2335+
systemPrint("deviceId,char[18],");
2336+
23232337
// TODO: check this! Is this really what we want?
23242338
systemPrint("fixedLatText,char[],");
23252339
systemPrint("fixedLongText,char[],");

0 commit comments

Comments
 (0)