From af73bf3e099c0fc887e93388aac789cea483ee4c Mon Sep 17 00:00:00 2001 From: PaulZC Date: Fri, 7 Jun 2024 16:57:48 +0100 Subject: [PATCH] Replace ntripServer/ClientRestart with ntripServer/ClientStop when networkIsShuttingDown --- Firmware/RTK_Surveyor/Network.ino | 4 ++-- Firmware/RTK_Surveyor/NtripClient.ino | 8 ++++---- Firmware/RTK_Surveyor/NtripServer.ino | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Firmware/RTK_Surveyor/Network.ino b/Firmware/RTK_Surveyor/Network.ino index fc82fdcec..5211b6919 100644 --- a/Firmware/RTK_Surveyor/Network.ino +++ b/Firmware/RTK_Surveyor/Network.ino @@ -886,7 +886,7 @@ void networkStop(uint8_t networkType) serverIndex = user - NETWORK_USER_NTRIP_SERVER; if (settings.debugNetworkLayer) systemPrintln("Network layer stopping NTRIP server"); - ntripServerRestart(serverIndex); + ntripServerStop(serverIndex, true); // Note: was ntripServerRestart(serverIndex); } break; @@ -899,7 +899,7 @@ void networkStop(uint8_t networkType) case NETWORK_USER_NTRIP_CLIENT: if (settings.debugNetworkLayer) systemPrintln("Network layer stopping NTRIP client"); - ntripClientRestart(); + ntripClientStop(true); // Note: was ntripClientRestart(); break; case NETWORK_USER_OTA_FIRMWARE_UPDATE: diff --git a/Firmware/RTK_Surveyor/NtripClient.ino b/Firmware/RTK_Surveyor/NtripClient.ino index 5c72aafcc..7b01b4a6c 100644 --- a/Firmware/RTK_Surveyor/NtripClient.ino +++ b/Firmware/RTK_Surveyor/NtripClient.ino @@ -580,7 +580,7 @@ void ntripClientUpdate() // Determine if the network has failed if (networkIsShuttingDown(NETWORK_USER_NTRIP_CLIENT)) // Failed to connect to to the network, attempt to restart the network - ntripClientRestart(); + ntripClientStop(true); // Note: was ntripClientRestart(); // Determine if the network is connected to the media else if (networkUserConnected(NETWORK_USER_NTRIP_CLIENT)) @@ -607,7 +607,7 @@ void ntripClientUpdate() // Determine if the network has failed if (networkIsShuttingDown(NETWORK_USER_NTRIP_CLIENT)) // Failed to connect to to the network, attempt to restart the network - ntripClientRestart(); + ntripClientStop(true); // Note: was ntripClientRestart(); // If GGA transmission is enabled, wait for GNSS lock before connecting to NTRIP Caster // If GGA transmission is not enabled, start connecting to NTRIP Caster @@ -640,7 +640,7 @@ void ntripClientUpdate() // Determine if the network has failed if (networkIsShuttingDown(NETWORK_USER_NTRIP_CLIENT)) // Failed to connect to to the network, attempt to restart the network - ntripClientRestart(); + ntripClientStop(true); // Note: was ntripClientRestart(); // Check for no response from the caster service else if (ntripClientReceiveDataAvailable() < @@ -766,7 +766,7 @@ void ntripClientUpdate() // Determine if the network has failed if (networkIsShuttingDown(NETWORK_USER_NTRIP_CLIENT)) // Failed to connect to to the network, attempt to restart the network - ntripClientRestart(); + ntripClientStop(true); // Note: was ntripClientRestart(); // Check for a broken connection else if (!ntripClient->connected()) diff --git a/Firmware/RTK_Surveyor/NtripServer.ino b/Firmware/RTK_Surveyor/NtripServer.ino index 83f2688c8..4103cd125 100644 --- a/Firmware/RTK_Surveyor/NtripServer.ino +++ b/Firmware/RTK_Surveyor/NtripServer.ino @@ -617,7 +617,7 @@ void ntripServerUpdate(int serverIndex) // Determine if the network has failed if (networkIsShuttingDown(NETWORK_USER_NTRIP_SERVER + serverIndex)) // Failed to connect to to the network, attempt to restart the network - ntripServerRestart(serverIndex); // Should this be ntripServerStop? TODO + ntripServerStop(serverIndex, true); // Note: was ntripServerRestart(serverIndex); // Determine if the network is connected to the media else if (networkUserConnected(NETWORK_USER_NTRIP_SERVER + serverIndex)) @@ -645,7 +645,7 @@ void ntripServerUpdate(int serverIndex) // Determine if the network has failed if (networkIsShuttingDown(NETWORK_USER_NTRIP_SERVER + serverIndex)) // Failed to connect to to the network, attempt to restart the network - ntripServerRestart(serverIndex); // Should this be ntripServerStop? TODO + ntripServerStop(serverIndex, true); // Note: was ntripServerRestart(serverIndex); else if (settings.enableNtripServer && (millis() - ntripServer->lastConnectionAttempt > ntripServer->connectionAttemptTimeout)) @@ -663,7 +663,7 @@ void ntripServerUpdate(int serverIndex) // Determine if the network has failed if (networkIsShuttingDown(NETWORK_USER_NTRIP_SERVER + serverIndex)) // Failed to connect to to the network, attempt to restart the network - ntripServerRestart(serverIndex); // Should this be ntripServerStop? TODO + ntripServerStop(serverIndex, true); // Note: was ntripServerRestart(serverIndex); // State change handled in ntripServerProcessRTCM break; @@ -673,7 +673,7 @@ void ntripServerUpdate(int serverIndex) // Determine if the network has failed if (networkIsShuttingDown(NETWORK_USER_NTRIP_SERVER + serverIndex)) // Failed to connect to to the network, attempt to restart the network - ntripServerRestart(serverIndex); // Should this be ntripServerStop? TODO + ntripServerStop(serverIndex, true); // Note: was ntripServerRestart(serverIndex); // Delay before opening the NTRIP server connection else if ((millis() - ntripServer->timer) >= ntripServer->connectionAttemptTimeout) @@ -699,7 +699,7 @@ void ntripServerUpdate(int serverIndex) // Determine if the network has failed if (networkIsShuttingDown(NETWORK_USER_NTRIP_SERVER + serverIndex)) // Failed to connect to to the network, attempt to restart the network - ntripServerRestart(serverIndex); // Should this be ntripServerStop? TODO + ntripServerStop(serverIndex, true); // Note: was ntripServerRestart(serverIndex); // Check if caster service responded 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) // Determine if the network has failed if (networkIsShuttingDown(NETWORK_USER_NTRIP_SERVER + serverIndex)) // Failed to connect to to the network, attempt to restart the network - ntripServerRestart(serverIndex); // Should this be ntripServerStop? TODO + ntripServerStop(serverIndex, true); // Note: was ntripServerRestart(serverIndex); // Check for a broken connection else if (!ntripServer->networkClient->connected())