Skip to content

Commit f99b8ff

Browse files
committed
Move log_ds to debugLBand prints
1 parent 010a50a commit f99b8ff

File tree

1 file changed

+44
-26
lines changed

1 file changed

+44
-26
lines changed

Firmware/RTK_Surveyor/menuPP.ino

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -347,13 +347,9 @@ bool pointperfectProvisionDevice()
347347
break;
348348
}
349349
strncpy(tempHolderPtr, (const char *)((*jsonZtp)["certificate"]), MQTT_CERT_SIZE - 1);
350-
// log_d("len of PrivateCert: %d", strlen(tempHolderPtr));
351-
// log_d("privateCert: %s", tempHolderPtr);
352350
recordFile("certificate", tempHolderPtr, strlen(tempHolderPtr));
353351

354352
strncpy(tempHolderPtr, (const char *)((*jsonZtp)["privateKey"]), MQTT_CERT_SIZE - 1);
355-
// log_d("len of privateKey: %d", strlen(tempHolderPtr));
356-
// log_d("privateKey: %s", tempHolderPtr);
357353
recordFile("privateKey", tempHolderPtr, strlen(tempHolderPtr));
358354

359355
// Validate the keys
@@ -580,7 +576,8 @@ bool pointperfectUpdateKeys()
580576
mqttClient.setCallback(mqttCallback);
581577
mqttClient.setServer(settings.pointPerfectBrokerHost, 8883);
582578

583-
log_d("Connecting to MQTT broker: %s", settings.pointPerfectBrokerHost);
579+
if (settings.debugLBand == true)
580+
systemPrintf("Connecting to MQTT broker: %s\r\n", settings.pointPerfectBrokerHost);
584581

585582
// Loop until we're connected or until the maximum retries are exceeded
586583
mqttMessageReceived = false;
@@ -605,7 +602,8 @@ bool pointperfectUpdateKeys()
605602
if (--maxTries)
606603
{
607604
systemPrint(".");
608-
log_d("failed, status code: %d try again in 1 second", mqttClient.state());
605+
if (settings.debugLBand == true)
606+
systemPrintf("failed, status code: %d try again in 1 second\r\n", mqttClient.state());
609607
delay(1000);
610608
}
611609
} while (maxTries);
@@ -614,7 +612,6 @@ bool pointperfectUpdateKeys()
614612
if (mqttClient.connected() == false)
615613
{
616614
systemPrintln("failed!");
617-
log_d("MQTT failed to connect");
618615
break;
619616
}
620617

@@ -629,12 +626,14 @@ bool pointperfectUpdateKeys()
629626
break;
630627
if (mqttClient.connected() == false)
631628
{
632-
log_d("Client disconnected");
629+
if (settings.debugLBand == true)
630+
systemPrintln("Client disconnected");
633631
break;
634632
}
635633
if (millis() - startTime > 8000)
636634
{
637-
log_d("Channel failed to respond");
635+
if (settings.debugLBand == true)
636+
systemPrintln("Channel failed to respond");
638637
break;
639638
}
640639

@@ -806,7 +805,8 @@ int daysFromEpoch(long long endEpoch)
806805
if (online.rtc == false)
807806
{
808807
// If we don't have RTC we can't calculate days to expire
809-
log_d("No RTC available");
808+
if (settings.debugLBand == true)
809+
systemPrintln("No RTC available");
810810
return (0);
811811
}
812812

@@ -1005,7 +1005,8 @@ void pointperfectApplyKeys()
10051005
{
10061006
if (online.gnss == false)
10071007
{
1008-
log_d("ZED-F9P not available");
1008+
if (settings.debugLBand == true)
1009+
systemPrintln("ZED-F9P not available");
10091010
return;
10101011
}
10111012

@@ -1053,13 +1054,15 @@ void pointperfectApplyKeys()
10531054
systemPrintln("setDynamicSPARTNKeys failed");
10541055
else
10551056
{
1056-
log_d("PointPerfect keys applied");
1057+
if (settings.debugLBand == true)
1058+
systemPrintln("PointPerfect keys applied");
10571059
online.lbandCorrections = true;
10581060
}
10591061
}
10601062
else
10611063
{
1062-
log_d("No PointPerfect keys available");
1064+
if (settings.debugLBand == true)
1065+
systemPrintln("No PointPerfect keys available");
10631066
}
10641067
}
10651068
}
@@ -1096,15 +1099,17 @@ void beginLBand()
10961099
// Skip if going into configure-via-ethernet mode
10971100
if (configureViaEthernet)
10981101
{
1099-
log_d("configureViaEthernet: skipping beginLBand");
1102+
if (settings.debugLBand == true)
1103+
systemPrintln("configureViaEthernet: skipping beginLBand");
11001104
return;
11011105
}
11021106

11031107
#ifdef COMPILE_L_BAND
11041108
if (i2cLBand.begin(Wire, 0x43) ==
11051109
false) // Connect to the u-blox NEO-D9S using Wire port. The D9S default I2C address is 0x43 (not 0x42)
11061110
{
1107-
log_d("L-Band not detected");
1111+
if (settings.debugLBand == true)
1112+
systemPrintln("L-Band not detected");
11081113
return;
11091114
}
11101115

