@@ -49,107 +49,152 @@ void menuBase()
4949 Serial.println (F (" meters" ));
5050 }
5151
52+ Serial.print (F (" 4) Toggle NTRIP Server: " ));
53+ if (settings.enableNtripServer == true ) Serial.println (F (" Enabled" ));
54+ else Serial.println (F (" Disabled" ));
55+
56+ if (settings.enableNtripServer == true )
57+ {
58+ Serial.print (F (" 5) Set WiFi SSID: " ));
59+ Serial.println (settings.wifiSSID );
60+
61+ Serial.print (F (" 6) Set WiFi PW: " ));
62+ Serial.println (settings.wifiPW );
63+
64+ Serial.print (F (" 7) Set Caster Address: " ));
65+ Serial.println (settings.casterHost );
66+
67+ Serial.print (F (" 8) Set Caster Port: " ));
68+ Serial.println (settings.casterPort );
69+
70+ Serial.print (F (" 9) Set Mountpoint: " ));
71+ Serial.println (settings.mountPoint );
72+
73+ Serial.print (F (" 10) Set Mountpoint PW: " ));
74+ Serial.println (settings.mountPointPW );
75+ }
76+
5277 Serial.println (F (" x) Exit" ));
5378
54- byte incoming = getByteChoice (30 ); // Timeout after x seconds
79+ int incoming = getNumber (30 ); // Timeout after x seconds
5580
56- if (incoming == ' 1 ' )
81+ if (incoming == 1 )
5782 {
5883 settings.fixedBase ^= 1 ;
5984 }
60- else if (settings.fixedBase == true )
85+ else if (settings.fixedBase == true && incoming == 2 )
86+ {
87+ settings.fixedBaseCoordinateType ^= 1 ;
88+ }
89+ else if (settings.fixedBase == true && incoming == 3 )
6190 {
62- if (incoming == ' 2 ' )
91+ if (settings. fixedBaseCoordinateType == COORD_TYPE_ECEF )
6392 {
64- settings.fixedBaseCoordinateType ^= 1 ;
93+ Serial.println (F (" Enter the fixed ECEF coordinates that will be used in Base mode:" ));
94+
95+ Serial.print (F (" ECEF X in meters (ex: -1280182.920): " ));
96+ double fixedEcefX = getDouble (menuTimeout); // Timeout after x seconds
97+ settings.fixedEcefX = fixedEcefX;
98+
99+ Serial.print (F (" \n ECEF Y in meters (ex: -4716808.5807): " ));
100+ double fixedEcefY = getDouble (menuTimeout);
101+ settings.fixedEcefY = fixedEcefY;
102+
103+ Serial.print (F (" \n ECEF Z in meters (ex: 4086669.6393): " ));
104+ double fixedEcefZ = getDouble (menuTimeout);
105+ settings.fixedEcefZ = fixedEcefZ;
106+
107+ Serial.printf (" \n X: %f\n " , settings.fixedEcefX );
108+ Serial.printf (" Y: %f\n " , settings.fixedEcefY );
109+ Serial.printf (" Z: %f\n " , settings.fixedEcefZ );
65110 }
66- if (incoming == ' 3 ' )
111+ else if (settings. fixedBaseCoordinateType == COORD_TYPE_GEOGRAPHIC )
67112 {
68- if (settings.fixedBaseCoordinateType == COORD_TYPE_ECEF)
69- {
70- Serial.println (F (" Enter the fixed ECEF coordinates that will be used in Base mode:" ));
71-
72- Serial.print (F (" ECEF X in meters (ex: -1280182.920): " ));
73- double fixedEcefX = getDouble (menuTimeout); // Timeout after x seconds
74- settings.fixedEcefX = fixedEcefX;
75-
76- Serial.print (F (" \n ECEF Y in meters (ex: -4716808.5807): " ));
77- double fixedEcefY = getDouble (menuTimeout);
78- settings.fixedEcefY = fixedEcefY;
79-
80- Serial.print (F (" \n ECEF Z in meters (ex: 4086669.6393): " ));
81- double fixedEcefZ = getDouble (menuTimeout);
82- settings.fixedEcefZ = fixedEcefZ;
83-
84- Serial.printf (" \n X: %f\n " , settings.fixedEcefX );
85- Serial.printf (" Y: %f\n " , settings.fixedEcefY );
86- Serial.printf (" Z: %f\n " , settings.fixedEcefZ );
87- }
88- else if (settings.fixedBaseCoordinateType == COORD_TYPE_GEOGRAPHIC)
89- {
90- Serial.println (F (" Enter the fixed Lat/Long/Altitude coordinates that will be used in Base mode:" ));
91-
92- Serial.print (F (" Lat in degrees (ex: -105.184774720): " ));
93- double fixedLat = getDouble (menuTimeout); // Timeout after x seconds
94- settings.fixedLat = fixedLat;
95-
96- Serial.print (F (" \n Long in degrees (ex: 40.090335429): " ));
97- double fixedLong = getDouble (menuTimeout);
98- settings.fixedLong = fixedLong;
99-
100- Serial.print (F (" \n Altitude in meters (ex: 1560.2284): " ));
101- double fixedAltitude = getDouble (menuTimeout);
102- settings.fixedAltitude = fixedAltitude;
103-
104- Serial.printf (" \n lat: %f\n " , settings.fixedLat );
105- Serial.printf (" long: %f\n " , settings.fixedLong );
106- Serial.printf (" altitude: %f\n " , settings.fixedAltitude );
107- }
113+ Serial.println (F (" Enter the fixed Lat/Long/Altitude coordinates that will be used in Base mode:" ));
114+
115+ Serial.print (F (" Lat in degrees (ex: -105.184774720): " ));
116+ double fixedLat = getDouble (menuTimeout); // Timeout after x seconds
117+ settings.fixedLat = fixedLat;
118+
119+ Serial.print (F (" \n Long in degrees (ex: 40.090335429): " ));
120+ double fixedLong = getDouble (menuTimeout);
121+ settings.fixedLong = fixedLong;
122+
123+ Serial.print (F (" \n Altitude in meters (ex: 1560.2284): " ));
124+ double fixedAltitude = getDouble (menuTimeout);
125+ settings.fixedAltitude = fixedAltitude;
126+
127+ Serial.printf (" \n lat: %f\n " , settings.fixedLat );
128+ Serial.printf (" long: %f\n " , settings.fixedLong );
129+ Serial.printf (" altitude: %f\n " , settings.fixedAltitude );
108130 }
109- else if (incoming == ' x' )
110- break ;
111- else if (incoming == STATUS_GETBYTE_TIMEOUT)
112- break ;
113- else
114- printUnknown (incoming);
115131 }
116- else if (settings.fixedBase == false )
132+ else if (settings.fixedBase == false && incoming == 2 )
117133 {
118- if (incoming == ' 2' )
134+ Serial.print (F (" Enter the number of seconds for survey-in obseration time (60 to 600s): " ));
135+ int observationSeconds = getNumber (menuTimeout); // Timeout after x seconds
136+ if (observationSeconds < 60 || observationSeconds > 60 * 10 ) // Arbitrary 10 minute limit
119137 {
120- Serial.print (F (" Enter the number of seconds for survey-in obseration time (60 to 600s): " ));
121- int observationSeconds = getNumber (menuTimeout); // Timeout after x seconds
122- if (observationSeconds < 60 || observationSeconds > 60 * 10 ) // Arbitrary 10 minute limit
123- {
124- Serial.println (F (" Error: observation seconds out of range" ));
125- }
126- else
127- {
128- settings.observationSeconds = observationSeconds; // Recorded to NVM and file at main menu exit
129- }
138+ Serial.println (F (" Error: observation seconds out of range" ));
130139 }
131- else if (incoming == ' 3 ' )
140+ else
132141 {
133- Serial. print ( F ( " Enter the number of meters for survey-in required position accuracy (1.0 to 5.0m): " ));
134- float observationPositionAccuracy = getDouble (menuTimeout); // Timeout after x seconds
135- if (observationPositionAccuracy < 1.0 || observationPositionAccuracy > 5.0 ) // Arbitrary 1m minimum
136- {
137- Serial. println ( F ( " Error: observation positional accuracy requirement out of range " ));
138- }
139- else
140- {
141- settings. observationPositionAccuracy = observationPositionAccuracy; // Recorded to NVM and file at main menu exit
142- }
142+ settings. observationSeconds = observationSeconds; // Recorded to NVM and file at main menu exit
143+ }
144+ }
145+ else if (settings. fixedBase == false && incoming == 3 )
146+ {
147+ Serial. print ( F ( " Enter the number of meters for survey-in required position accuracy (1.0 to 5.0m): " ));
148+ float observationPositionAccuracy = getDouble (menuTimeout); // Timeout after x seconds
149+ if (observationPositionAccuracy < 1.0 || observationPositionAccuracy > 5.0 ) // Arbitrary 1m minimum
150+ {
151+ Serial. println ( F ( " Error: observation positional accuracy requirement out of range " ));
143152 }
144- else if (incoming == ' x' )
145- break ;
146- else if (incoming == STATUS_GETBYTE_TIMEOUT)
147- break ;
148153 else
149- printUnknown (incoming);
154+ {
155+ settings.observationPositionAccuracy = observationPositionAccuracy; // Recorded to NVM and file at main menu exit
156+ }
150157 }
158+ else if (incoming == 4 )
159+ {
160+ settings.enableNtripServer ^= 1 ;
161+ }
162+ else if (incoming == 5 && settings.enableNtripServer == true )
163+ {
164+ Serial.print (F (" Enter new WiFi SSID: " ));
165+ readLine (settings.wifiSSID , sizeof (settings.wifiSSID ), menuTimeout);
166+ }
167+ else if (incoming == 6 && settings.enableNtripServer == true )
168+ {
169+ Serial.print (F (" Enter new WiFi PW: " ));
170+ readLine (settings.wifiPW , sizeof (settings.wifiPW ), menuTimeout);
171+ }
172+ else if (incoming == 7 && settings.enableNtripServer == true )
173+ {
174+ Serial.print (F (" Enter new Caster Address: " ));
175+ readLine (settings.casterHost , sizeof (settings.casterHost ), menuTimeout);
176+ }
177+ else if (incoming == 8 && settings.enableNtripServer == true )
178+ {
179+ Serial.print (F (" Enter new Caster Port: " ));
151180
152- else if (incoming == ' x' )
181+ int casterPort = getNumber (menuTimeout); // Timeout after x seconds
182+ if (casterPort < 1 || casterPort > 99999 ) // Arbitrary 99k max port #
183+ Serial.println (F (" Error: Caster Port out of range" ));
184+ else
185+ settings.casterPort = casterPort; // Recorded to NVM and file at main menu exit
186+ }
187+ else if (incoming == 9 && settings.enableNtripServer == true )
188+ {
189+ Serial.print (F (" Enter new Mount Point: " ));
190+ readLine (settings.mountPoint , sizeof (settings.mountPoint ), menuTimeout);
191+ }
192+ else if (incoming == 10 && settings.enableNtripServer == true )
193+ {
194+ Serial.print (F (" Enter new Mount Point PW: " ));
195+ readLine (settings.mountPointPW , sizeof (settings.mountPointPW ), menuTimeout);
196+ }
197+ else if (incoming == STATUS_PRESSED_X)
153198 break ;
154199 else if (incoming == STATUS_GETBYTE_TIMEOUT)
155200 break ;
0 commit comments