@@ -570,7 +570,7 @@ ZtpResponse pointperfectTryZtpToken(StaticJsonDocument<256> &apiPost)
570
570
ztpResponse = ZTP_SUCCESS;
571
571
}
572
572
} // JSON Derialized correctly
573
- } // HTTP Response was 200
573
+ } // HTTP Response was 200
574
574
} while (0 );
575
575
576
576
// Free the allocated buffers
@@ -1286,27 +1286,27 @@ void menuPointPerfect()
1286
1286
if (settings.debugCorrections == true )
1287
1287
systemPrintf (" settings.pointPerfectLBandTopic: %s\r\n " , settings.pointPerfectLBandTopic );
1288
1288
1289
- systemPrint (" Days until keys expire: " );
1290
- if (strlen (settings.pointPerfectCurrentKey ) > 0 )
1291
- {
1292
- if (online.rtc == false )
1289
+ systemPrint (" Days until keys expire: " );
1290
+ if (strlen (settings.pointPerfectCurrentKey ) > 0 )
1293
1291
{
1294
- // If we don't have RTC we can't calculate days to expire
1295
- systemPrintln (" No RTC" );
1296
- }
1297
- else
1298
- {
1299
- int daysRemaining =
1300
- daysFromEpoch (settings.pointPerfectNextKeyStart + settings.pointPerfectNextKeyDuration + 1 );
1301
-
1302
- if (daysRemaining < 0 )
1303
- systemPrintln (" Expired" );
1292
+ if (online.rtc == false )
1293
+ {
1294
+ // If we don't have RTC we can't calculate days to expire
1295
+ systemPrintln (" No RTC" );
1296
+ }
1304
1297
else
1305
- systemPrintln (daysRemaining);
1298
+ {
1299
+ int daysRemaining =
1300
+ daysFromEpoch (settings.pointPerfectNextKeyStart + settings.pointPerfectNextKeyDuration + 1 );
1301
+
1302
+ if (daysRemaining < 0 )
1303
+ systemPrintln (" Expired" );
1304
+ else
1305
+ systemPrintln (daysRemaining);
1306
+ }
1306
1307
}
1307
- }
1308
- else
1309
- systemPrintln (" No keys" );
1308
+ else
1309
+ systemPrintln (" No keys" );
1310
1310
1311
1311
// All units should be able to obtain corrections over IP
1312
1312
// Only units with an lband receiver can obtain LBand corrections
@@ -1318,22 +1318,25 @@ void menuPointPerfect()
1318
1318
else
1319
1319
systemPrintln (" Disabled" );
1320
1320
1321
- systemPrint (" 2) Toggle Auto Key Renewal: " );
1322
- if (settings.autoKeyRenewal == true )
1323
- systemPrintln (" Enabled" );
1324
- else
1325
- systemPrintln (" Disabled" );
1321
+ if (pointPerfectIsEnabled ())
1322
+ {
1323
+ systemPrint (" 2) Toggle Auto Key Renewal: " );
1324
+ if (settings.autoKeyRenewal == true )
1325
+ systemPrintln (" Enabled" );
1326
+ else
1327
+ systemPrintln (" Disabled" );
1326
1328
1327
- if (strlen (settings.pointPerfectCurrentKey ) == 0 || strlen (settings.pointPerfectLBandTopic ) == 0 )
1328
- systemPrintln (" 3) Provision Device" );
1329
- else
1330
- systemPrintln (" 3) Update Keys" );
1329
+ if (strlen (settings.pointPerfectCurrentKey ) == 0 || strlen (settings.pointPerfectLBandTopic ) == 0 )
1330
+ systemPrintln (" 3) Provision Device" );
1331
+ else
1332
+ systemPrintln (" 3) Update Keys" );
1331
1333
1332
- systemPrintln (" 4) Show device ID" );
1334
+ systemPrintln (" 4) Show device ID" );
1333
1335
1334
- systemPrintln (" c) Clear the Keys" );
1336
+ systemPrintln (" c) Clear the Keys" );
1335
1337
1336
- systemPrintln (" k) Manual Key Entry" );
1338
+ systemPrintln (" k) Manual Key Entry" );
1339
+ }
1337
1340
1338
1341
systemPrintln (" x) Exit" );
1339
1342
@@ -1363,11 +1366,11 @@ void menuPointPerfect()
1363
1366
}
1364
1367
}
1365
1368
1366
- else if (incoming == 2 )
1369
+ else if (incoming == 2 && pointPerfectIsEnabled () )
1367
1370
{
1368
1371
settings.autoKeyRenewal ^= 1 ;
1369
1372
}
1370
- else if (incoming == 3 )
1373
+ else if (incoming == 3 && pointPerfectIsEnabled () )
1371
1374
{
1372
1375
if (wifiNetworkCount () == 0 )
1373
1376
{
@@ -1416,19 +1419,19 @@ void menuPointPerfect()
1416
1419
1417
1420
WIFI_STOP ();
1418
1421
}
1419
- else if (incoming == 4 )
1422
+ else if (incoming == 4 && pointPerfectIsEnabled () )
1420
1423
{
1421
1424
char hardwareID[13 ];
1422
1425
snprintf (hardwareID, sizeof (hardwareID), " %02X%02X%02X%02X%02X%02X" , btMACAddress[0 ], btMACAddress[1 ],
1423
1426
btMACAddress[2 ], btMACAddress[3 ], btMACAddress[4 ], btMACAddress[5 ]);
1424
1427
systemPrintf (" Device ID: %s\r\n " , hardwareID);
1425
1428
}
1426
- else if (incoming == ' c' )
1429
+ else if (incoming == ' c' && pointPerfectIsEnabled () )
1427
1430
{
1428
1431
settings.pointPerfectCurrentKey [0 ] = 0 ;
1429
1432
settings.pointPerfectNextKey [0 ] = 0 ;
1430
1433
}
1431
- else if (incoming == ' k' )
1434
+ else if (incoming == ' k' && pointPerfectIsEnabled () )
1432
1435
{
1433
1436
menuPointPerfectKeys ();
1434
1437
}
@@ -1450,6 +1453,13 @@ void menuPointPerfect()
1450
1453
clearBuffer (); // Empty buffer of any newline chars
1451
1454
}
1452
1455
1456
+ bool pointPerfectIsEnabled ()
1457
+ {
1458
+ if (settings.pointPerfectCorrectionsSource != POINTPERFECT_CORRECTIONS_DISABLED)
1459
+ return (true );
1460
+ return (false );
1461
+ }
1462
+
1453
1463
// Process any new L-Band from I2C
1454
1464
void updateLBand ()
1455
1465
{
0 commit comments