@@ -319,6 +319,15 @@ boolean SFE_UBLOX_GPS::checkUbloxI2C()
319
319
_debugSerial->println (F (" bytes received" ));
320
320
}
321
321
}
322
+ else
323
+ {
324
+ if (_printDebug == true )
325
+ {
326
+ _debugSerial->print (F (" checkUbloxI2C: Reading " ));
327
+ _debugSerial->print (bytesAvailable);
328
+ _debugSerial->println (F (" bytes" ));
329
+ }
330
+ }
322
331
323
332
while (bytesAvailable)
324
333
{
@@ -630,6 +639,16 @@ void SFE_UBLOX_GPS::processUBX(uint8_t incoming, ubxPacket *incomingUBX)
630
639
}
631
640
632
641
incomingUBX->counter ++;
642
+ if (incomingUBX->counter == MAX_PAYLOAD_SIZE)
643
+ {
644
+ // Something has gone very wrong
645
+ currentSentence = NONE; // Reset the sentence to being looking for a new start char
646
+ if (_printDebug == true )
647
+ {
648
+ _debugSerial->println (F (" processUBX: counter hit MAX_PAYLOAD_SIZE" ));
649
+ }
650
+ Serial.println (F (" processUBX: counter hit MAX_PAYLOAD_SIZE" ));
651
+ }
633
652
}
634
653
635
654
// Once a packet has been received and validated, identify this packet's class/id and update internal flags
@@ -956,6 +975,10 @@ void SFE_UBLOX_GPS::printPacket(ubxPacket *packet)
956
975
_debugSerial->print (F (" ID:" ));
957
976
if (packet->cls == UBX_CLASS_NAV && packet->id == UBX_NAV_PVT)
958
977
_debugSerial->print (" PVT" );
978
+ else if (packet->cls == UBX_CLASS_CFG && packet->id == UBX_CFG_RATE)
979
+ _debugSerial->print (" RATE" );
980
+ else if (packet->cls == UBX_CLASS_CFG && packet->id == UBX_CFG_CFG)
981
+ _debugSerial->print (" SAVE" );
959
982
else
960
983
_debugSerial->print (packet->id , HEX);
961
984
0 commit comments