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

Commit 9bc3a2d

Browse files
committed
autoHPPOSLLH - almost ready
1 parent 9f72926 commit 9bc3a2d

File tree

1 file changed

+47
-9
lines changed

1 file changed

+47
-9
lines changed

Diff for: src/SparkFun_Ublox_Arduino_Library.cpp

+47-9
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,25 @@ void SFE_UBLOX_GPS::process(uint8_t incoming, ubxPacket *incomingUBX, uint8_t re
549549
incomingUBX->id = packetBuf.id;
550550
incomingUBX->counter = packetBuf.counter; //Copy over the .counter too
551551
}
552+
//This is not an ACK and we do not have a complete class and ID match
553+
//So let's check for an HPPOSLLH message arriving when we were expecting PVT and vice versa
554+
else if ((packetBuf.cls == requestedClass) &&
555+
(((packetBuf.id == UBX_NAV_PVT) && (requestedID == UBX_NAV_HPPOSLLH)) ||
556+
((packetBuf.id == UBX_NAV_HPPOSLLH) && (requestedID == UBX_NAV_PVT))))
557+
{
558+
//This is not the message we were expecting but we start diverting data into incomingUBX (usually packetCfg) and process it anyway
559+
activePacketBuffer = SFE_UBLOX_PACKET_PACKETCFG;
560+
incomingUBX->cls = packetBuf.cls; //Copy the class and ID into incomingUBX (usually packetCfg)
561+
incomingUBX->id = packetBuf.id;
562+
incomingUBX->counter = packetBuf.counter; //Copy over the .counter too
563+
if (_printDebug == true)
564+
{
565+
_debugSerial->print(F("process: auto PVT/HPPOSLLH collision: Requested ID: 0x"));
566+
_debugSerial->print(requestedID, HEX);
567+
_debugSerial->print(F(" Message ID: 0x"));
568+
_debugSerial->println(packetBuf.id, HEX);
569+
}
570+
}
552571
else
553572
{
554573
//This is not an ACK and we do not have a class and ID match
@@ -802,6 +821,23 @@ void SFE_UBLOX_GPS::processUBX(uint8_t incoming, ubxPacket *incomingUBX, uint8_t
802821
}
803822
}
804823

824+
//This is not an ACK and we do not have a complete class and ID match
825+
//So let's check for an HPPOSLLH message arriving when we were expecting PVT and vice versa
826+
else if ((incomingUBX->cls == requestedClass) &&
827+
(((incomingUBX->id == UBX_NAV_PVT) && (requestedID == UBX_NAV_HPPOSLLH)) ||
828+
((incomingUBX->id == UBX_NAV_HPPOSLLH) && (requestedID == UBX_NAV_PVT))))
829+
{
830+
// This isn't the message we are looking for...
831+
// Let's say so and leave incomingUBX->classAndIDmatch _unchanged_
832+
if (_printDebug == true)
833+
{
834+
_debugSerial->print(F("processUBX: auto PVT/HPPOSLLH collision: Requested ID: 0x"));
835+
_debugSerial->print(requestedID, HEX);
836+
_debugSerial->print(F(" Message ID: 0x"));
837+
_debugSerial->println(incomingUBX->id, HEX);
838+
}
839+
}
840+
805841
if (_printDebug == true)
806842
{
807843
_debugSerial->print(F("Incoming: Size: "));
@@ -1005,6 +1041,7 @@ void SFE_UBLOX_GPS::processUBXpacket(ubxPacket *msg)
10051041
highResModuleQueried.verticalAccuracy = true;
10061042
moduleQueried.gpsiTOW = true; // this can arrive via HPPOS too.
10071043

1044+
/*
10081045
if (_printDebug == true)
10091046
{
10101047
_debugSerial->print(F("Sec: "));
@@ -1040,6 +1077,7 @@ void SFE_UBLOX_GPS::processUBXpacket(ubxPacket *msg)
10401077
_debugSerial->print(F("VERT M: "));
10411078
_debugSerial->println(((float)(int32_t)extractLong(32)) / 10000.0f);
10421079
}
1080+
*/
10431081
}
10441082
break;
10451083
}
@@ -1541,15 +1579,15 @@ sfe_ublox_status_e SFE_UBLOX_GPS::waitForNoACKResponse(ubxPacket *outgoingUBX, u
15411579
// and outgoingUBX->valid is VALID then this must be (e.g.) a PVT packet
15421580
else if ((outgoingUBX->classAndIDmatch == SFE_UBLOX_PACKET_VALIDITY_NOT_DEFINED) && (outgoingUBX->valid == SFE_UBLOX_PACKET_VALIDITY_VALID))
15431581
{
1544-
if (_printDebug == true)
1545-
{
1546-
_debugSerial->print(F("waitForNoACKResponse: valid but UNWANTED data after "));
1547-
_debugSerial->print(millis() - startTime);
1548-
_debugSerial->print(F(" msec. Class: "));
1549-
_debugSerial->print(outgoingUBX->cls);
1550-
_debugSerial->print(F(" ID: "));
1551-
_debugSerial->print(outgoingUBX->id);
1552-
}
1582+
// if (_printDebug == true)
1583+
// {
1584+
// _debugSerial->print(F("waitForNoACKResponse: valid but UNWANTED data after "));
1585+
// _debugSerial->print(millis() - startTime);
1586+
// _debugSerial->print(F(" msec. Class: "));
1587+
// _debugSerial->print(outgoingUBX->cls);
1588+
// _debugSerial->print(F(" ID: "));
1589+
// _debugSerial->print(outgoingUBX->id);
1590+
// }
15531591
}
15541592

15551593
// If the outgoingUBX->classAndIDmatch is NOT_VALID then we return CRC failure

0 commit comments

Comments
 (0)