@@ -554,7 +554,7 @@ void SFE_UBLOX_GPS::process(uint8_t incoming, ubxPacket *incomingUBX, uint8_t re
554
554
// So let's check for an HPPOSLLH message arriving when we were expecting PVT and vice versa
555
555
else if ((packetBuf.cls == requestedClass) &&
556
556
(((packetBuf.id == UBX_NAV_PVT) && (requestedID == UBX_NAV_HPPOSLLH || requestedID == UBX_NAV_DOP)) ||
557
- ((packetBuf.id == UBX_NAV_HPPOSLLH) && (requestedID == UBX_NAV_PVT || requestedID == UBX_NAV_DOP)) ||
557
+ ((packetBuf.id == UBX_NAV_HPPOSLLH) && (requestedID == UBX_NAV_PVT || requestedID == UBX_NAV_DOP)) ||
558
558
((packetBuf.id == UBX_NAV_DOP) && (requestedID == UBX_NAV_PVT || requestedID == UBX_NAV_HPPOSLLH))))
559
559
{
560
560
// This is not the message we were expecting but we start diverting data into incomingUBX (usually packetCfg) and process it anyway
@@ -564,7 +564,25 @@ void SFE_UBLOX_GPS::process(uint8_t incoming, ubxPacket *incomingUBX, uint8_t re
564
564
incomingUBX->counter = packetBuf.counter ; // Copy over the .counter too
565
565
if (_printDebug == true )
566
566
{
567
- _debugSerial->print (F (" process: auto PVT/HPPOSLLH/DOP collision: Requested ID: 0x" ));
567
+ _debugSerial->print (F (" process: auto NAV PVT/HPPOSLLH/DOP collision: Requested ID: 0x" ));
568
+ _debugSerial->print (requestedID, HEX);
569
+ _debugSerial->print (F (" Message ID: 0x" ));
570
+ _debugSerial->println (packetBuf.id , HEX);
571
+ }
572
+ }
573
+ else if ((packetBuf.cls == requestedClass) &&
574
+ (((packetBuf.id == UBX_HNR_ATT) && (requestedID == UBX_HNR_INS || requestedID == UBX_HNR_PVT)) ||
575
+ ((packetBuf.id == UBX_HNR_INS) && (requestedID == UBX_HNR_ATT || requestedID == UBX_HNR_PVT)) ||
576
+ ((packetBuf.id == UBX_HNR_PVT) && (requestedID == UBX_HNR_ATT || requestedID == UBX_HNR_INS))))
577
+ {
578
+ // This is not the message we were expecting but we start diverting data into incomingUBX (usually packetCfg) and process it anyway
579
+ activePacketBuffer = SFE_UBLOX_PACKET_PACKETCFG;
580
+ incomingUBX->cls = packetBuf.cls ; // Copy the class and ID into incomingUBX (usually packetCfg)
581
+ incomingUBX->id = packetBuf.id ;
582
+ incomingUBX->counter = packetBuf.counter ; // Copy over the .counter too
583
+ if (_printDebug == true )
584
+ {
585
+ _debugSerial->print (F (" process: auto HNR ATT/INS/PVT collision: Requested ID: 0x" ));
568
586
_debugSerial->print (requestedID, HEX);
569
587
_debugSerial->print (F (" Message ID: 0x" ));
570
588
_debugSerial->println (packetBuf.id , HEX);
@@ -837,12 +855,28 @@ void SFE_UBLOX_GPS::processUBX(uint8_t incoming, ubxPacket *incomingUBX, uint8_t
837
855
// Let's say so and leave incomingUBX->classAndIDmatch _unchanged_
838
856
if (_printDebug == true )
839
857
{
840
- _debugSerial->print (F (" processUBX: auto PVT/HPPOSLLH/DOP collision: Requested ID: 0x" ));
858
+ _debugSerial->print (F (" processUBX: auto NAV PVT/HPPOSLLH/DOP collision: Requested ID: 0x" ));
841
859
_debugSerial->print (requestedID, HEX);
842
860
_debugSerial->print (F (" Message ID: 0x" ));
843
861
_debugSerial->println (incomingUBX->id , HEX);
844
862
}
845
863
}
864
+ // Let's do the same for the HNR messages
865
+ else if ((incomingUBX->cls == requestedClass) &&
866
+ (((incomingUBX->id == UBX_HNR_ATT) && (requestedID == UBX_HNR_INS || requestedID == UBX_HNR_PVT)) ||
867
+ ((incomingUBX->id == UBX_HNR_INS) && (requestedID == UBX_HNR_ATT || requestedID == UBX_HNR_PVT)) ||
868
+ ((incomingUBX->id == UBX_HNR_PVT) && (requestedID == UBX_HNR_ATT || requestedID == UBX_HNR_INS))))
869
+ {
870
+ // This isn't the message we are looking for...
871
+ // Let's say so and leave incomingUBX->classAndIDmatch _unchanged_
872
+ if (_printDebug == true )
873
+ {
874
+ _debugSerial->print (F (" processUBX: auto HNR ATT/INS/PVT collision: Requested ID: 0x" ));
875
+ _debugSerial->print (requestedID, HEX);
876
+ _debugSerial->print (F (" Message ID: 0x" ));
877
+ _debugSerial->println (incomingUBX->id , HEX);
878
+ }
879
+ }
846
880
847
881
if (_printDebug == true )
848
882
{
@@ -3233,9 +3267,9 @@ boolean SFE_UBLOX_GPS::getPVT(uint16_t maxWait)
3233
3267
{
3234
3268
if (_printDebug == true )
3235
3269
{
3236
- _debugSerial->println (F (" getPVT: data was OVERWRITTEN by a HNR message (but that's OK)" ));
3270
+ _debugSerial->println (F (" getPVT: data was OVERWRITTEN by a HNR message (and that's not OK)" ));
3237
3271
}
3238
- return (true );
3272
+ return (false );
3239
3273
}
3240
3274
3241
3275
if (_printDebug == true )
@@ -3417,9 +3451,9 @@ boolean SFE_UBLOX_GPS::getHPPOSLLH(uint16_t maxWait)
3417
3451
{
3418
3452
if (_printDebug == true )
3419
3453
{
3420
- _debugSerial->println (F (" getHPPOSLLH: data was OVERWRITTEN by a HNR message (but that's OK)" ));
3454
+ _debugSerial->println (F (" getHPPOSLLH: data was OVERWRITTEN by a HNR message (and that's not OK)" ));
3421
3455
}
3422
- return (true );
3456
+ return (false );
3423
3457
}
3424
3458
3425
3459
if (_printDebug == true )
@@ -3544,7 +3578,7 @@ boolean SFE_UBLOX_GPS::getDOP(uint16_t maxWait)
3544
3578
{
3545
3579
if (_printDebug == true )
3546
3580
{
3547
- _debugSerial->println (F (" getHPPOSLLH : data was OVERWRITTEN by another NAV message (but that's OK)" ));
3581
+ _debugSerial->println (F (" getDOP : data was OVERWRITTEN by another NAV message (but that's OK)" ));
3548
3582
}
3549
3583
return (true );
3550
3584
}
@@ -3553,9 +3587,9 @@ boolean SFE_UBLOX_GPS::getDOP(uint16_t maxWait)
3553
3587
{
3554
3588
if (_printDebug == true )
3555
3589
{
3556
- _debugSerial->println (F (" getPVT : data was OVERWRITTEN by a HNR message (but that's OK)" ));
3590
+ _debugSerial->println (F (" getDOP : data was OVERWRITTEN by a HNR message (and that's not OK)" ));
3557
3591
}
3558
- return (true );
3592
+ return (false );
3559
3593
}
3560
3594
3561
3595
if (_printDebug == true )
@@ -4459,9 +4493,9 @@ boolean SFE_UBLOX_GPS::getHNRAtt(uint16_t maxWait)
4459
4493
{
4460
4494
if (_printDebug == true )
4461
4495
{
4462
- _debugSerial->println (F (" getHNRAtt: data was OVERWRITTEN by a NAV message (but that's OK)" ));
4496
+ _debugSerial->println (F (" getHNRAtt: data was OVERWRITTEN by a NAV message (and that's not OK)" ));
4463
4497
}
4464
- return (true );
4498
+ return (false );
4465
4499
}
4466
4500
4467
4501
if ((retVal == SFE_UBLOX_STATUS_DATA_OVERWRITTEN) && (packetCfg.cls == UBX_CLASS_HNR))
@@ -4579,9 +4613,9 @@ boolean SFE_UBLOX_GPS::getHNRDyn(uint16_t maxWait)
4579
4613
{
4580
4614
if (_printDebug == true )
4581
4615
{
4582
- _debugSerial->println (F (" getHNRDyn: data was OVERWRITTEN by a NAV message (but that's OK)" ));
4616
+ _debugSerial->println (F (" getHNRDyn: data was OVERWRITTEN by a NAV message (and that's not OK)" ));
4583
4617
}
4584
- return (true );
4618
+ return (false );
4585
4619
}
4586
4620
4587
4621
if ((retVal == SFE_UBLOX_STATUS_DATA_OVERWRITTEN) && (packetCfg.cls == UBX_CLASS_HNR))
@@ -4699,9 +4733,9 @@ boolean SFE_UBLOX_GPS::getHNRPVT(uint16_t maxWait)
4699
4733
{
4700
4734
if (_printDebug == true )
4701
4735
{
4702
- _debugSerial->println (F (" getHNRPVT: data was OVERWRITTEN by a NAV message (but that's OK)" ));
4736
+ _debugSerial->println (F (" getHNRPVT: data was OVERWRITTEN by a NAV message (and that's not OK)" ));
4703
4737
}
4704
- return (true );
4738
+ return (false );
4705
4739
}
4706
4740
4707
4741
if ((retVal == SFE_UBLOX_STATUS_DATA_OVERWRITTEN) && (packetCfg.cls == UBX_CLASS_HNR))
0 commit comments