Skip to content

Commit 4a3953c

Browse files
committed
Add MQTT as network consumer
1 parent c9edb61 commit 4a3953c

File tree

1 file changed

+30
-19
lines changed

1 file changed

+30
-19
lines changed

Firmware/RTK_Everywhere/Network.ino

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,7 @@ uint8_t networkConsumers()
14611461
// PointPerfect Corrections enabled with a non-zero length key
14621462
if (settings.enablePointPerfectCorrections == true && strlen(settings.pointPerfectCurrentKey) > 0)
14631463
{
1464-
if (online.rtc)
1464+
if (online.rtc == true)
14651465
{
14661466
// Check if keys need updating
14671467
int daysRemaining =
@@ -1470,8 +1470,12 @@ uint8_t networkConsumers()
14701470
{
14711471
consumerCount++;
14721472
consumerType |= (1 << 6);
1473-
if (settings.debugNetworkLayer)
1474-
systemPrintf("Network consumer daysRemaining: %d\r\n", daysRemaining);
1473+
}
1474+
else
1475+
{
1476+
//PointPerfect is enabled, allow MQTT to begin
1477+
consumerCount++;
1478+
consumerType |= (1 << 7);
14751479
}
14761480
}
14771481
}
@@ -1485,22 +1489,29 @@ uint8_t networkConsumers()
14851489
if (millis() - lastPrint > 2000)
14861490
{
14871491
lastPrint = millis();
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, ");
1492+
systemPrintf("Network consumer count: %d ", consumerCount);
1493+
if (consumerCount > 0)
1494+
{
1495+
systemPrintf("- Consumers: ", consumerCount);
1496+
1497+
if (consumerType & (1 << 0))
1498+
systemPrint("Rover NTRIP Client, ");
1499+
if (consumerType & (1 << 1))
1500+
systemPrint("Base NTRIP Server, ");
1501+
if (consumerType & (1 << 2))
1502+
systemPrint("TCP Client, ");
1503+
if (consumerType & (1 << 3))
1504+
systemPrint("TCP Server, ");
1505+
if (consumerType & (1 << 4))
1506+
systemPrint("UDP Server, ");
1507+
if (consumerType & (1 << 5))
1508+
systemPrint("PPL Key Request, ");
1509+
if (consumerType & (1 << 6))
1510+
systemPrint("PPL Key Update, ");
1511+
if (consumerType & (1 << 7))
1512+
systemPrint("PPL MQTT Client, ");
1513+
}
1514+
15041515
systemPrintln();
15051516
}
15061517
}

0 commit comments

Comments
 (0)