@@ -79,23 +79,14 @@ const PP_Service ppServices[] = {
7979 // "ZTP-LBand+IP" profile deprecated
8080};
8181
82- enum PP_NickName
83- {
84- PP_NICKNAME_DISABLED = 0 ,
85- PP_NICKNAME_FLEX_RTCM,
86- PP_NICKNAME_FLEX_LBAND_NA,
87- PP_NICKNAME_GLOBAL,
88- PP_NICKNAME_LIVE,
89- PP_NICKNAME_IP_MQTT,
90- PP_NICKNAME_MAX,
91- };
92-
9382const int ppServiceCount = sizeof (ppServices) / sizeof (ppServices[0 ]);
9483
9584// Provision device on ThingStream
9685// Download keys
9786void menuPointPerfect ()
9887{
88+ uint8_t pointPerfectServiceOnEntry = settings.pointPerfectService ;
89+
9990 while (1 )
10091 {
10192 systemPrintln ();
@@ -304,6 +295,10 @@ void menuPointPerfect()
304295 gnss->applyPointPerfectKeys ();
305296 }
306297
298+ // If, on entry, we needed NTRIP, and now we don't, then disable settings.enableNtripClient
299+ if ((pointPerfectNtripNeeded (pointPerfectServiceOnEntry)) && (!pointPerfectNtripNeeded ()))
300+ settings.enableNtripClient = false ;
301+
307302 clearBuffer (); // Empty buffer of any newline chars
308303}
309304
@@ -343,7 +338,7 @@ void menuPointPerfectSelectService()
343338 settings.pointPerfectService = incoming - 1 ; // Align incoming to array
344339
345340 restartRover = true ; // Require a rover restart to enable / disable RTCM for PPL
346- settings.requestKeyUpdate = settings.pointPerfectService ; // Force a key update - or don't
341+ settings.requestKeyUpdate = settings.pointPerfectService != PP_NICKNAME_DISABLED ; // Force a key update - or don't
347342
348343 break ; // Exit menu once selected
349344 }
@@ -816,7 +811,7 @@ void pointPerfectVerifyTables()
816811
817812bool pointPerfectIsEnabled ()
818813{
819- if (settings.pointPerfectService > PP_NICKNAME_DISABLED)
814+ if (settings.pointPerfectService != PP_NICKNAME_DISABLED)
820815 return true ;
821816 return false ;
822817}
@@ -849,7 +844,13 @@ bool pointPerfectLbandNeeded()
849844// Determine if this service type uses NTRIP for corrections
850845bool pointPerfectNtripNeeded ()
851846{
852- if (settings.pointPerfectService == PP_NICKNAME_FLEX_RTCM || settings.pointPerfectService == PP_NICKNAME_LIVE)
847+ return pointPerfectNtripNeeded (settings.pointPerfectService );
848+ }
849+
850+ // Determine if this service type uses NTRIP for corrections
851+ bool pointPerfectNtripNeeded (uint8_t pointPerfectService)
852+ {
853+ if (pointPerfectService == PP_NICKNAME_FLEX_RTCM || pointPerfectService == PP_NICKNAME_LIVE)
853854 return true ;
854855 return false ;
855856}
0 commit comments