Skip to content

Commit 8c7c7e8

Browse files
committed
Keep WiFi on during Temp Base Survey In
Fix #386
1 parent c8dddfc commit 8c7c7e8

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

Firmware/RTK_Surveyor/NtripClient.ino

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,19 +306,32 @@ void ntripClientStop(bool wifiClientAllocated)
306306
#endif //COMPILE_WIFI
307307
}
308308

309-
//Check for the arrival of any correction data. Push it to the GNSS.
310-
//Stop task if the connection has dropped or if we receive no data for maxTimeBeforeHangup_ms
311-
void ntripClientUpdate()
309+
//Determine if NTRIP Client is needed
310+
bool ntripClientIsNeeded()
312311
{
313312
if (settings.enableNtripClient == false)
314313
{
315314
//If user turns off NTRIP Client via settings, stop server
316315
if (ntripClientState > NTRIP_CLIENT_OFF)
317316
ntripClientStop(true); //Don't allocate new wifiClient
318-
return;
317+
return(false);
319318
}
320319

321-
if (wifiInConfigMode()) return; //Do not service NTRIP during WiFi config
320+
if (wifiInConfigMode()) return(false); //Do not service NTRIP during WiFi config
321+
322+
//Allow NTRIP Client to run during Survey-In,
323+
//but do not allow NTRIP Client to run during Base
324+
if (systemState == STATE_BASE_TEMP_TRANSMITTING)
325+
return(false);
326+
327+
return(true);
328+
}
329+
330+
//Check for the arrival of any correction data. Push it to the GNSS.
331+
//Stop task if the connection has dropped or if we receive no data for maxTimeBeforeHangup_ms
332+
void ntripClientUpdate()
333+
{
334+
if(ntripClientIsNeeded() == false) return;
322335

323336
#ifdef COMPILE_WIFI
324337
//Periodically display the NTRIP client state

Firmware/RTK_Surveyor/States.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,9 @@ void updateSystemState()
234234

235235
displayBaseStart(0); //Show 'Base'
236236

237-
wifiStop(); //Stop WiFi. Re-enable in each specific base start state.
237+
//Allow WiFi to continue running if NTRIP Client is needed for assisted survey in
238+
if(wifiIsNeeded() == false)
239+
wifiStop();
238240

239241
bluetoothStop();
240242
bluetoothStart(); //Restart Bluetooth with 'Base' identifier

Firmware/RTK_Surveyor/WiFi.ino

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,13 @@ bool wifiIsNeeded()
460460
)
461461
needed = true;
462462

463+
//If the user has enabled NTRIP Client for an Assisted Survey-In, and Survey-In is running, keep WiFi on.
464+
if (systemState >= STATE_BASE_NOT_STARTED && systemState <= STATE_BASE_TEMP_SURVEY_STARTED
465+
&& settings.enableNtripClient == true
466+
&& settings.fixedBase == false
467+
)
468+
needed = true;
469+
463470
//If WiFi is on while we are in the following states, allow WiFi to continue to operate
464471
if (systemState >= STATE_BUBBLE_LEVEL && systemState <= STATE_PROFILE)
465472
{

0 commit comments

Comments
 (0)