@@ -1414,49 +1414,94 @@ uint8_t networkConsumers()
1414
1414
{
1415
1415
uint8_t consumerCount = 0 ;
1416
1416
1417
+ uint16_t consumerType = 0 ;
1418
+
1417
1419
// Rover + NTRIP Client
1418
1420
if (inRoverMode () == true && settings.enableNtripClient == true )
1421
+ {
1419
1422
consumerCount++;
1423
+ consumerType |= (1 << 0 );
1424
+ }
1420
1425
1421
1426
// Base + NTRIP Server
1422
1427
if (inBaseMode () == true && settings.enableNtripServer == true )
1428
+ {
1423
1429
consumerCount++;
1430
+ consumerType |= (1 << 1 );
1431
+ }
1424
1432
1425
1433
// TCP Client
1426
1434
if (settings.enableTcpClient == true )
1435
+ {
1427
1436
consumerCount++;
1437
+ consumerType |= (1 << 2 );
1438
+ }
1428
1439
1429
1440
// TCP Server
1430
1441
if (settings.enableTcpServer == true )
1442
+ {
1431
1443
consumerCount++;
1444
+ consumerType |= (1 << 3 );
1445
+ }
1432
1446
1433
1447
// UDP Server
1434
1448
if (settings.enableUdpServer == true )
1449
+ {
1435
1450
consumerCount++;
1451
+ consumerType |= (1 << 4 );
1452
+ }
1436
1453
1437
1454
// PointPerfect ZTP or get keys
1438
1455
if (settings.requestKeyUpdate == true )
1456
+ {
1439
1457
consumerCount++;
1458
+ consumerType |= (1 << 5 );
1459
+ }
1440
1460
1441
1461
// PointPerfect Corrections enabled with a non-zero length key
1442
1462
if (settings.enablePointPerfectCorrections == true && strlen (settings.pointPerfectCurrentKey ) > 0 )
1443
1463
{
1444
- // Check if keys are expired
1445
- int daysRemaining = daysFromEpoch (settings.pointPerfectNextKeyStart + settings.pointPerfectNextKeyDuration + 1 );
1446
- if (daysRemaining > 0 )
1447
- consumerCount++;
1464
+ if (online.rtc )
1465
+ {
1466
+ // Check if keys need updating
1467
+ int daysRemaining =
1468
+ daysFromEpoch (settings.pointPerfectNextKeyStart + settings.pointPerfectNextKeyDuration + 1 );
1469
+ if (daysRemaining < 28 )
1470
+ {
1471
+ consumerCount++;
1472
+ consumerType |= (1 << 6 );
1473
+ if (settings.debugNetworkLayer )
1474
+ systemPrintf (" Network consumer daysRemaining: %d\r\n " , daysRemaining);
1475
+ }
1476
+ }
1448
1477
}
1449
1478
1450
- // OTA
1479
+ // OTA
1451
1480
1452
1481
if (settings.debugNetworkLayer )
1453
1482
{
1454
- static unsigned long lastPrint = millis () ;
1483
+ static unsigned long lastPrint = 0 ;
1455
1484
1456
1485
if (millis () - lastPrint > 2000 )
1457
1486
{
1458
1487
lastPrint = millis ();
1459
- systemPrintf (" Network consumer count: %d\r\n " , consumerCount);
1488
+ systemPrintf (" Network consumer count: %d - Consumers: " , consumerCount);
1489
+
1490
+ if (consumerType & (1 << 0 ))
1491
+ systemPrint (" Rover NTRIP Client, " );
1492
+ if (consumerType & (1 << 1 ))
1493
+ systemPrint (" Base NTRIP Server, " );
1494
+ if (consumerType & (1 << 2 ))
1495
+ systemPrint (" TCP Client, " );
1496
+ if (consumerType & (1 << 3 ))
1497
+ systemPrint (" TCP Server, " );
1498
+ if (consumerType & (1 << 4 ))
1499
+ systemPrint (" UDP Server, " );
1500
+ if (consumerType & (1 << 5 ))
1501
+ systemPrint (" PPL Key request, " );
1502
+ if (consumerType & (1 << 6 ))
1503
+ systemPrint (" PPL Key update, " );
1504
+ systemPrintln ();
1460
1505
}
1461
1506
}
1462
1507
0 commit comments