Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Commit c738f7a

Browse files
committed
Merge branch 'Experimental_ACKResponse' into Experimental__custom_packetCfg
2 parents 98d9edf + 3a69451 commit c738f7a

File tree

1 file changed

+39
-40
lines changed

1 file changed

+39
-40
lines changed

src/SparkFun_Ublox_Arduino_Library.cpp

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -437,10 +437,6 @@ void SFE_UBLOX_GPS::process(uint8_t incoming, ubxPacket *incomingUBX, uint8_t re
437437
//This is the start of a binary sentence. Reset flags.
438438
//We still don't know the response class
439439
ubxFrameCounter = 0;
440-
441-
rollingChecksumA = 0; //Reset our rolling checksums
442-
rollingChecksumB = 0;
443-
444440
currentSentence = UBX;
445441
}
446442
else if (incoming == '$')
@@ -468,6 +464,9 @@ void SFE_UBLOX_GPS::process(uint8_t incoming, ubxPacket *incomingUBX, uint8_t re
468464
currentSentence = NONE; //Something went wrong. Reset.
469465
else if (ubxFrameCounter == 2) //Class
470466
{
467+
//Reset our rolling checksums here (not when we receive the 0xB5)
468+
rollingChecksumA = 0;
469+
rollingChecksumB = 0;
471470
//We can now identify the type of response
472471
if (incoming == UBX_CLASS_ACK)
473472
{
@@ -587,54 +586,54 @@ void SFE_UBLOX_GPS::processUBX(uint8_t incoming, ubxPacket *incomingUBX, uint8_t
587586
if (incomingUBX->counter == 0)
588587
{
589588
incomingUBX->cls = incoming;
590-
if (_printDebug == true)
591-
{
592-
_debugSerial->print(F("processUBX: Class : 0x"));
593-
_debugSerial->print(incomingUBX->cls, HEX);
594-
_debugSerial->print(F(" CSUMA: 0x"));
595-
_debugSerial->print(rollingChecksumA, HEX);
596-
_debugSerial->print(F(" CSUMB: 0x"));
597-
_debugSerial->println(rollingChecksumB, HEX);
598-
}
589+
// if (_printDebug == true)
590+
// {
591+
// _debugSerial->print(F("processUBX: Class : 0x"));
592+
// _debugSerial->print(incomingUBX->cls, HEX);
593+
// _debugSerial->print(F(" CSUMA: 0x"));
594+
// _debugSerial->print(rollingChecksumA, HEX);
595+
// _debugSerial->print(F(" CSUMB: 0x"));
596+
// _debugSerial->println(rollingChecksumB, HEX);
597+
// }
599598
}
600599
else if (incomingUBX->counter == 1)
601600
{
602601
incomingUBX->id = incoming;
603-
if (_printDebug == true)
604-
{
605-
_debugSerial->print(F("processUBX: ID : 0x"));
606-
_debugSerial->print(incomingUBX->id, HEX);
607-
_debugSerial->print(F(" CSUMA: 0x"));
608-
_debugSerial->print(rollingChecksumA, HEX);
609-
_debugSerial->print(F(" CSUMB: 0x"));
610-
_debugSerial->println(rollingChecksumB, HEX);
611-
}
602+
// if (_printDebug == true)
603+
// {
604+
// _debugSerial->print(F("processUBX: ID : 0x"));
605+
// _debugSerial->print(incomingUBX->id, HEX);
606+
// _debugSerial->print(F(" CSUMA: 0x"));
607+
// _debugSerial->print(rollingChecksumA, HEX);
608+
// _debugSerial->print(F(" CSUMB: 0x"));
609+
// _debugSerial->println(rollingChecksumB, HEX);
610+
// }
612611
}
613612
else if (incomingUBX->counter == 2) //Len LSB
614613
{
615614
incomingUBX->len = incoming;
616-
if (_printDebug == true)
617-
{
618-
_debugSerial->print(F("processUBX: LEN_LSB: 0x"));
619-
_debugSerial->print(incomingUBX->len, HEX);
620-
_debugSerial->print(F(" CSUMA: 0x"));
621-
_debugSerial->print(rollingChecksumA, HEX);
622-
_debugSerial->print(F(" CSUMB: 0x"));
623-
_debugSerial->println(rollingChecksumB, HEX);
624-
}
615+
// if (_printDebug == true)
616+
// {
617+
// _debugSerial->print(F("processUBX: LEN_LSB: 0x"));
618+
// _debugSerial->print(incomingUBX->len, HEX);
619+
// _debugSerial->print(F(" CSUMA: 0x"));
620+
// _debugSerial->print(rollingChecksumA, HEX);
621+
// _debugSerial->print(F(" CSUMB: 0x"));
622+
// _debugSerial->println(rollingChecksumB, HEX);
623+
// }
625624
}
626625
else if (incomingUBX->counter == 3) //Len MSB
627626
{
628627
incomingUBX->len |= incoming << 8;
629-
if (_printDebug == true)
630-
{
631-
_debugSerial->print(F("processUBX: LEN_MSB: 0x"));
632-
_debugSerial->print(incoming, HEX);
633-
_debugSerial->print(F(" CSUMA: 0x"));
634-
_debugSerial->print(rollingChecksumA, HEX);
635-
_debugSerial->print(F(" CSUMB: 0x"));
636-
_debugSerial->println(rollingChecksumB, HEX);
637-
}
628+
// if (_printDebug == true)
629+
// {
630+
// _debugSerial->print(F("processUBX: LEN_MSB: 0x"));
631+
// _debugSerial->print(incoming, HEX);
632+
// _debugSerial->print(F(" CSUMA: 0x"));
633+
// _debugSerial->print(rollingChecksumA, HEX);
634+
// _debugSerial->print(F(" CSUMB: 0x"));
635+
// _debugSerial->println(rollingChecksumB, HEX);
636+
// }
638637
}
639638
else if (incomingUBX->counter == incomingUBX->len + 4) //ChecksumA
640639
{

0 commit comments

Comments
 (0)