Skip to content

Commit d564adc

Browse files
committed
Correctly test for ntripServers
1 parent 45e861d commit d564adc

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

Firmware/RTK_Everywhere/Network.ino

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,6 @@ void networkVerifyTables()
14361436
uint8_t networkConsumers()
14371437
{
14381438
uint8_t consumerCount = 0;
1439-
14401439
uint16_t consumerType = 0;
14411440

14421441
// Network needed for NTRIP Client
@@ -1447,7 +1446,17 @@ uint8_t networkConsumers()
14471446
}
14481447

14491448
// Network needed for NTRIP Server
1450-
if ((inBaseMode() == true && settings.enableNtripServer == true) || online.ntripServer)
1449+
bool ntripServerConnected = false;
1450+
for (int index = 0; index < NTRIP_SERVER_MAX; index++)
1451+
{
1452+
if (online.ntripServer[index])
1453+
{
1454+
ntripServerConnected = true;
1455+
break;
1456+
}
1457+
}
1458+
1459+
if ((inBaseMode() == true && settings.enableNtripServer == true) || ntripServerConnected)
14511460
{
14521461
consumerCount++;
14531462
consumerType |= (1 << 1);
@@ -1474,41 +1483,34 @@ uint8_t networkConsumers()
14741483
consumerType |= (1 << 4);
14751484
}
14761485

1477-
// Network needed for PointPerfect ZTP or key update requested from menu (or display menu)
1486+
// Network needed for PointPerfect ZTP or key update requested by scheduler, from menu, or display menu
14781487
if (settings.requestKeyUpdate == true)
14791488
{
14801489
consumerCount++;
14811490
consumerType |= (1 << 5);
14821491
}
14831492

1484-
// Network needed for PointPerfect Corrections key update
1485-
if (settings.requestKeyUpdate == true)
1486-
{
1487-
consumerCount++;
1488-
consumerType |= (1 << 6);
1489-
}
1490-
14911493
// Network needed for PointPerfect Corrections MQTT client
14921494
if ((settings.enablePointPerfectCorrections == true && strlen(settings.pointPerfectCurrentKey) > 0) ||
14931495
online.mqttClient)
14941496
{
14951497
// PointPerfect is enabled, allow MQTT to begin
14961498
consumerCount++;
1497-
consumerType |= (1 << 7);
1499+
consumerType |= (1 << 6);
14981500
}
14991501

15001502
// Network needed to obtain the latest firmware version
15011503
if (otaRequestFirmwareVersionCheck == true)
15021504
{
15031505
consumerCount++;
1504-
consumerType |= (1 << 8);
1506+
consumerType |= (1 << 7);
15051507
}
15061508

15071509
// Network needed for to start a firmware update
15081510
if (otaRequestFirmwareUpdate == true)
15091511
{
15101512
consumerCount++;
1511-
consumerType |= (1 << 9);
1513+
consumerType |= (1 << 8);
15121514
}
15131515

15141516
// Debug
@@ -1537,12 +1539,10 @@ uint8_t networkConsumers()
15371539
if (consumerType & (1 << 5))
15381540
systemPrint("PPL Key Update Request, ");
15391541
if (consumerType & (1 << 6))
1540-
systemPrint("PPL Key Update Scheduled, ");
1541-
if (consumerType & (1 << 7))
15421542
systemPrint("PPL MQTT Client, ");
1543-
if (consumerType & (1 << 8))
1543+
if (consumerType & (1 << 7))
15441544
systemPrint("OTA Version Check, ");
1545-
if (consumerType & (1 << 9))
1545+
if (consumerType & (1 << 8))
15461546
systemPrint("OTA Scheduled Check, ");
15471547
}
15481548

0 commit comments

Comments
 (0)