@@ -1306,13 +1306,13 @@ void SFE_UBLOX_GNSS::process(uint8_t incoming, ubxPacket *incomingUBX, uint8_t r
1306
1306
{
1307
1307
// Divert incoming into the correct buffer
1308
1308
if (activePacketBuffer == SFE_UBLOX_PACKET_PACKETACK)
1309
- processUBX (incoming, &packetAck, requestedClass, requestedID );
1309
+ processUBX (incoming, &packetAck);
1310
1310
else if (activePacketBuffer == SFE_UBLOX_PACKET_PACKETCFG)
1311
- processUBX (incoming, &packetCfg, requestedClass, requestedID );
1311
+ processUBX (incoming, &packetCfg);
1312
1312
else if (activePacketBuffer == SFE_UBLOX_PACKET_PACKETBUF)
1313
- processUBX (incoming, &packetBuf, requestedClass, requestedID );
1313
+ processUBX (incoming, &packetBuf);
1314
1314
else // if (activePacketBuffer == SFE_UBLOX_PACKET_PACKETAUTO)
1315
- processUBX (incoming, &packetAuto, requestedClass, requestedID );
1315
+ processUBX (incoming, &packetAuto);
1316
1316
}
1317
1317
// Finally, increment the frame counter
1318
1318
ubxFrameCounter++;
@@ -1513,7 +1513,7 @@ void SFE_UBLOX_GNSS::processRTCM(uint8_t incoming) // IGNORE COMPILER WARNING un
1513
1513
// Set valid to VALID or NOT_VALID once sentence is completely received and passes or fails CRC
1514
1514
// The payload portion of the packet can be 100s of bytes but the max array size is packetCfgPayloadSize bytes.
1515
1515
// startingSpot can be set so we only record a subset of bytes within a larger packet.
1516
- void SFE_UBLOX_GNSS::processUBX (uint8_t incoming, ubxPacket *incomingUBX, uint8_t requestedClass, uint8_t requestedID )
1516
+ void SFE_UBLOX_GNSS::processUBX (uint8_t incoming, ubxPacket *incomingUBX)
1517
1517
{
1518
1518
// If incomingUBX is a user-defined custom packet, then the payload size could be different to packetCfgPayloadSize.
1519
1519
// TO DO: update this to prevent an overrun when receiving an automatic message
@@ -1587,54 +1587,6 @@ void SFE_UBLOX_GNSS::processUBX(uint8_t incoming, ubxPacket *incomingUBX, uint8_
1587
1587
incomingUBX->valid = SFE_UBLOX_PACKET_VALIDITY_VALID; // Flag the packet as valid
1588
1588
if (_printDebug) _debugSerial->println (" processUBX packet is valid" );
1589
1589
1590
- // ACK or NACK???
1591
- if (incomingUBX->isAckForClassAndId (requestedClass, requestedID)) {
1592
- if (_printDebug)
1593
- {
1594
- _debugSerial->print (F (" processUBX: ACK received: Requested Class: 0x" ));
1595
- _debugSerial->print (incomingUBX->payload [0 ], HEX);
1596
- _debugSerial->print (F (" Requested ID: 0x" ));
1597
- _debugSerial->println (incomingUBX->payload [1 ], HEX);
1598
- }
1599
- }
1600
-
1601
- else if (incomingUBX->isAckForClassAndId (requestedClass, requestedID))
1602
- {
1603
- if (_printDebug == true )
1604
- {
1605
- _debugSerial->print (F (" processUBX: NACK received: Requested Class: 0x" ));
1606
- _debugSerial->print (incomingUBX->payload [0 ], HEX);
1607
- _debugSerial->print (F (" Requested ID: 0x" ));
1608
- _debugSerial->println (incomingUBX->payload [1 ], HEX);
1609
- }
1610
- }
1611
-
1612
- else if (incomingUBX->isClassAndIdMatch (requestedClass, requestedID))
1613
- {
1614
- if (_printDebug == true )
1615
- {
1616
- _debugSerial->print (F (" processUBX: Message received for requested Class: 0x" ));
1617
- _debugSerial->print (incomingUBX->payload [0 ], HEX);
1618
- _debugSerial->print (F (" Requested ID: 0x" ));
1619
- _debugSerial->println (incomingUBX->payload [1 ], HEX);
1620
- }
1621
- }
1622
-
1623
- // This is not an ACK and we do not have a complete class and ID match
1624
- // So let's check for an "automatic" message arriving
1625
- else if (checkAutomatic (incomingUBX->cls , incomingUBX->id ))
1626
- {
1627
- // This isn't the message we are looking for...
1628
- // Let's say so...
1629
- if (_printDebug == true )
1630
- {
1631
- _debugSerial->print (F (" processUBX: incoming \" automatic\" message: Class: 0x" ));
1632
- _debugSerial->print (incomingUBX->cls , HEX);
1633
- _debugSerial->print (F (" ID: 0x" ));
1634
- _debugSerial->println (incomingUBX->id , HEX);
1635
- }
1636
- }
1637
-
1638
1590
if (_printDebug == true )
1639
1591
{
1640
1592
_debugSerial->print (F (" Incoming: Size: " ));
@@ -1643,7 +1595,6 @@ void SFE_UBLOX_GNSS::processUBX(uint8_t incoming, ubxPacket *incomingUBX, uint8_
1643
1595
printPacket (incomingUBX);
1644
1596
1645
1597
}
1646
-
1647
1598
// We've got a valid packet, now do something with it but only if ignoreThisPayload is false
1648
1599
if (ignoreThisPayload == false )
1649
1600
{
@@ -1691,9 +1642,13 @@ void SFE_UBLOX_GNSS::processUBX(uint8_t incoming, ubxPacket *incomingUBX, uint8_
1691
1642
{
1692
1643
// If an automatic packet comes in asynchronously, we need to fudge the startingSpot
1693
1644
uint16_t startingSpot = incomingUBX->startingSpot ;
1694
- if (!incomingUBX-> isClassAndIdMatch (requestedClass, requestedID) && checkAutomatic (incomingUBX->cls , incomingUBX->id ))
1645
+ if (checkAutomatic (incomingUBX->cls , incomingUBX->id ))
1695
1646
{
1696
- // _debugSerial->println("processUBX: incoming is automatic");
1647
+ if (_printDebug == true )
1648
+ {
1649
+ // _debugSerial->println("processUBX: incoming is automatic");
1650
+ }
1651
+
1697
1652
startingSpot = 0 ;
1698
1653
}
1699
1654
@@ -2979,7 +2934,6 @@ sfe_ublox_status_e SFE_UBLOX_GNSS::waitForACKResponse(ubxPacket *outgoingUBX, ui
2979
2934
{
2980
2935
if (checkUbloxInternal (outgoingUBX, requestedClass, requestedID) == true ) // See if new data is available. Process bytes as they come in.
2981
2936
{
2982
-
2983
2937
// If we are expecting an ACK only, return as soon as we have it!
2984
2938
if (expectACKonly && packetAck.isAckForClassAndId (requestedClass, requestedID) && packetAck.valid == SFE_UBLOX_PACKET_VALIDITY_VALID)
2985
2939
{
@@ -3064,19 +3018,6 @@ sfe_ublox_status_e SFE_UBLOX_GNSS::waitForACKResponse(ubxPacket *outgoingUBX, ui
3064
3018
}
3065
3019
return (SFE_UBLOX_STATUS_FAIL); // We received invalid data and an invalid ACK!
3066
3020
}
3067
-
3068
- // If the config packet is VALID and packetAck does not match the requested class/ID
3069
- // then the ACK has not yet been received and we should keep waiting for it
3070
- else if ((packetCfg.isClassAndIdMatch (requestedClass, requestedID) == true ) && (packetAck.isClassAndIdMatch (requestedClass, requestedID) == false ))
3071
- {
3072
- // if (_printDebug == true)
3073
- // {
3074
- // _debugSerial->print(F("waitForACKResponse: valid data after "));
3075
- // _debugSerial->print(millis() - startTime);
3076
- // _debugSerial->println(F(" msec. Waiting for ACK."));
3077
- // }
3078
- }
3079
-
3080
3021
} // checkUbloxInternal == true
3081
3022
3082
3023
delayMicroseconds (500 );
0 commit comments