@@ -585,7 +585,9 @@ void SFE_UBLOX_GPS::process(uint8_t incoming, ubxPacket *incomingUBX, uint8_t re
585
585
_debugSerial->print (F (" process: ACK received with .len != 2: Class: 0x" ));
586
586
_debugSerial->print (packetBuf.payload [0 ], HEX);
587
587
_debugSerial->print (F (" ID: 0x" ));
588
- _debugSerial->println (packetBuf.payload [1 ], HEX);
588
+ _debugSerial->print (packetBuf.payload [1 ], HEX);
589
+ _debugSerial->print (F (" len: " ));
590
+ _debugSerial->println (packetBuf.len );
589
591
}
590
592
}
591
593
}
@@ -780,7 +782,11 @@ void SFE_UBLOX_GPS::processUBX(uint8_t incoming, ubxPacket *incomingUBX, uint8_t
780
782
}
781
783
}
782
784
783
- processUBXpacket (incomingUBX); // We've got a valid packet, now do something with it
785
+ // We've got a valid packet, now do something with it but only if ignoreThisPayload is false
786
+ if (ignoreThisPayload == false )
787
+ {
788
+ processUBXpacket (incomingUBX);
789
+ }
784
790
}
785
791
else // Checksum failure
786
792
{
@@ -1217,12 +1223,21 @@ void SFE_UBLOX_GPS::printPacket(ubxPacket *packet)
1217
1223
_debugSerial->print (F (" Len: 0x" ));
1218
1224
_debugSerial->print (packet->len , HEX);
1219
1225
1220
- _debugSerial->print (F (" Payload:" ));
1226
+ // Only print the payload is ignoreThisPayload is false otherwise
1227
+ // we could be printing gibberish from beyond the end of packetBuf
1228
+ if (ignoreThisPayload == false )
1229
+ {
1230
+ _debugSerial->print (F (" Payload:" ));
1221
1231
1222
- for (int x = 0 ; x < packet->len ; x++)
1232
+ for (int x = 0 ; x < packet->len ; x++)
1233
+ {
1234
+ _debugSerial->print (F (" " ));
1235
+ _debugSerial->print (packet->payload [x], HEX);
1236
+ }
1237
+ }
1238
+ else
1223
1239
{
1224
- _debugSerial->print (F (" " ));
1225
- _debugSerial->print (packet->payload [x], HEX);
1240
+ _debugSerial->print (F (" Payload: IGNORED" ));
1226
1241
}
1227
1242
_debugSerial->println ();
1228
1243
}
0 commit comments