Skip to content

Commit

Permalink
Add MQTT as network consumer
Browse files Browse the repository at this point in the history
  • Loading branch information
nseidle committed Dec 9, 2024
1 parent c9edb61 commit 4a3953c
Showing 1 changed file with 30 additions and 19 deletions.
49 changes: 30 additions & 19 deletions Firmware/RTK_Everywhere/Network.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,7 @@ uint8_t networkConsumers()
// PointPerfect Corrections enabled with a non-zero length key
if (settings.enablePointPerfectCorrections == true && strlen(settings.pointPerfectCurrentKey) > 0)
{
if (online.rtc)
if (online.rtc == true)
{
// Check if keys need updating
int daysRemaining =
Expand All @@ -1470,8 +1470,12 @@ uint8_t networkConsumers()
{
consumerCount++;
consumerType |= (1 << 6);
if (settings.debugNetworkLayer)
systemPrintf("Network consumer daysRemaining: %d\r\n", daysRemaining);
}
else
{
//PointPerfect is enabled, allow MQTT to begin
consumerCount++;
consumerType |= (1 << 7);
}
}
}
Expand All @@ -1485,22 +1489,29 @@ uint8_t networkConsumers()
if (millis() - lastPrint > 2000)
{
lastPrint = millis();
systemPrintf("Network consumer count: %d - Consumers: ", consumerCount);

if (consumerType & (1 << 0))
systemPrint("Rover NTRIP Client, ");
if (consumerType & (1 << 1))
systemPrint("Base NTRIP Server, ");
if (consumerType & (1 << 2))
systemPrint("TCP Client, ");
if (consumerType & (1 << 3))
systemPrint("TCP Server, ");
if (consumerType & (1 << 4))
systemPrint("UDP Server, ");
if (consumerType & (1 << 5))
systemPrint("PPL Key request, ");
if (consumerType & (1 << 6))
systemPrint("PPL Key update, ");
systemPrintf("Network consumer count: %d ", consumerCount);
if (consumerCount > 0)
{
systemPrintf("- Consumers: ", consumerCount);

if (consumerType & (1 << 0))
systemPrint("Rover NTRIP Client, ");
if (consumerType & (1 << 1))
systemPrint("Base NTRIP Server, ");
if (consumerType & (1 << 2))
systemPrint("TCP Client, ");
if (consumerType & (1 << 3))
systemPrint("TCP Server, ");
if (consumerType & (1 << 4))
systemPrint("UDP Server, ");
if (consumerType & (1 << 5))
systemPrint("PPL Key Request, ");
if (consumerType & (1 << 6))
systemPrint("PPL Key Update, ");
if (consumerType & (1 << 7))
systemPrint("PPL MQTT Client, ");
}

systemPrintln();
}
}
Expand Down

0 comments on commit 4a3953c

Please sign in to comment.