Skip to content

Commit c188da9

Browse files
committed
NtripServer: Remove NTRIP_SERVER_ON state
1 parent f021d47 commit c188da9

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

Firmware/RTK_Everywhere/NtripServer.ino

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ NtripServer.ino
8282
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
8383
NTRIP Server States:
8484
NTRIP_SERVER_OFF: Network off or using NTRIP Client
85-
NTRIP_SERVER_ON: WIFI_STATE_START state
8685
NTRIP_SERVER_WAIT_FOR_NETWORK: Connecting to the network
8786
NTRIP_SERVER_NETWORK_CONNECTED: Connected to the network
8887
NTRIP_SERVER_WAIT_GNSS_DATA: Waiting for correction data from GNSS
@@ -94,12 +93,8 @@ NtripServer.ino
9493
| ^
9594
ntripServerStart | | ntripServerShutdown()
9695
v |
97-
.---------> NTRIP_SERVER_ON <-------------------.
96+
.--> NTRIP_SERVER_WAIT_FOR_NETWORK <------------.
9897
| | |
99-
| | | ntripServerRestart()
100-
| v Fail |
101-
| NTRIP_SERVER_WAIT_FOR_NETWORK ------------->+
102-
| | ^
10398
| | |
10499
| v Fail |
105100
| NTRIP_SERVER_NETWORK_CONNECTED ----------->+
@@ -145,7 +140,6 @@ static const int NTRIP_SERVER_CONNECTION_TIME = 5 * 60 * 1000;
145140
enum NTRIPServerState
146141
{
147142
NTRIP_SERVER_OFF = 0, // Using Bluetooth or NTRIP client
148-
NTRIP_SERVER_ON, // WIFI_STATE_START state
149143
NTRIP_SERVER_WAIT_FOR_NETWORK, // Connecting to WiFi access point
150144
NTRIP_SERVER_NETWORK_CONNECTED, // WiFi connected to an access point
151145
NTRIP_SERVER_WAIT_GNSS_DATA, // Waiting for correction data from GNSS
@@ -157,7 +151,6 @@ enum NTRIPServerState
157151
};
158152

159153
const char *const ntripServerStateName[] = {"NTRIP_SERVER_OFF",
160-
"NTRIP_SERVER_ON",
161154
"NTRIP_SERVER_WAIT_FOR_NETWORK",
162155
"NTRIP_SERVER_NETWORK_CONNECTED",
163156
"NTRIP_SERVER_WAIT_GNSS_DATA",
@@ -351,7 +344,6 @@ void ntripServerPrintStateSummary(int serverIndex)
351344
case NTRIP_SERVER_OFF:
352345
systemPrint("Disconnected");
353346
break;
354-
case NTRIP_SERVER_ON:
355347
case NTRIP_SERVER_WAIT_FOR_NETWORK:
356348
case NTRIP_SERVER_NETWORK_CONNECTED:
357349
case NTRIP_SERVER_WAIT_GNSS_DATA:
@@ -579,7 +571,7 @@ void ntripServerStop(int serverIndex, bool shutdown)
579571
}
580572

581573
// Increase timeouts if we started the network
582-
if (ntripServer->state > NTRIP_SERVER_ON)
574+
if (ntripServer->state > NTRIP_SERVER_OFF)
583575
// Mark the Server stop so that we don't immediately attempt re-connect to Caster
584576
ntripServer->timer = millis();
585577

@@ -648,12 +640,11 @@ void ntripServerUpdate(int serverIndex)
648640
{
649641
case NTRIP_SERVER_OFF:
650642
if (enabled)
643+
{
644+
// Start the network
651645
ntripServerStart(serverIndex);
652-
break;
653-
654-
// Start the network
655-
case NTRIP_SERVER_ON:
656-
ntripServerSetState(serverIndex, NTRIP_SERVER_WAIT_FOR_NETWORK);
646+
ntripServerSetState(serverIndex, NTRIP_SERVER_WAIT_FOR_NETWORK);
647+
}
657648
break;
658649

659650
// Wait for a network media connection

0 commit comments

Comments
 (0)