@@ -1039,10 +1039,15 @@ void SFE_UBLOX_GPS::processUBXpacket(ubxPacket *msg)
10391039 nedNorthVel = extractSignedLong (48 - startingSpot);
10401040 nedEastVel = extractSignedLong (52 - startingSpot);
10411041 nedDownVel = extractSignedLong (56 - startingSpot);
1042-
10431042 groundSpeed = extractSignedLong (60 - startingSpot);
10441043 headingOfMotion = extractSignedLong (64 - startingSpot);
1044+ speedAccEst = extractLong (68 - startingSpot);
1045+ headingAccEst = extractLong (72 - startingSpot);
10451046 pDOP = extractInt (76 - startingSpot);
1047+ invalidLlh = extractByte (78 - startingSpot) & 0x1 ;
1048+ headVeh = extractSignedLong (84 - startingSpot);
1049+ magDec = extractSignedInt (88 - startingSpot);
1050+ magAcc = extractInt (90 - startingSpot);
10461051
10471052 // Mark all datums as fresh (not read before)
10481053 moduleQueried.gpsiTOW = true ;
@@ -1063,19 +1068,23 @@ void SFE_UBLOX_GPS::processUBXpacket(ubxPacket *msg)
10631068 moduleQueried.latitude = true ;
10641069 moduleQueried.altitude = true ;
10651070 moduleQueried.altitudeMSL = true ;
1066-
10671071 moduleQueried.horizontalAccEst = true ;
10681072 moduleQueried.verticalAccEst = true ;
10691073 moduleQueried.nedNorthVel = true ;
10701074 moduleQueried.nedEastVel = true ;
10711075 moduleQueried.nedDownVel = true ;
1072-
10731076 moduleQueried.SIV = true ;
10741077 moduleQueried.fixType = true ;
10751078 moduleQueried.carrierSolution = true ;
10761079 moduleQueried.groundSpeed = true ;
10771080 moduleQueried.headingOfMotion = true ;
1081+ moduleQueried.speedAccEst = true ;
1082+ moduleQueried.headingAccEst = true ;
10781083 moduleQueried.pDOP = true ;
1084+ moduleQueried.invalidLlh = true ;
1085+ moduleQueried.headVeh = true ;
1086+ moduleQueried.magDec = true ;
1087+ moduleQueried.magAcc = true ;
10791088 }
10801089 else if (msg->id == UBX_NAV_HPPOSLLH && msg->len == 36 )
10811090 {
@@ -3111,6 +3120,19 @@ uint16_t SFE_UBLOX_GPS::extractInt(uint8_t spotToStart)
31113120 return (val);
31123121}
31133122
3123+ // Just so there is no ambiguity about whether a uint16_t will cast to a int16_t correctly...
3124+ int16_t SFE_UBLOX_GPS::extractSignedInt (int8_t spotToStart)
3125+ {
3126+ union // Use a union to convert from uint16_t to int16_t
3127+ {
3128+ uint16_t unsignedInt;
3129+ int16_t signedInt;
3130+ } stSignedInt;
3131+
3132+ stSignedInt.unsignedInt = extractInt (spotToStart);
3133+ return (stSignedInt.signedInt );
3134+ }
3135+
31143136// Given a spot, extract a byte from the payload
31153137uint8_t SFE_UBLOX_GPS::extractByte (uint8_t spotToStart)
31163138{
@@ -3195,6 +3217,54 @@ bool SFE_UBLOX_GPS::getTimeValid(uint16_t maxWait)
31953217 return (gpsTimeValid);
31963218}
31973219
3220+ uint32_t SFE_UBLOX_GPS::getSpeedAccEst (uint16_t maxWait)
3221+ {
3222+ if (moduleQueried.speedAccEst == false )
3223+ getPVT (maxWait);
3224+ moduleQueried.speedAccEst = false ; // Since we are about to give this to user, mark this data as stale
3225+ return (speedAccEst);
3226+ }
3227+
3228+ uint32_t SFE_UBLOX_GPS::getHeadingAccEst (uint16_t maxWait)
3229+ {
3230+ if (moduleQueried.headingAccEst == false )
3231+ getPVT (maxWait);
3232+ moduleQueried.headingAccEst = false ; // Since we are about to give this to user, mark this data as stale
3233+ return (headingAccEst);
3234+ }
3235+
3236+ bool SFE_UBLOX_GPS::getInvalidLlh (uint16_t maxWait)
3237+ {
3238+ if (moduleQueried.invalidLlh == false )
3239+ getPVT (maxWait);
3240+ moduleQueried.invalidLlh = false ; // Since we are about to give this to user, mark this data as stale
3241+ return (invalidLlh);
3242+ }
3243+
3244+ int32_t SFE_UBLOX_GPS::getHeadVeh (uint16_t maxWait)
3245+ {
3246+ if (moduleQueried.headVeh == false )
3247+ getPVT (maxWait);
3248+ moduleQueried.headVeh = false ; // Since we are about to give this to user, mark this data as stale
3249+ return (headVeh);
3250+ }
3251+
3252+ int16_t SFE_UBLOX_GPS::getMagDec (uint16_t maxWait)
3253+ {
3254+ if (moduleQueried.magDec == false )
3255+ getPVT (maxWait);
3256+ moduleQueried.magDec = false ; // Since we are about to give this to user, mark this data as stale
3257+ return (magDec);
3258+ }
3259+
3260+ uint16_t SFE_UBLOX_GPS::getMagAcc (uint16_t maxWait)
3261+ {
3262+ if (moduleQueried.magAcc == false )
3263+ getPVT (maxWait);
3264+ moduleQueried.magAcc = false ; // Since we are about to give this to user, mark this data as stale
3265+ return (magAcc);
3266+ }
3267+
31983268// Get the current millisecond
31993269uint16_t SFE_UBLOX_GPS::getMillisecond (uint16_t maxWait)
32003270{
0 commit comments