Skip to content

Commit 2b629cf

Browse files
committed
Better diagnostics:
make pointperfectPrintKeyInformation print who it was called by periodic print subscribed topics in MQTT Client
1 parent 4e361eb commit 2b629cf

File tree

5 files changed

+27
-6
lines changed

5 files changed

+27
-6
lines changed

Firmware/RTK_Everywhere/Developer.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ void updatePPL() {}
266266
bool sendGnssToPpl(uint8_t *buffer, int numDataBytes) {return false;}
267267
bool sendSpartnToPpl(uint8_t *buffer, int numDataBytes) {return false;}
268268
bool sendAuxSpartnToPpl(uint8_t *buffer, int numDataBytes) {return false;}
269-
void pointperfectPrintKeyInformation() {systemPrintln("**PPL Not Compiled**");}
269+
void pointperfectPrintKeyInformation(const char *requestedBy) {systemPrintln("**PPL Not Compiled**");}
270270

271271
#endif // COMPILE_POINTPERFECT_LIBRARY
272272

Firmware/RTK_Everywhere/HTTP_Client.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ void httpClientUpdate()
540540
settings.pointPerfectNextKeyStart = (*jsonZtp)["dynamickeys"]["next"]["start"];
541541

542542
if (settings.debugCorrections || settings.debugHttpClientData)
543-
pointperfectPrintKeyInformation();
543+
pointperfectPrintKeyInformation("HTTP Client");
544544

545545
// displayKeysUpdated();
546546

Firmware/RTK_Everywhere/MQTT_Client.ino

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ void mqttClientReceiveMessage(int messageSize)
474474
recordSystemSettings(); // Record these settings to unit
475475

476476
if (settings.debugCorrections == true)
477-
pointperfectPrintKeyInformation();
477+
pointperfectPrintKeyInformation("MQTT Topic");
478478
}
479479

480480
// Correction data from PP can go direct to GNSS
@@ -585,6 +585,23 @@ void mqttClientSetState(uint8_t newState)
585585
}
586586
else
587587
systemPrintln(mqttClientStateName[mqttClientState]);
588+
589+
systemPrint("MQTT Client subscribe topics: ");
590+
for (auto it = mqttSubscribeTopics.begin(); it != mqttSubscribeTopics.end(); it = std::next(it))
591+
{
592+
String topic = *it;
593+
systemPrint(topic);
594+
systemPrint(" ");
595+
}
596+
systemPrintln();
597+
systemPrint("MQTT Client subscribed topics: ");
598+
for (auto it = mqttSubscribedTopics.begin(); it != mqttSubscribedTopics.end(); it = std::next(it))
599+
{
600+
String topic = *it;
601+
systemPrint(topic);
602+
systemPrint(" ");
603+
}
604+
systemPrintln();
588605
}
589606
}
590607

@@ -859,8 +876,10 @@ void mqttClientUpdate()
859876
{
860877
mqttSubscribeTopics.push_back(MQTT_TOPIC_ASSISTNOW);
861878
}
879+
862880
// Subscribe to the key distribution topic
863881
mqttSubscribeTopics.push_back(String(settings.pointPerfectKeyDistributionTopic));
882+
864883
// Subscribe to the continental correction topic for our region - if we have one. L-Band-only does not.
865884
if (strlen(settings.regionalCorrectionTopics[settings.geographicRegion]) > 0)
866885
{

Firmware/RTK_Everywhere/PointPerfectLibrary.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ bool getUsablePplKey(char *keyBuffer, int keyBufferSize)
364364

365365
if (settings.debugCorrections == true)
366366
{
367-
pointperfectPrintKeyInformation();
367+
pointperfectPrintKeyInformation("getUsablePplKey");
368368
systemPrintf("Days remaining until current key expires: %d\r\n", daysRemainingCurrent);
369369
systemPrintf("Days remaining until next key expires: %d\r\n", daysRemainingNext);
370370
}
@@ -525,8 +525,10 @@ const char *PPLReturnStatusToStr(ePPL_ReturnStatus status)
525525
}
526526
}
527527

528-
void pointperfectPrintKeyInformation()
528+
void pointperfectPrintKeyInformation(const char *requestedBy)
529529
{
530+
// All calls to pointperfectPrintKeyInformation are guarded by settings.debugCorrections
531+
systemPrintf(" pointPerfect keys print requested by %s\r\n", requestedBy);
530532
systemPrintf(" pointPerfectCurrentKey: %s\r\n", settings.pointPerfectCurrentKey);
531533
systemPrintf(
532534
" pointPerfectCurrentKeyStart: %lld - %s\r\n", settings.pointPerfectCurrentKeyStart,

Firmware/RTK_Everywhere/menuPP.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void menuPointPerfectKeys()
128128
settings.pointPerfectNextKeyDuration = settings.pointPerfectCurrentKeyDuration;
129129

130130
if (settings.debugCorrections == true)
131-
pointperfectPrintKeyInformation();
131+
pointperfectPrintKeyInformation("Menu PP");
132132
}
133133
else if (incoming == 4)
134134
{

0 commit comments

Comments
 (0)