Skip to content

Commit 64b146b

Browse files
committed
Add RTK_MODE_BASE_UNDECIDED to prevent NTRIP Client starting prematurely
1 parent 927dc29 commit 64b146b

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

Firmware/RTK_Everywhere/Network.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ void networkDisplayMode()
840840

841841
if (rtkMode == 0)
842842
{
843-
systemPrintf("rtkMode: 0 (Not specified)\r\n");
843+
systemPrintf("rtkMode: 0 (Not Specified or Base Undecided)\r\n");
844844
return;
845845
}
846846

Firmware/RTK_Everywhere/States.ino

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ void stateUpdate()
226226
// Note: this works when switching from Rover (e.g. with RTK Fix)
227227
// or when switching from Temporary Base (after Survey-In)
228228
case (STATE_BASE_ASSIST_NOT_STARTED): {
229-
RTK_MODE(RTK_MODE_BASE_FIXED);
229+
// Mark RTK_MODE as BASE_UNDECIDED to avoid starting NTRIP Client when we do not need it
230+
RTK_MODE(RTK_MODE_BASE_UNDECIDED);
230231
firstRoverStart = false; // If base is starting, no test menu, normal button use.
231232

232233
if (online.gnss == false)
@@ -267,7 +268,8 @@ void stateUpdate()
267268
break;
268269

269270
case (STATE_BASE_NOT_STARTED): {
270-
RTK_MODE(RTK_MODE_BASE_SURVEY_IN);
271+
// Mark RTK_MODE as BASE_UNDECIDED to avoid starting NTRIP Client when we may not need it
272+
RTK_MODE(RTK_MODE_BASE_UNDECIDED);
271273
firstRoverStart = false; // If base is starting, no test menu, normal button use.
272274

273275
if (online.gnss == false)
@@ -299,12 +301,15 @@ void stateUpdate()
299301
displayBaseSuccess(500); // Show 'Base Started'
300302

301303
if (settings.fixedBase == false)
304+
{
302305
changeState(STATE_BASE_TEMP_SETTLE);
306+
RTK_MODE(RTK_MODE_BASE_SURVEY_IN); // Now allow NTRIP Client to start
307+
}
303308
else
304309
{
305310
gnssConfigure(GNSS_CONFIG_BASE_FIXED); // Request start of fixed base
306311
changeState(STATE_BASE_FIXED_NOT_STARTED);
307-
RTK_MODE(RTK_MODE_BASE_FIXED);
312+
RTK_MODE(RTK_MODE_BASE_FIXED); // Now allow NTRIP Server to start
308313
}
309314
}
310315
}

Firmware/RTK_Everywhere/settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ SystemState requestedSystemState = STATE_NOT_SET;
131131
bool newSystemStateRequested = false;
132132

133133
// Base modes set with RTK_MODE
134+
#define RTK_MODE_BASE_UNDECIDED 0
134135
#define RTK_MODE_BASE_FIXED 0x0001 // 1 << 0
135136
#define RTK_MODE_BASE_SURVEY_IN 0x0002 // 1 << 1
136137
#define RTK_MODE_NTP 0x0004 // 1 << 2

0 commit comments

Comments
 (0)