Skip to content

Commit fa50124

Browse files
authored
Merge pull request #119 from sparkfun/release_candidate
v2.2.2
2 parents 50b2dc7 + a2c595d commit fa50124

6 files changed

+52
-23
lines changed

Diff for: examples/ZED-F9P/Example3_StartRTCMBase/Example3_StartRTCMBase.ino

+3-2
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ void setup()
107107
//The ZED-F9P is slightly different than the NEO-M8P. See the Integration manual 3.5.8 for more info.
108108
//response = myGNSS.enableSurveyMode(300, 2.000); //Enable Survey in on NEO-M8P, 300 seconds, 2.0m
109109
response = myGNSS.enableSurveyMode(60, 5.000); //Enable Survey in, 60 seconds, 5.0m
110+
//response = myGNSS.enableSurveyModeFull(86400, 2.000); //Enable Survey in, 24 hours, 2.0m
110111
if (response == false)
111112
{
112113
Serial.println(F("Survey start failed. Freezing..."));
@@ -136,14 +137,14 @@ void setup()
136137
// From v2.0, the data from getSurveyStatus (UBX-NAV-SVIN) is returned in UBX_NAV_SVIN_t packetUBXNAVSVIN
137138
// Please see u-blox_structs.h for the full definition of UBX_NAV_SVIN_t
138139
// You can either read the data from packetUBXNAVSVIN directly
139-
// or can use the helper functions: getSurveyInActive; getSurveyInValid; getSurveyInObservationTime; and getSurveyInMeanAccuracy
140+
// or can use the helper functions: getSurveyInActive; getSurveyInValid; getSurveyInObservationTime; getSurveyInObservationTimeFull; and getSurveyInMeanAccuracy
140141
response = myGNSS.getSurveyStatus(2000); //Query module for SVIN status with 2000ms timeout (req can take a long time)
141142

142143
if (response == true) // Check if fresh data was received
143144
{
144145
Serial.print(F("Press x to end survey - "));
145146
Serial.print(F("Time elapsed: "));
146-
Serial.print((String)myGNSS.getSurveyInObservationTime()); // Call the helper function
147+
Serial.print((String)myGNSS.getSurveyInObservationTimeFull()); // Call the helper function
147148
Serial.print(F(" ("));
148149
Serial.print((String)myGNSS.packetUBXNAVSVIN->data.dur); // Read the survey-in duration directly from packetUBXNAVSVIN
149150

Diff for: keywords.txt

+3
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ disableRTCMmessage KEYWORD2
145145

146146
getSurveyMode KEYWORD2
147147
setSurveyMode KEYWORD2
148+
setSurveyModeFull KEYWORD2
148149
enableSurveyMode KEYWORD2
150+
enableSurveyModeFull KEYWORD2
149151
disableSurveyMode KEYWORD2
150152
setStaticPosition KEYWORD2
151153
setDGNSSConfiguration KEYWORD2
@@ -575,6 +577,7 @@ getMotionHeading KEYWORD2
575577
getSurveyInActive KEYWORD2
576578
getSurveyInValid KEYWORD2
577579
getSurveyInObservationTime KEYWORD2
580+
getSurveyInObservationTimeFull KEYWORD2
578581
getSurveyInMeanAccuracy KEYWORD2
579582

580583
getRelPosN KEYWORD2

Diff for: 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.1
2+
version=2.2.2
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/>

Diff for: src/SparkFun_u-blox_GNSS_Arduino_Library.cpp

+24-12
Original file line numberDiff line numberDiff line change
@@ -6661,6 +6661,10 @@ bool SFE_UBLOX_GNSS::getSurveyMode(uint16_t maxWait)
66616661

66626662
// Control Survey-In for NEO-M8P
66636663
bool SFE_UBLOX_GNSS::setSurveyMode(uint8_t mode, uint16_t observationTime, float requiredAccuracy, uint16_t maxWait)
6664+
{
6665+
return (setSurveyModeFull(mode, (uint32_t)observationTime, requiredAccuracy, maxWait));
6666+
}
6667+
bool SFE_UBLOX_GNSS::setSurveyModeFull(uint8_t mode, uint32_t observationTime, float requiredAccuracy, uint16_t maxWait)
66646668
{
66656669
if (getSurveyMode(maxWait) == false) // Ask module for the current TimeMode3 settings. Loads into payloadCfg.
66666670
return (false);
@@ -6673,26 +6677,30 @@ bool SFE_UBLOX_GNSS::setSurveyMode(uint8_t mode, uint16_t observationTime, float
66736677
// payloadCfg should be loaded with poll response. Now modify only the bits we care about
66746678
payloadCfg[2] = mode; // Set mode. Survey-In and Disabled are most common. Use ECEF (not LAT/LON/ALT).
66756679

6676-
// svinMinDur is U4 (uint32_t) but we'll only use a uint16_t (waiting more than 65535 seconds seems excessive!)
6680+
// svinMinDur is U4 (uint32_t) in seconds
66776681
payloadCfg[24] = observationTime & 0xFF; // svinMinDur in seconds
6678-
payloadCfg[25] = observationTime >> 8; // svinMinDur in seconds
6679-
payloadCfg[26] = 0; // Truncate to 16 bits
6680-
payloadCfg[27] = 0; // Truncate to 16 bits
6682+
payloadCfg[25] = (observationTime >> 8) & 0xFF;
6683+
payloadCfg[26] = (observationTime >> 16) & 0xFF;
6684+
payloadCfg[27] = (observationTime >> 24) & 0xFF;
66816685

66826686
// svinAccLimit is U4 (uint32_t) in 0.1mm.
66836687
uint32_t svinAccLimit = (uint32_t)(requiredAccuracy * 10000.0); // Convert m to 0.1mm
66846688
payloadCfg[28] = svinAccLimit & 0xFF; // svinAccLimit in 0.1mm increments
6685-
payloadCfg[29] = svinAccLimit >> 8;
6686-
payloadCfg[30] = svinAccLimit >> 16;
6687-
payloadCfg[31] = svinAccLimit >> 24;
6689+
payloadCfg[29] = (svinAccLimit >> 8) & 0xFF;
6690+
payloadCfg[30] = (svinAccLimit >> 16) & 0xFF;
6691+
payloadCfg[31] = (svinAccLimit >> 24) & 0xFF;
66886692

66896693
return ((sendCommand(&packetCfg, maxWait)) == SFE_UBLOX_STATUS_DATA_SENT); // We are only expecting an ACK
66906694
}
66916695

66926696
// Begin Survey-In for NEO-M8P
66936697
bool SFE_UBLOX_GNSS::enableSurveyMode(uint16_t observationTime, float requiredAccuracy, uint16_t maxWait)
66946698
{
6695-
return (setSurveyMode(SVIN_MODE_ENABLE, observationTime, requiredAccuracy, maxWait));
6699+
return (setSurveyModeFull(SVIN_MODE_ENABLE, (uint32_t)observationTime, requiredAccuracy, maxWait));
6700+
}
6701+
bool SFE_UBLOX_GNSS::enableSurveyModeFull(uint32_t observationTime, float requiredAccuracy, uint16_t maxWait)
6702+
{
6703+
return (setSurveyModeFull(SVIN_MODE_ENABLE, observationTime, requiredAccuracy, maxWait));
66966704
}
66976705

66986706
// Stop Survey-In for NEO-M8P
@@ -15554,7 +15562,7 @@ bool SFE_UBLOX_GNSS::getSurveyInValid(uint16_t maxWait)
1555415562
return ((bool)packetUBXNAVSVIN->data.valid);
1555515563
}
1555615564

15557-
uint16_t SFE_UBLOX_GNSS::getSurveyInObservationTime(uint16_t maxWait) // Truncated to 65535 seconds
15565+
uint32_t SFE_UBLOX_GNSS::getSurveyInObservationTimeFull(uint16_t maxWait) // Return the full uint32_t
1555815566
{
1555915567
if (packetUBXNAVSVIN == NULL)
1556015568
initPacketUBXNAVSVIN(); // Check that RAM has been allocated for the SVIN data
@@ -15566,9 +15574,13 @@ uint16_t SFE_UBLOX_GNSS::getSurveyInObservationTime(uint16_t maxWait) // Truncat
1556615574
packetUBXNAVSVIN->moduleQueried.moduleQueried.bits.dur = false; // Since we are about to give this to user, mark this data as stale
1556715575
packetUBXNAVSVIN->moduleQueried.moduleQueried.bits.all = false;
1556815576

15569-
// dur (Passed survey-in observation time) is U4 (uint32_t) seconds. We truncate to 16 bits
15570-
//(waiting more than 65535 seconds (18.2 hours) seems excessive!)
15571-
uint32_t tmpObsTime = packetUBXNAVSVIN->data.dur;
15577+
return (packetUBXNAVSVIN->data.dur);
15578+
}
15579+
15580+
uint16_t SFE_UBLOX_GNSS::getSurveyInObservationTime(uint16_t maxWait) // Truncated to 65535 seconds
15581+
{
15582+
// dur (Passed survey-in observation time) is U4 (uint32_t) seconds. Here we truncate to 16 bits
15583+
uint32_t tmpObsTime = getSurveyInObservationTimeFull(maxWait);
1557215584
if (tmpObsTime <= 0xFFFF)
1557315585
{
1557415586
return ((uint16_t)tmpObsTime);

Diff for: src/SparkFun_u-blox_GNSS_Arduino_Library.h

+19-6
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ const uint8_t UBX_CLASS_LOG = 0x21; // Logging Messages: Log creation, deletion
192192
const uint8_t UBX_CLASS_SEC = 0x27; // Security Feature Messages
193193
const uint8_t UBX_CLASS_HNR = 0x28; //(NEO-M8P ONLY!!!) High Rate Navigation Results Messages: High rate time, position speed, heading
194194
const uint8_t UBX_CLASS_NMEA = 0xF0; // NMEA Strings: standard NMEA strings
195+
const uint8_t UBX_CLASS_PUBX = 0xF1; // Proprietary NMEA-format messages defined by u-blox
195196

196197
// Class: CFG
197198
// The following are used for configuration. Descriptions are from the ZED-F9P Interface Description pg 33-34 and NEO-M9N Interface Description pg 47-48
@@ -265,6 +266,15 @@ const uint8_t UBX_NMEA_MAINTALKERID_GB = 0x05; // main talker ID is B
265266
const uint8_t UBX_NMEA_GSVTALKERID_GNSS = 0x00; // GNSS specific Talker ID (as defined by NMEA)
266267
const uint8_t UBX_NMEA_GSVTALKERID_MAIN = 0x01; // use the main Talker ID
267268

269+
// Class: PUBX
270+
// The following are used to enable PUBX messages with configureMessage
271+
// See the M8 receiver description & protocol specification for more details
272+
const uint8_t UBX_PUBX_CONFIG = 0x41; // Set protocols and baud rate
273+
const uint8_t UBX_PUBX_POSITION = 0x00; // Lat/Long position data
274+
const uint8_t UBX_PUBX_RATE = 0x40; // Set/get NMEA message output rate
275+
const uint8_t UBX_PUBX_SVSTATUS = 0x03; // Satellite status
276+
const uint8_t UBX_PUBX_TIME = 0x04; // Time of day and clock information
277+
268278
// Class: HNR
269279
// The following are used to configure the HNR message rates
270280
const uint8_t UBX_HNR_ATT = 0x01; // HNR Attitude
@@ -834,10 +844,12 @@ class SFE_UBLOX_GNSS
834844

835845
// Functions used for RTK and base station setup
836846
// It is probably safe to assume that users of the RTK will be using I2C / Qwiic. So let's leave maxWait set to 250ms.
837-
bool getSurveyMode(uint16_t maxWait = 250); // Get the current TimeMode3 settings
838-
bool setSurveyMode(uint8_t mode, uint16_t observationTime, float requiredAccuracy, uint16_t maxWait = 250); // Control survey in mode
839-
bool enableSurveyMode(uint16_t observationTime, float requiredAccuracy, uint16_t maxWait = 250); // Begin Survey-In for NEO-M8P
840-
bool disableSurveyMode(uint16_t maxWait = 250); // Stop Survey-In mode
847+
bool getSurveyMode(uint16_t maxWait = 250); // Get the current TimeMode3 settings
848+
bool setSurveyMode(uint8_t mode, uint16_t observationTime, float requiredAccuracy, uint16_t maxWait = 250); // Control survey in mode
849+
bool setSurveyModeFull(uint8_t mode, uint32_t observationTime, float requiredAccuracy, uint16_t maxWait = 250); // Control survey in mode
850+
bool enableSurveyMode(uint16_t observationTime, float requiredAccuracy, uint16_t maxWait = 250); // Begin Survey-In for NEO-M8P / ZED-F9x
851+
bool enableSurveyModeFull(uint32_t observationTime, float requiredAccuracy, uint16_t maxWait = 250); // Begin Survey-In for NEO-M8P / ZED-F9x
852+
bool disableSurveyMode(uint16_t maxWait = 250); // Stop Survey-In mode
841853
// Given coordinates, put receiver into static position. Set latlong to true to pass in lat/long values instead of ecef.
842854
// For ECEF the units are: cm, 0.1mm, cm, 0.1mm, cm, 0.1mm
843855
// For Lat/Lon/Alt the units are: degrees^-7, degrees^-9, degrees^-7, degrees^-9, cm, 0.1mm
@@ -1352,8 +1364,9 @@ class SFE_UBLOX_GNSS
13521364

13531365
bool getSurveyInActive(uint16_t maxWait = defaultMaxWait);
13541366
bool getSurveyInValid(uint16_t maxWait = defaultMaxWait);
1355-
uint16_t getSurveyInObservationTime(uint16_t maxWait = defaultMaxWait); // Truncated to 65535 seconds
1356-
float getSurveyInMeanAccuracy(uint16_t maxWait = defaultMaxWait); // Returned as m
1367+
uint16_t getSurveyInObservationTime(uint16_t maxWait = defaultMaxWait); // Truncated to 65535 seconds
1368+
uint32_t getSurveyInObservationTimeFull(uint16_t maxWait = defaultMaxWait); // Return the full uint32_t
1369+
float getSurveyInMeanAccuracy(uint16_t maxWait = defaultMaxWait); // Returned as m
13571370

13581371
// Helper functions for TIMELS
13591372

Diff for: src/u-blox_structs.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -2129,8 +2129,8 @@ typedef struct
21292129
uint8_t dbdEntryChecksumB;
21302130
} UBX_MGA_DBD_data_t;
21312131

2132-
#if defined(ARDUINO_ARCH_AVR)
2133-
#define UBX_MGA_DBD_RINGBUFFER_LEN 190 // Fix to let the code compile on AVR platforms - including the UNO.
2132+
#if defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_MEGAAVR)
2133+
#define UBX_MGA_DBD_RINGBUFFER_LEN 190 // Fix to let the code compile on AVR platforms - including the UNO and DxCore (DA/DB).
21342134
#else
21352135
#define UBX_MGA_DBD_RINGBUFFER_LEN 250 // Provide storage for MGA DBD packets. TO DO: confirm if 250 is large enough for all modules!
21362136
#endif

0 commit comments

Comments
 (0)