Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Commit e2c986e

Browse files
author
Nathan Seidle
committed
Changing dynamic model to typedef.
1 parent 1d1e748 commit e2c986e

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

src/SparkFun_Ublox_Arduino_Library.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ boolean SFE_UBLOX_GPS::setPortOutput(uint8_t portID, uint8_t outStreamSettings,
14551455
// Let's make sure we wait for the ACK too (sendCommand will have returned as soon as the module sent its response)
14561456
// This is only required because we are doing two sendCommands in quick succession using the same class and ID
14571457
waitForResponse(UBX_CLASS_CFG, UBX_CFG_PRT, 100); // But we'll only wait for 100msec max
1458-
1458+
14591459
//Yes, this is the depreciated way to do it but it's still supported on v27 so it
14601460
//covers both ZED-F9P (v27) and SAM-M8Q (v18)
14611461

@@ -1483,7 +1483,7 @@ boolean SFE_UBLOX_GPS::setPortInput(uint8_t portID, uint8_t inStreamSettings, ui
14831483
// Let's make sure we wait for the ACK too (sendCommand will have returned as soon as the module sent its response)
14841484
// This is only required because we are doing two sendCommands in quick succession using the same class and ID
14851485
waitForResponse(UBX_CLASS_CFG, UBX_CFG_PRT, 100); // But we'll only wait for 100msec max
1486-
1486+
14871487
packetCfg.cls = UBX_CLASS_CFG;
14881488
packetCfg.id = UBX_CFG_PRT;
14891489
packetCfg.len = 20;
@@ -1884,22 +1884,22 @@ boolean SFE_UBLOX_GPS::powerSaveMode(bool power_save, uint16_t maxWait)
18841884
//AIRBORNE1g,AIRBORNE2g,AIRBORNE4g,WRIST,BIKE
18851885
//WRIST is not supported in protocol versions less than 18
18861886
//BIKE is supported in protocol versions 19.2
1887-
boolean SFE_UBLOX_GPS::setDynamicModel(uint8_t newDynamicModel, uint16_t maxWait)
1887+
boolean SFE_UBLOX_GPS::setDynamicModel(dynModel newDynamicModel, uint16_t maxWait)
18881888
{
18891889
packetCfg.cls = UBX_CLASS_CFG;
18901890
packetCfg.id = UBX_CFG_NAV5;
18911891
packetCfg.len = 0;
18921892
packetCfg.startingSpot = 0;
18931893

18941894
if (sendCommand(packetCfg, maxWait) == false) //Ask module for the current navigation model settings. Loads into payloadCfg.
1895-
return (false);
1895+
return (false);
18961896

18971897
// Let's make sure we wait for the ACK too (sendCommand will have returned as soon as the module sent its response)
18981898
// This is only required because we are doing two sendCommands in quick succession using the same class and ID
18991899
waitForResponse(UBX_CLASS_CFG, UBX_CFG_NAV5, 100); // But we'll only wait for 100msec max
19001900

1901-
payloadCfg[0] = 0x01; // mask: set only the dyn bit (0)
1902-
payloadCfg[1] = 0x00; // mask
1901+
payloadCfg[0] = 0x01; // mask: set only the dyn bit (0)
1902+
payloadCfg[1] = 0x00; // mask
19031903
payloadCfg[2] = newDynamicModel; // dynModel
19041904

19051905
packetCfg.len = 36;

src/SparkFun_Ublox_Arduino_Library.h

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ const uint8_t UBX_CLASS_SEC = 0x27;
9696
const uint8_t UBX_CLASS_HNR = 0x28;
9797
const uint8_t UBX_CLASS_NMEA = 0xF0;
9898

99-
const uint8_t UBX_CFG_PRT = 0x00; //Used to configure port specifics
100-
const uint8_t UBX_CFG_RST = 0x04; //Used to reset device
101-
const uint8_t UBX_CFG_RATE = 0x08; //Used to set port baud rates
102-
const uint8_t UBX_CFG_CFG = 0x09; //Used to save current configuration
103-
const uint8_t UBX_CFG_RXM = 0x11; //Used to set receiver power management (power save mode)
99+
const uint8_t UBX_CFG_PRT = 0x00; //Used to configure port specifics
100+
const uint8_t UBX_CFG_RST = 0x04; //Used to reset device
101+
const uint8_t UBX_CFG_RATE = 0x08; //Used to set port baud rates
102+
const uint8_t UBX_CFG_CFG = 0x09; //Used to save current configuration
103+
const uint8_t UBX_CFG_RXM = 0x11; //Used to set receiver power management (power save mode)
104104
const uint8_t UBX_CFG_NAV5 = 0x24; //Used to configure the navigation engine including the dynamic model
105105

106106
const uint8_t UBX_CFG_VALSET = 0x8A; //Used for config of higher version Ublox modules (ie protocol v27 and above)
@@ -187,6 +187,21 @@ const uint8_t VAL_GROUP_I2C_SIZE = VAL_SIZE_8; //All fields in I2C group are cur
187187

188188
const uint8_t VAL_ID_I2C_ADDRESS = 0x01;
189189

190+
enum dynModel // Possible values for the dynamic platform model
191+
{
192+
DYN_MODEL_PORTABLE = 0,
193+
// 1 is not defined
194+
DYN_MODEL_STATIONARY = 2,
195+
DYN_MODEL_PEDESTRIAN,
196+
DYN_MODEL_AUTOMOTIVE,
197+
DYN_MODEL_SEA,
198+
DYN_MODEL_AIRBORNE1g,
199+
DYN_MODEL_AIRBORNE2g,
200+
DYN_MODEL_AIRBORNE4g,
201+
DYN_MODEL_WRIST, // Not supported in protocol versions less than 18
202+
DYN_MODEL_BIKE, // Supported in protocol versions 19.2
203+
};
204+
190205
#ifndef MAX_PAYLOAD_SIZE
191206

192207
#define MAX_PAYLOAD_SIZE 128
@@ -372,8 +387,8 @@ class SFE_UBLOX_GPS
372387

373388
boolean powerSaveMode(bool power_save = true, uint16_t maxWait = 2000);
374389

375-
//Change the dynamic platform model using UBX-CFG-NAV5
376-
boolean setDynamicModel(uint8_t newDynamicModel = PEDESTRIAN, uint16_t maxWait = 2000);
390+
//Change the dynamic platform model using UBX-CFG-NAV5
391+
boolean setDynamicModel(dynModel newDynamicModel = DYN_MODEL_PORTABLE, uint16_t maxWait = 2000);
377392

378393
//Survey-in specific controls
379394
struct svinStructure
@@ -448,21 +463,6 @@ class SFE_UBLOX_GPS
448463

449464
uint16_t rtcmFrameCounter = 0; //Tracks the type of incoming byte inside RTCM frame
450465

451-
enum dynModel // Possible values for the dynamic platform model
452-
{
453-
PORTABLE = 0,
454-
// 1 is not defined
455-
STATIONARY = 2,
456-
PEDESTRIAN,
457-
AUTOMOTIVE,
458-
SEA,
459-
AIRBORNE1g,
460-
AIRBORNE2g,
461-
AIRBORNE4g,
462-
WRIST, // Not supported in protocol versions less than 18
463-
BIKE // Supported in protocol versions 19.2
464-
};
465-
466466
private:
467467
//Depending on the sentence type the processor will load characters into different arrays
468468
enum SentenceTypes

0 commit comments

Comments
 (0)