Skip to content

Commit f545fa8

Browse files
committed
Correctly generate deviceID for Web Config
1 parent dec4ce3 commit f545fa8

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

Firmware/RTK_Everywhere/menuCommands.ino

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,7 +2023,7 @@ void createSettingsString(char *newSettings)
20232023
stringRecord(newSettings, "sdMounted", online.microSD);
20242024

20252025
// Add Device ID used for corrections
2026-
stringRecord(newSettings, "hardwareID", printDeviceId());
2026+
stringRecord(newSettings, "hardwareID", (char *)printDeviceId());
20272027

20282028
// Add Days Remaining for corrections
20292029
char apDaysRemaining[20];
@@ -2835,7 +2835,7 @@ SettingValueResponse getSettingValue(bool inCommands, const char *settingName, c
28352835
// Report deviceID over CLI - Useful for label generation
28362836
if (strcmp(settingName, "deviceId") == 0)
28372837
{
2838-
writeToString(settingValueStr, printDeviceId());
2838+
writeToString(settingValueStr, (char *)printDeviceId());
28392839
knownSetting = true;
28402840
settingIsString = true;
28412841
}
@@ -3524,21 +3524,16 @@ void printAvailableSettings()
35243524
else if (commandIndex[i] == COMMAND_PROFILE_NUMBER)
35253525
{
35263526
char settingValue[100];
3527-
35283527
snprintf(settingValue, sizeof(settingValue), "%d", profileNumber);
35293528
commandSendExecuteListResponse("profileNumber", "uint8_t", settingValue);
35303529
}
35313530

35323531
// Display the device ID - used in PointPerfect
35333532
else if (commandIndex[i] == COMMAND_DEVICE_ID)
35343533
{
3535-
char hardwareID[15];
35363534
char settingType[100];
3537-
3538-
snprintf(hardwareID, sizeof(hardwareID), "%02X%02X%02X%02X%02X%02X%02X", btMACAddress[0], btMACAddress[1],
3539-
btMACAddress[2], btMACAddress[3], btMACAddress[4], btMACAddress[5], productVariant);
3540-
snprintf(settingType, sizeof(settingType), "char[%d]", sizeof(hardwareID));
3541-
commandSendExecuteListResponse("deviceId", settingType, hardwareID);
3535+
snprintf(settingType, sizeof(settingType), "char[%d]", strlen(printDeviceId()));
3536+
commandSendExecuteListResponse("deviceId", settingType, printDeviceId());
35423537
}
35433538
}
35443539
systemPrintln();

0 commit comments

Comments
 (0)