Skip to content

Commit ce4629b

Browse files
authored
Merge pull request #225 from sparkfun/release_candidate
v2.2.27
2 parents f8047a5 + 7f43755 commit ce4629b

4 files changed

+56
-3
lines changed

keywords.txt

+3
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ powerOffWithInterrupt KEYWORD2
195195
setDynamicModel KEYWORD2
196196
getDynamicModel KEYWORD2
197197

198+
setNAV5PositionAccuracy KEYWORD2
199+
getNAV5PositionAccuracy KEYWORD2
200+
198201
resetOdometer KEYWORD2
199202
enableOdometer KEYWORD2
200203
getOdometerConfig KEYWORD2

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SparkFun u-blox GNSS Arduino Library
2-
version=2.2.26
2+
version=2.2.27
33
author=SparkFun Electronics <[email protected]>
44
maintainer=SparkFun Electronics <sparkfun.com>
55
sentence=Library for I2C, Serial and SPI Communication with u-blox GNSS modules<br/><br/>

src/SparkFun_u-blox_GNSS_Arduino_Library.cpp

+48-2
Original file line numberDiff line numberDiff line change
@@ -8197,6 +8197,53 @@ 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 metres, 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 the posMask, leave other bits unchanged
8217+
payloadCfg[18] = metres & 0xFF;
8218+
payloadCfg[19] = metres >> 8;
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+
8240+
uint16_t pAcc = ((uint16_t)payloadCfg[19]) << 8;
8241+
pAcc |= payloadCfg[18];
8242+
return (pAcc);
8243+
}
8244+
8245+
8246+
82008247
// Dynamic Platform Model
82018248

82028249
// Change the dynamic platform model using UBX-CFG-NAV5
@@ -8216,8 +8263,7 @@ bool SFE_UBLOX_GNSS::setDynamicModel(dynModel newDynamicModel, uint16_t maxWait)
82168263
if (sendCommand(&packetCfg, maxWait) != SFE_UBLOX_STATUS_DATA_RECEIVED) // We are expecting data and an ACK
82178264
return (false);
82188265

8219-
payloadCfg[0] = 0x01; // mask: set only the dyn bit (0)
8220-
payloadCfg[1] = 0x00; // mask
8266+
payloadCfg[0] |= 0x01; // mask: set only the dyn bit (0)
82218267
payloadCfg[2] = newDynamicModel; // dynModel
82228268

82238269
packetCfg.len = 36;

src/SparkFun_u-blox_GNSS_Arduino_Library.h

+4
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,10 @@ class SFE_UBLOX_GNSS
950950
bool setDynamicModel(dynModel newDynamicModel = DYN_MODEL_PORTABLE, uint16_t maxWait = defaultMaxWait);
951951
uint8_t getDynamicModel(uint16_t maxWait = defaultMaxWait); // Get the dynamic model - returns 255 if the sendCommand fails
952952

953+
// Change the position accuracy using UBX-CFG-NAV5
954+
bool setNAV5PositionAccuracy(uint16_t metres, uint16_t maxWait = defaultMaxWait);
955+
uint16_t getNAV5PositionAccuracy(uint16_t maxWait = defaultMaxWait); // Get the position accuracy - returns 0 if the sendCommand fails
956+
953957
// Reset / enable / configure the odometer
954958
bool resetOdometer(uint16_t maxWait = defaultMaxWait); // Reset the odometer
955959
bool enableOdometer(bool enable = true, uint16_t maxWait = defaultMaxWait); // Enable / disable the odometer

0 commit comments

Comments
 (0)