@@ -91,7 +91,7 @@ NtripClient.ino
91
91
92
92
NTRIP_CLIENT_OFF
93
93
| ^
94
- ntripClientStart | | ntripClientShutdown ()
94
+ ntripClientStart | | ntripClientForceShutdown ()
95
95
v |
96
96
NTRIP_CLIENT_ON <--------------.
97
97
| |
@@ -198,6 +198,8 @@ static uint32_t ntripClientStartTime; // For calculating uptime
198
198
// Throttle GGA transmission to Caster to 1 report every 5 seconds
199
199
unsigned long lastGGAPush;
200
200
201
+ bool ntripClientForcedShutdown = false ; // NTRIP Client was turned off due to an error. Don't allow restart.
202
+
201
203
// ----------------------------------------
202
204
// NTRIP Client Routines
203
205
// ----------------------------------------
@@ -474,9 +476,10 @@ void ntripClientSetState(uint8_t newState)
474
476
}
475
477
476
478
// Shutdown the NTRIP client
477
- void ntripClientShutdown ()
479
+ void ntripClientForceShutdown ()
478
480
{
479
481
ntripClientStop (true );
482
+ ntripClientForcedShutdown = true ; // NTRIP Client was turned off due to an error. Don't allow restart.
480
483
}
481
484
482
485
// Start the NTRIP client
@@ -525,7 +528,6 @@ void ntripClientStop(bool shutdown)
525
528
if (shutdown)
526
529
{
527
530
ntripClientSetState (NTRIP_CLIENT_OFF);
528
- settings.enableNtripClient = false ;
529
531
ntripClientConnectionAttempts = 0 ;
530
532
ntripClientConnectionAttemptTimeout = 0 ;
531
533
}
@@ -555,7 +557,8 @@ void ntripClientUpdate()
555
557
switch (ntripClientState)
556
558
{
557
559
case NTRIP_CLIENT_OFF:
558
- if (EQ_RTK_MODE (ntripClientMode) && settings.enableNtripClient )
560
+ // Don't allow the client to restart if a forced shutdown occured
561
+ if (ntripClientForcedShutdown == false && EQ_RTK_MODE (ntripClientMode) && settings.enableNtripClient )
559
562
ntripClientStart ();
560
563
break ;
561
564
@@ -581,7 +584,7 @@ void ntripClientUpdate()
581
584
{
582
585
// Failed to allocate the ntripClient structure
583
586
systemPrintln (" ERROR: Failed to allocate the ntripClient structure!" );
584
- ntripClientShutdown ();
587
+ ntripClientForceShutdown ();
585
588
}
586
589
else
587
590
{
@@ -681,7 +684,7 @@ void ntripClientUpdate()
681
684
settings.ntripClient_MountPoint , response);
682
685
683
686
// Stop NTRIP client operations
684
- ntripClientShutdown ();
687
+ ntripClientForceShutdown ();
685
688
}
686
689
else
687
690
{
@@ -733,15 +736,15 @@ void ntripClientUpdate()
733
736
response);
734
737
735
738
// Stop NTRIP client operations
736
- ntripClientShutdown ();
739
+ ntripClientForceShutdown ();
737
740
}
738
741
// Other errors returned by the caster
739
742
else
740
743
{
741
744
systemPrintf (" NTRIP Client connected but caster responded with problem: %s\r\n " , response);
742
745
743
746
// Stop NTRIP client operations
744
- ntripClientShutdown ();
747
+ ntripClientForceShutdown ();
745
748
}
746
749
}
747
750
break ;
0 commit comments