@@ -153,6 +153,7 @@ void beginPPL()
153
153
pplConfigOptionsMask = PPL_CFG_ENABLE_AUX_CHANNEL; // auxiliary channel support
154
154
else
155
155
pplConfigOptionsMask = PPL_CFG_DEFAULT_CFG; // IP and L-Band support
156
+
156
157
ePPL_ReturnStatus result = PPL_Initialize (pplConfigOptionsMask);
157
158
158
159
if (result != ePPL_Success)
@@ -230,7 +231,10 @@ void updatePPL()
230
231
231
232
static unsigned long pplTime3dFixStarted;
232
233
233
- if ((online.ppl == false ) && (pointPerfectIsEnabled () == true ) && (gnss->isFixed ()))
234
+ // Start the PPL only if the selected PointPerfect service is encrypted, and the current hardware needs the PPL to
235
+ // decrypt
236
+ if ((online.ppl == false ) && (pointPerfectServiceUsesKeys () == true ) && (productVariantNeedsPpl () == true ) &&
237
+ (gnss->isFixed ()))
234
238
{
235
239
// Start PPL only after GNSS is outputting appropriate NMEA+RTCM, we have a key, and the MQTT broker is
236
240
// connected or L-Band SPARTN is being received. Don't restart the PPL if we've already tried.
@@ -245,8 +249,9 @@ void updatePPL()
245
249
}
246
250
}
247
251
}
248
- else if (online.ppl == true )
252
+ else if (( online.ppl == true ) && ( pointPerfectServiceUsesKeys () == true ) )
249
253
{
254
+
250
255
if (settings.debugCorrections == true )
251
256
{
252
257
if (millis () - pplReport > 5000 )
@@ -322,6 +327,11 @@ void updatePPL()
322
327
}
323
328
}
324
329
330
+ // Stop PPL if the PointPerfect service changes and no longer needs it
331
+ else if ((online.ppl == true ) && (pointPerfectServiceUsesKeys () == false ))
332
+ {
333
+ stopPPL (); // Stop PPL and mark it offline. It will auto-restart at the next update().
334
+ }
325
335
// The PPL is fed during updatePplTask()
326
336
}
327
337
@@ -460,6 +470,11 @@ bool sendAuxSpartnToPpl(uint8_t *buffer, int numDataBytes)
460
470
{
461
471
if ((settings.debugCorrections == true ) && !inMainMenu)
462
472
systemPrintf (" ERROR PPL_SendAuxSpartn: %s\r\n " , PPLReturnStatusToStr (result));
473
+
474
+ // Force print wrong key error
475
+ else if (result == ePPL_IncorrectDynKey && !inMainMenu)
476
+ systemPrintf (" ERROR PPL_SendAuxSpartn: %s\r\n " , PPLReturnStatusToStr (result));
477
+
463
478
return false ;
464
479
}
465
480
lastSpartnToPpl = millis ();
0 commit comments