Skip to content

Commit 3952d7b

Browse files
committed
Gracefully handle unknown firmware
1 parent b35a748 commit 3952d7b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Firmware/RTK_Everywhere/menuMain.ino

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,14 @@ void menuRadio()
606606
else
607607
{
608608
loraGetVersion();
609-
systemPrintf("10) LoRa Radio: Enabled - Firmware v%s\r\n", loraFirmwareVersion);
609+
if (strlen(loraFirmwareVersion) < 3)
610+
{
611+
strncpy(loraFirmwareVersion, "Unknown", sizeof(loraFirmwareVersion));
612+
systemPrintf("10) LoRa Radio: Enabled - Firmware Unknown\r\n");
613+
}
614+
else
615+
systemPrintf("10) LoRa Radio: Enabled - Firmware v%s\r\n", loraFirmwareVersion);
616+
610617
systemPrintf("11) LoRa Coordination Frequency: %0.3f\r\n", settings.loraCoordinationFrequency);
611618
systemPrintf("12) Seconds without user serial that must elapse before LoRa radio goes into dedicated "
612619
"listening mode: %d\r\n",

0 commit comments

Comments
 (0)