@@ -224,7 +224,12 @@ void SFE_UBLOX_GPS::setSerialRate(uint32_t baudrate, uint8_t uartPort, uint16_t
224
224
_debugSerial->println (((uint32_t )payloadCfg[10 ] << 16 ) | ((uint32_t )payloadCfg[9 ] << 8 ) | payloadCfg[8 ]);
225
225
}
226
226
227
- sendCommand (packetCfg, maxWait);
227
+ sfe_ublox_status_e retVal = sendCommand (packetCfg, maxWait);
228
+ if (_printDebug == true )
229
+ {
230
+ _debugSerial->print (F (" setSerialRate: sendCommand returned: " ));
231
+ _debugSerial->println (statusString (retVal));
232
+ }
228
233
}
229
234
230
235
// Changes the I2C address that the Ublox module responds to
@@ -242,7 +247,7 @@ boolean SFE_UBLOX_GPS::setI2CAddress(uint8_t deviceAddress, uint16_t maxWait)
242
247
// payloadCfg is now loaded with current bytes. Change only the ones we need to
243
248
payloadCfg[4 ] = deviceAddress << 1 ; // DDC mode LSB
244
249
245
- if (sendCommand (packetCfg, maxWait) == true )
250
+ if (sendCommand (packetCfg, maxWait) == SFE_UBLOX_STATUS_DATA_SENT )
246
251
{
247
252
// Success! Now change our internal global.
248
253
_gpsI2Caddress = deviceAddress; // Store the I2C address from user
@@ -975,7 +980,14 @@ boolean SFE_UBLOX_GPS::isConnected()
975
980
packetCfg.len = 0 ;
976
981
packetCfg.startingSpot = 0 ;
977
982
978
- return sendCommand (packetCfg);
983
+ if (sendCommand (packetCfg) == SFE_UBLOX_STATUS_DATA_SENT)
984
+ {
985
+ return true ;
986
+ }
987
+ else
988
+ {
989
+ return false ;
990
+ }
979
991
}
980
992
return false ;
981
993
}
@@ -1257,7 +1269,7 @@ boolean SFE_UBLOX_GPS::saveConfiguration(uint16_t maxWait)
1257
1269
packetCfg.payload [4 ] = 0xFF ; // Set any bit in the saveMask field to save current config to Flash and BBR
1258
1270
packetCfg.payload [5 ] = 0xFF ;
1259
1271
1260
- if (sendCommand (packetCfg, maxWait) == false )
1272
+ if (sendCommand (packetCfg, maxWait) != SFE_UBLOX_STATUS_DATA_SENT )
1261
1273
return (false ); // If command send fails then bail
1262
1274
1263
1275
return (true );
@@ -1281,7 +1293,7 @@ boolean SFE_UBLOX_GPS::saveConfigSelective(uint32_t configMask, uint16_t maxWait
1281
1293
packetCfg.payload [6 ] = (configMask >> 16 ) & 0xFF ;
1282
1294
packetCfg.payload [7 ] = (configMask >> 24 ) & 0xFF ;
1283
1295
1284
- if (sendCommand (packetCfg, maxWait) == false )
1296
+ if (sendCommand (packetCfg, maxWait) != SFE_UBLOX_STATUS_DATA_SENT )
1285
1297
return (false ); // If command send fails then bail
1286
1298
1287
1299
return (true );
@@ -1305,7 +1317,7 @@ boolean SFE_UBLOX_GPS::factoryDefault(uint16_t maxWait)
1305
1317
packetCfg.payload [8 ] = 0xFF ; // Set any bit in the loadMask field to discard current config and rebuild from lower non-volatile memory layers
1306
1318
packetCfg.payload [9 ] = 0xFF ;
1307
1319
1308
- if (sendCommand (packetCfg, maxWait) == false )
1320
+ if (sendCommand (packetCfg, maxWait) != SFE_UBLOX_STATUS_DATA_SENT )
1309
1321
return (false ); // If command send fails then bail
1310
1322
1311
1323
return (true );
@@ -1364,7 +1376,14 @@ uint8_t SFE_UBLOX_GPS::getVal8(uint32_t key, uint8_t layer, uint16_t maxWait)
1364
1376
}
1365
1377
1366
1378
// Send VALGET command with this key
1367
- if (sendCommand (packetCfg, maxWait) == false )
1379
+
1380
+ sfe_ublox_status_e retVal = sendCommand (packetCfg, maxWait);
1381
+ if (_printDebug == true )
1382
+ {
1383
+ _debugSerial->print (F (" getVal8: sendCommand returned: " ));
1384
+ _debugSerial->println (statusString (retVal));
1385
+ }
1386
+ if (retVal != SFE_UBLOX_STATUS_DATA_SENT)
1368
1387
return (false ); // If command send fails then bail
1369
1388
1370
1389
// Verify the response is the correct length as compared to what the user called (did the module respond with 8-bits but the user called getVal32?)
0 commit comments