Hi,
I am trying to set the static hold value through a message and add this capability to “setDynamicModel” function in SparkFun GNSS Library.
Here is the modified code. However, Once flashed, the changes do not go into effect.
Can anyone help what is wrong with this modification?
Thanks
‘’
bool SFE_UBLOX_GNSS::setDynamicModel(dynModel newDynamicModel, uint16_t maxWait, uint8_t staticHoldThresh, uint16_t staticHoldMaxDist)
{
packetCfg.cls = UBX_CLASS_CFG;
packetCfg.id = UBX_CFG_NAV5;
packetCfg.len = 0;
packetCfg.startingSpot = 0;
// Ask module for the current navigation model settings. Loads into payloadCfg.
if (sendCommand(&packetCfg, maxWait) != SFE_UBLOX_STATUS_DATA_RECEIVED) // We are expecting data and an ACK
return (false);
payloadCfg[0] = 0b01000001; // mask: set only the dyn bit (0)
payloadCfg[1] = 0b00000000; // mask
payloadCfg[2] = newDynamicModel; // dynModel
payloadCfg[22] = staticHoldThresh;
payloadCfg[28] = staticHoldMaxDist & 0xFF;
payloadCfg[29] = (staticHoldMaxDist >> 8) & 0xFF;
packetCfg.len = 36;
packetCfg.startingSpot = 0;
return (sendCommand(&packetCfg, maxWait) == SFE_UBLOX_STATUS_DATA_SENT); // We are only expecting an ACK
}