@@ -1129,12 +1134,14 @@ void beginLBand()
11291134
{
11301135
if ((longitude > -125 && longitude < -67) && (latitude > -90 && latitude < 90))
11311136
{
1132-
log_d("Setting L-Band to US");
1137+
if (settings.debugLBand == true)
1138+
systemPrintln("Setting L-Band to US");
11331139
settings.LBandFreq = 1556290000; // We are in US band
11341140
}
11351141
else if ((longitude > -25 && longitude < 70) && (latitude > -90 && latitude < 90))
11361142
{
1137-
log_d("Setting L-Band to EU");
1143+
if (settings.debugLBand == true)
1144+
systemPrintln("Setting L-Band to EU");
11381145
settings.LBandFreq = 1545260000; // We are in EU band
11391146
}
11401147
else
@@ -1145,7 +1152,10 @@ void beginLBand()
11451152
recordSystemSettings();
11461153
}
11471154
else
1148-
log_d("No fix available for L-Band frequency determination");
1155+
{
1156+
if (settings.debugLBand == true)
1157+
systemPrintln("No fix available for L-Band frequency determination");
1158+
}
11491159

11501160
bool response = true;
11511161
response &= i2cLBand.newCfgValset();
@@ -1170,7 +1180,8 @@ void beginLBand()
11701180

11711181
i2cLBand.softwareResetGNSSOnly(); // Do a restart
11721182

1173-
log_d("L-Band online");
1183+
if (settings.debugLBand == true)
1184+
systemPrintln("L-Band online");
11741185

11751186
online.lband = true;
11761187
#endif // COMPILE_L_BAND
@@ -1187,9 +1198,11 @@ void menuPointPerfect()
11871198
systemPrintln();
11881199
systemPrintln("Menu: PointPerfect Corrections");
11891200

1190-
log_d("Time to first L-Band fix: %ds Restarts: %d", lbandTimeToFix / 1000, lbandRestarts);
1201+
if (settings.debugLBand == true)
1202+
systemPrintf("Time to first L-Band fix: %ds Restarts: %d\r\n", lbandTimeToFix / 1000, lbandRestarts);
11911203

1192-
log_d("settings.pointPerfectLBandTopic: %s", settings.pointPerfectLBandTopic);
1204+
if (settings.debugLBand == true)
1205+
systemPrintf("settings.pointPerfectLBandTopic: %s\r\n", settings.pointPerfectLBandTopic);
11931206

11941207
systemPrint("Days until keys expire: ");
11951208
if (strlen(settings.pointPerfectCurrentKey) > 0)
@@ -1339,7 +1352,8 @@ void updateLBand()
13391352
// Skip if in configure-via-ethernet mode
13401353
if (configureViaEthernet)
13411354
{
1342-
// log_d("configureViaEthernet: skipping updateLBand");
1355+
if (settings.debugLBand == true)
1356+
systemPrintln("configureViaEthernet: skipping updateLBand");
13431357
return;
13441358
}
13451359

@@ -1377,14 +1391,16 @@ void updateLBand()
13771391
// Hotstart ZED to try to get RTK lock
13781392
theGNSS.softwareResetGNSSOnly();
13791393

1380-
log_d("Restarting ZED. Number of L-Band restarts: %d", lbandRestarts);
1394+
if (settings.debugLBand == true)
1395+
systemPrintf("Restarting ZED. Number of L-Band restarts: %d\r\n", lbandRestarts);
13811396
}
13821397
}
13831398
}
13841399
else if (carrSoln == 2 && lbandTimeToFix == 0)
13851400
{
13861401
lbandTimeToFix = millis();
1387-
log_d("Time to first L-Band fix: %ds", lbandTimeToFix / 1000);
1402+
if (settings.debugLBand == true)
1403+
systemPrintf("Time to first L-Band fix: %ds\r\n", lbandTimeToFix / 1000);
13881404
}
13891405

13901406
if ((millis() - rtcmLastPacketReceived) / 1000 > settings.rtcmTimeoutBeforeUsingLBand_s)
@@ -1394,7 +1410,8 @@ void updateLBand()
13941410
// re-enable L-Band communcation
13951411
if (lBandCommunicationEnabled == false)
13961412
{
1397-
log_d("Enabling L-Band communication due to RTCM timeout");
1413+
if (settings.debugLBand == true)
1414+
systemPrintln("Enabling L-Band communication due to RTCM timeout");
13981415
lBandCommunicationEnabled = zedEnableLBandCommunication();
13991416
}
14001417
}
@@ -1403,7 +1420,8 @@ void updateLBand()
14031420
// If we *have* recently received RTCM then disable corrections from then NEO-D9S L-Band receiver
14041421
if (lBandCommunicationEnabled == true)
14051422
{
1406-
log_d("Disabling L-Band communication due to RTCM reception");
1423+
if (settings.debugLBand == true)
1424+
systemPrintln("Disabling L-Band communication due to RTCM reception");
14071425
lBandCommunicationEnabled = !zedDisableLBandCommunication(); // zedDisableLBandCommunication() returns
14081426
// true if we successfully disabled
14091427
}

0 commit comments

Comments
 (0)