@@ -10,7 +10,33 @@ void menuGNSS()
1010 Serial.print (F (" 1) Set measurement frequency: " ));
1111 Serial.println (settings.gnssMeasurementFrequency );
1212
13- Serial.println (F (" r) Reset GNSS Receiver" ));
13+ Serial.print (F (" 2) Toggle GxGGA sentence: " ));
14+ if (getNMEASettings (UBX_NMEA_GGA, COM_PORT_UART1) == 1 ) Serial.println (F (" Enabled" ));
15+ else Serial.println (F (" Disabled" ));
16+
17+ Serial.print (F (" 3) Toggle GxGSA sentence: " ));
18+ if (getNMEASettings (UBX_NMEA_GSA, COM_PORT_UART1) == 1 ) Serial.println (F (" Enabled" ));
19+ else Serial.println (F (" Disabled" ));
20+
21+ Serial.print (F (" 4) Toggle GxGSV sentence: " ));
22+ if (getNMEASettings (UBX_NMEA_GSV, COM_PORT_UART1) == settings.gnssMeasurementFrequency ) Serial.println (F (" Enabled" ));
23+ else Serial.println (F (" Disabled" ));
24+
25+ Serial.print (F (" 5) Toggle GxRMC sentence: " ));
26+ if (getNMEASettings (UBX_NMEA_RMC, COM_PORT_UART1) == 1 ) Serial.println (F (" Enabled" ));
27+ else Serial.println (F (" Disabled" ));
28+
29+ Serial.print (F (" 6) Toggle GxGST sentence: " ));
30+ if (getNMEASettings (UBX_NMEA_GST, COM_PORT_UART1) == 1 ) Serial.println (F (" Enabled" ));
31+ else Serial.println (F (" Disabled" ));
32+
33+ Serial.print (F (" 7) Toggle GNSS RAWX sentence: " ));
34+ if (getRAWXSettings (COM_PORT_UART1) == 1 ) Serial.println (F (" Enabled" ));
35+ else Serial.println (F (" Disabled" ));
36+
37+ Serial.print (F (" 8) Toggle SBAS: " ));
38+ if (getSBAS () == true ) Serial.println (F (" Enabled" ));
39+ else Serial.println (F (" Disabled" ));
1440
1541 Serial.println (F (" x) Exit" ));
1642
@@ -29,22 +55,113 @@ void menuGNSS()
2955 settings.gnssMeasurementFrequency = rate; // Recorded to NVM and file at main menu exit
3056 }
3157 }
32-
33- else if (incoming == ' r' )
58+ else if (incoming == ' 2' )
3459 {
35- Serial.println (F (" \r\n Resetting ZED-F9P to factory defaults. Press 'y' to confirm:" ));
36- byte bContinue = getByteChoice (menuTimeout);
37- if (bContinue == ' y' )
60+ if (getNMEASettings (UBX_NMEA_GGA, COM_PORT_UART1) == 1 )
3861 {
39- myGPS.factoryReset (); // Reset everything: baud rate, I2C address, update rate, everything.
40-
41- Serial.println (F (" ZED-F9P settings reset. Please reset RTK Surveyor. Freezing." ));
42- while (1 )
43- delay (1 ); // Prevent CPU freakout
62+ // Disable the sentence
63+ if (myGPS.disableNMEAMessage (UBX_NMEA_GGA, COM_PORT_UART1) == true )
64+ settings.outputSentenceGGA = false ;
65+ }
66+ else
67+ {
68+ // Enable the sentence
69+ if (myGPS.enableNMEAMessage (UBX_NMEA_GGA, COM_PORT_UART1) == true )
70+ settings.outputSentenceGGA = true ;
71+ }
72+ }
73+ else if (incoming == ' 3' )
74+ {
75+ if (getNMEASettings (UBX_NMEA_GSA, COM_PORT_UART1) == 1 )
76+ {
77+ // Disable the sentence
78+ if (myGPS.disableNMEAMessage (UBX_NMEA_GSA, COM_PORT_UART1) == true )
79+ settings.outputSentenceGSA = false ;
80+ }
81+ else
82+ {
83+ // Enable the sentence
84+ if (myGPS.enableNMEAMessage (UBX_NMEA_GSA, COM_PORT_UART1) == true )
85+ settings.outputSentenceGSA = true ;
86+ }
87+ }
88+ else if (incoming == ' 4' )
89+ {
90+ if (getNMEASettings (UBX_NMEA_GSV, COM_PORT_UART1) == settings.gnssMeasurementFrequency )
91+ {
92+ // Disable the sentence
93+ if (myGPS.disableNMEAMessage (UBX_NMEA_GSV, COM_PORT_UART1) == true )
94+ settings.outputSentenceGSV = false ;
95+ }
96+ else
97+ {
98+ // Enable the sentence at measurement rate to make sentence transmit at 1Hz to avoid stressing BT SPP buffers with 25+ SIV
99+ if (myGPS.enableNMEAMessage (UBX_NMEA_GSV, COM_PORT_UART1, settings.gnssMeasurementFrequency ) == true )
100+ settings.outputSentenceGSV = true ;
101+ }
102+ }
103+ else if (incoming == ' 5' )
104+ {
105+ if (getNMEASettings (UBX_NMEA_RMC, COM_PORT_UART1) == 1 )
106+ {
107+ // Disable the sentence
108+ if (myGPS.disableNMEAMessage (UBX_NMEA_RMC, COM_PORT_UART1) == true )
109+ settings.outputSentenceRMC = false ;
110+ }
111+ else
112+ {
113+ // Enable the sentence
114+ if (myGPS.enableNMEAMessage (UBX_NMEA_RMC, COM_PORT_UART1) == true )
115+ settings.outputSentenceRMC = true ;
116+ }
117+ }
118+ else if (incoming == ' 6' )
119+ {
120+ if (getNMEASettings (UBX_NMEA_GST, COM_PORT_UART1) == 1 )
121+ {
122+ // Disable the sentence
123+ if (myGPS.disableNMEAMessage (UBX_NMEA_GST, COM_PORT_UART1) == true )
124+ settings.outputSentenceGST = false ;
44125 }
45126 else
46- Serial.println (F (" Reset aborted" ));
127+ {
128+ // Enable the sentence
129+ if (myGPS.enableNMEAMessage (UBX_NMEA_GST, COM_PORT_UART1) == true )
130+ settings.outputSentenceGST = true ;
131+ }
47132 }
133+ else if (incoming == ' 7' )
134+ {
135+ if (getRAWXSettings (COM_PORT_UART1) == 1 )
136+ {
137+ // Disable
138+ if (myGPS.disableMessage (UBX_CLASS_RXM, UBX_RXM_RAWX, COM_PORT_UART1) == true )
139+ settings.gnssRAWOutput = false ;
140+ }
141+ else
142+ {
143+ // Enable
144+ if (myGPS.enableMessage (UBX_CLASS_RXM, UBX_RXM_RAWX, COM_PORT_UART1) == true )
145+ settings.gnssRAWOutput = true ;
146+ }
147+ }
148+ else if (incoming == ' 8' )
149+ {
150+ if (getSBAS () == true )
151+ {
152+ // Disable it
153+ if (setSBAS (false ) == true )
154+ settings.enableSBAS = false ;
155+ }
156+ else
157+ {
158+ // Enable it
159+ if (setSBAS (true ) == true )
160+ settings.enableSBAS = true ;
161+ }
162+
163+ }
164+
48165 else if (incoming == ' x' )
49166 break ;
50167 else if (incoming == STATUS_GETBYTE_TIMEOUT)
@@ -53,6 +170,7 @@ void menuGNSS()
53170 printUnknown (incoming);
54171 }
55172
173+ myGPS.saveConfiguration (); // Save the current settings to flash and BBR
56174 beginGNSS (); // Push any new settings to GNSS module
57175
58176 while (Serial.available ()) Serial.read (); // Empty buffer of any newline chars
0 commit comments