@@ -8197,6 +8197,50 @@ bool SFE_UBLOX_GNSS::setupPowerMode(sfe_ublox_rxm_mode_e mode, uint16_t maxWait)
81978197 return sendCommand(&packetCfg, maxWait);
81988198}
81998199
8200+
8201+ // Position Accuracy
8202+
8203+ // Change the Position Accuracy using UBX-CFG-NAV5
8204+ // Value provided in meters
8205+ bool SFE_UBLOX_GNSS::setNAV5PositionAccuracy(uint16_t meters, uint16_t maxWait)
8206+ {
8207+ packetCfg.cls = UBX_CLASS_CFG;
8208+ packetCfg.id = UBX_CFG_NAV5;
8209+ packetCfg.len = 0;
8210+ packetCfg.startingSpot = 0;
8211+
8212+ // Ask module for the current navigation model settings. Loads into payloadCfg.
8213+ if (sendCommand(&packetCfg, maxWait) != SFE_UBLOX_STATUS_DATA_RECEIVED) // We are expecting data and an ACK
8214+ return (false);
8215+
8216+ payloadCfg[0] = 0x10; // mask: set only the posMark
8217+ payloadCfg[1] = 0x00; // mask
8218+ payloadCfg[18] = meters;
8219+
8220+ packetCfg.len = 36;
8221+ packetCfg.startingSpot = 0;
8222+
8223+ return (sendCommand(&packetCfg, maxWait) == SFE_UBLOX_STATUS_DATA_SENT); // We are only expecting an ACK
8224+ }
8225+
8226+ // Get the position accuracy using UBX-CFG-NAV5
8227+ // Returns meters. 0 if the sendCommand fails
8228+ uint16_t SFE_UBLOX_GNSS::getNAV5PositionAccuracy(uint16_t maxWait)
8229+ {
8230+ packetCfg.cls = UBX_CLASS_CFG;
8231+ packetCfg.id = UBX_CFG_NAV5;
8232+ packetCfg.len = 0;
8233+ packetCfg.startingSpot = 0;
8234+
8235+ // Ask module for the current navigation model settings. Loads into payloadCfg.
8236+ if (sendCommand(&packetCfg, maxWait) != SFE_UBLOX_STATUS_DATA_RECEIVED) // We are expecting data and an ACK
8237+ return 0;
8238+
8239+ return (payloadCfg[18]);
8240+ }
8241+
8242+
8243+
82008244// Dynamic Platform Model
82018245
82028246// Change the dynamic platform model using UBX-CFG-NAV5
0 commit comments