@@ -91,8 +91,6 @@ int GPSController::NmeaBufPush(const char *new_sentence) {
91
91
strncpy (_nmea_buff.sentences [_nmea_buff.head ], new_sentence,
92
92
MAX_LEN_NMEA_SENTENCE - 1 );
93
93
_nmea_buff.sentences [_nmea_buff.head ][MAX_LEN_NMEA_SENTENCE - 1 ] = ' \0 ' ;
94
- WS_DEBUG_PRINT (" [gps] Pushing NMEA sentence: " );
95
- WS_DEBUG_PRINTLN (_nmea_buff.sentences [_nmea_buff.head ]);
96
94
_nmea_buff.head = next;
97
95
return 0 ;
98
96
}
@@ -130,12 +128,13 @@ void GPSController::update() {
130
128
131
129
for (GPSHardware *drv : _gps_drivers) {
132
130
131
+ // TODO: Commented out due to parsing failures, stability issue (failed to parse NMEA acks for this)
133
132
// Perform a keep-alive check by sending an antenna check command every 2
134
133
// seconds
135
- if (millis () - drv->GetPrvKat () > 2000 ) {
134
+ /* if (millis() - drv->GetPrvKat() > 2000) {
136
135
drv->GetAdaGps()->sendCommand(CMD_MTK_CHECK_ANTENNA);
137
136
drv->SetPrvKat(millis());
138
- }
137
+ } */
139
138
140
139
// Did read period elapse?
141
140
ulong cur_time = millis ();
@@ -179,9 +178,6 @@ void GPSController::update() {
179
178
// Check if we have a new NMEA sentence
180
179
if (drv->GetAdaGps ()->newNMEAreceived ()) {
181
180
// If we have a new sentence, push it to the buffer
182
- // TODO: Check result of this operation actually
183
- WS_DEBUG_PRINTLN (" [gps] New data, pushing sentence to buffer." );
184
- // Push the last NMEA sentence to the buffer
185
181
char *last_nmea = drv->GetAdaGps ()->lastNMEA ();
186
182
NmeaBufPush (drv->GetAdaGps ()->lastNMEA ());
187
183
}
@@ -201,11 +197,10 @@ void GPSController::update() {
201
197
// Parse the NMEA sentence
202
198
WS_DEBUG_PRINT (" [gps] Parsing NMEA sentence: " );
203
199
WS_DEBUG_PRINTLN (nmea_sentence);
204
- if (!drv->GetAdaGps ()->parse (nmea_sentence)) {
205
- WS_DEBUG_PRINT (" [gps] ERROR: Failed to parse NMEA sentence: " );
206
- WS_DEBUG_PRINTLN (nmea_sentence);
207
- continue ; // Skip this driver if parsing failed
208
- }
200
+ if (!drv->GetAdaGps ()->parse (nmea_sentence))
201
+ continue ; // Skip parsing this sentence if parsing failed
202
+
203
+ // Print the parsed data for debugging
209
204
Serial.print (" Fix: " );
210
205
Serial.print ((int )drv->GetAdaGps ()->fix );
211
206
Serial.print (" quality: " );
@@ -228,6 +223,8 @@ void GPSController::update() {
228
223
Serial.print (" Antenna status: " );
229
224
Serial.println ((int )drv->GetAdaGps ()->antenna );
230
225
}
226
+
227
+ // TODO: Okay so here we are going to create the model of gps data
231
228
}
232
229
WS_DEBUG_PRINTLN (" [gps] Finished processing NMEA sentences." );
233
230
// TODO: Successfully parsed the NMEA sentence, update the model
0 commit comments