Skip to content

Commit af73bf3

Browse files
committed
Replace ntripServer/ClientRestart with ntripServer/ClientStop when networkIsShuttingDown
1 parent cbdf890 commit af73bf3

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

Firmware/RTK_Surveyor/Network.ino

+2-2
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ void networkStop(uint8_t networkType)
886886
serverIndex = user - NETWORK_USER_NTRIP_SERVER;
887887
if (settings.debugNetworkLayer)
888888
systemPrintln("Network layer stopping NTRIP server");
889-
ntripServerRestart(serverIndex);
889+
ntripServerStop(serverIndex, true); // Note: was ntripServerRestart(serverIndex);
890890
}
891891
break;
892892

@@ -899,7 +899,7 @@ void networkStop(uint8_t networkType)
899899
case NETWORK_USER_NTRIP_CLIENT:
900900
if (settings.debugNetworkLayer)
901901
systemPrintln("Network layer stopping NTRIP client");
902-
ntripClientRestart();
902+
ntripClientStop(true); // Note: was ntripClientRestart();
903903
break;
904904

905905
case NETWORK_USER_OTA_FIRMWARE_UPDATE:

Firmware/RTK_Surveyor/NtripClient.ino

+4-4
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ void ntripClientUpdate()
580580
// Determine if the network has failed
581581
if (networkIsShuttingDown(NETWORK_USER_NTRIP_CLIENT))
582582
// Failed to connect to to the network, attempt to restart the network
583-
ntripClientRestart();
583+
ntripClientStop(true); // Note: was ntripClientRestart();
584584

585585
// Determine if the network is connected to the media
586586
else if (networkUserConnected(NETWORK_USER_NTRIP_CLIENT))
@@ -607,7 +607,7 @@ void ntripClientUpdate()
607607
// Determine if the network has failed
608608
if (networkIsShuttingDown(NETWORK_USER_NTRIP_CLIENT))
609609
// Failed to connect to to the network, attempt to restart the network
610-
ntripClientRestart();
610+
ntripClientStop(true); // Note: was ntripClientRestart();
611611

612612
// If GGA transmission is enabled, wait for GNSS lock before connecting to NTRIP Caster
613613
// If GGA transmission is not enabled, start connecting to NTRIP Caster
@@ -640,7 +640,7 @@ void ntripClientUpdate()
640640
// Determine if the network has failed
641641
if (networkIsShuttingDown(NETWORK_USER_NTRIP_CLIENT))
642642
// Failed to connect to to the network, attempt to restart the network
643-
ntripClientRestart();
643+
ntripClientStop(true); // Note: was ntripClientRestart();
644644

645645
// Check for no response from the caster service
646646
else if (ntripClientReceiveDataAvailable() <
@@ -766,7 +766,7 @@ void ntripClientUpdate()
766766
// Determine if the network has failed
767767
if (networkIsShuttingDown(NETWORK_USER_NTRIP_CLIENT))
768768
// Failed to connect to to the network, attempt to restart the network
769-
ntripClientRestart();
769+
ntripClientStop(true); // Note: was ntripClientRestart();
770770

771771
// Check for a broken connection
772772
else if (!ntripClient->connected())

Firmware/RTK_Surveyor/NtripServer.ino

+6-6
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ void ntripServerUpdate(int serverIndex)
617617
// Determine if the network has failed
618618
if (networkIsShuttingDown(NETWORK_USER_NTRIP_SERVER + serverIndex))
619619
// Failed to connect to to the network, attempt to restart the network
620-
ntripServerRestart(serverIndex); // Should this be ntripServerStop? TODO
620+
ntripServerStop(serverIndex, true); // Note: was ntripServerRestart(serverIndex);
621621

622622
// Determine if the network is connected to the media
623623
else if (networkUserConnected(NETWORK_USER_NTRIP_SERVER + serverIndex))
@@ -645,7 +645,7 @@ void ntripServerUpdate(int serverIndex)
645645
// Determine if the network has failed
646646
if (networkIsShuttingDown(NETWORK_USER_NTRIP_SERVER + serverIndex))
647647
// Failed to connect to to the network, attempt to restart the network
648-
ntripServerRestart(serverIndex); // Should this be ntripServerStop? TODO
648+
ntripServerStop(serverIndex, true); // Note: was ntripServerRestart(serverIndex);
649649

650650
else if (settings.enableNtripServer
651651
&& (millis() - ntripServer->lastConnectionAttempt > ntripServer->connectionAttemptTimeout))
@@ -663,7 +663,7 @@ void ntripServerUpdate(int serverIndex)
663663
// Determine if the network has failed
664664
if (networkIsShuttingDown(NETWORK_USER_NTRIP_SERVER + serverIndex))
665665
// Failed to connect to to the network, attempt to restart the network
666-
ntripServerRestart(serverIndex); // Should this be ntripServerStop? TODO
666+
ntripServerStop(serverIndex, true); // Note: was ntripServerRestart(serverIndex);
667667

668668
// State change handled in ntripServerProcessRTCM
669669
break;
@@ -673,7 +673,7 @@ void ntripServerUpdate(int serverIndex)
673673
// Determine if the network has failed
674674
if (networkIsShuttingDown(NETWORK_USER_NTRIP_SERVER + serverIndex))
675675
// Failed to connect to to the network, attempt to restart the network
676-
ntripServerRestart(serverIndex); // Should this be ntripServerStop? TODO
676+
ntripServerStop(serverIndex, true); // Note: was ntripServerRestart(serverIndex);
677677

678678
// Delay before opening the NTRIP server connection
679679
else if ((millis() - ntripServer->timer) >= ntripServer->connectionAttemptTimeout)
@@ -699,7 +699,7 @@ void ntripServerUpdate(int serverIndex)
699699
// Determine if the network has failed
700700
if (networkIsShuttingDown(NETWORK_USER_NTRIP_SERVER + serverIndex))
701701
// Failed to connect to to the network, attempt to restart the network
702-
ntripServerRestart(serverIndex); // Should this be ntripServerStop? TODO
702+
ntripServerStop(serverIndex, true); // Note: was ntripServerRestart(serverIndex);
703703

704704
// Check if caster service responded
705705
else if (ntripServer->networkClient->available() < strlen("ICY 200 OK")) // Wait until at least a few bytes have arrived
@@ -785,7 +785,7 @@ void ntripServerUpdate(int serverIndex)
785785
// Determine if the network has failed
786786
if (networkIsShuttingDown(NETWORK_USER_NTRIP_SERVER + serverIndex))
787787
// Failed to connect to to the network, attempt to restart the network
788-
ntripServerRestart(serverIndex); // Should this be ntripServerStop? TODO
788+
ntripServerStop(serverIndex, true); // Note: was ntripServerRestart(serverIndex);
789789

790790
// Check for a broken connection
791791
else if (!ntripServer->networkClient->connected())

0 commit comments

Comments
 (0)