Skip to content

Commit ca3f6de

Browse files
authored
Merge pull request #111 from sparkfun/release_candidate
v2.2.1
2 parents 67cfa73 + daf3896 commit ca3f6de

File tree

32 files changed

+9211
-6120
lines changed

32 files changed

+9211
-6120
lines changed

Diff for: Adding_New_Messages.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -129,21 +129,23 @@ See [this commit](https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Libra
129129

130130
See [this commit](https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Library/commit/b746d8e2742961ede95e2d06d5db3a3a557e571d) for the changes.
131131

132-
#### Step 6.3: Update processUBXpacket()
132+
#### Step 6.3: Update getMaxPayloadSize()
133+
134+
#### Step 6.4: Update processUBXpacket()
133135

134136
Take time to double-check that you have used the correct data width, signed/unsigned and position for each field.
135137

136138
See [this commit](https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Library/commit/8eecdd5044f810b0e2b567150ff63a17c219fe8e) for the changes.
137139

138-
#### Step 6.4: Update checkCallbacks()
140+
#### Step 6.5: Update checkCallbacks()
139141

140142
See [this commit](https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Library/commit/b53bffaa3ae12482cfb268f23796963d0b8519c9) for the changes.
141143

142-
#### Step 6.5: Add the "auto" functions
144+
#### Step 6.6: Add the "auto" functions
143145

144146
See [this commit](https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Library/commit/e394ae003ad38117d150598774d0552059416473) for the changes.
145147

146-
#### Step 6.6: Add the helper functions (if any)
148+
#### Step 6.7: Add the helper functions (if any)
147149

148150
See [this commit](https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Library/commit/318e76383e96d6676bbb57294c25e665c0d4a31f) for the changes.
149151

Diff for: README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ u-blox makes some incredible GNSS receivers covering everything from low-cost, h
2121

2222
This library can be installed via the Arduino Library manager. Search for **SparkFun u-blox GNSS**.
2323

24-
## Automatic support for correction services like RTK2go, Emlid Caster and Skylark (Swift Navigation)
24+
## Automatic support for correction services like PointPerfect (u-blox), RTK2go, Emlid Caster and Skylark (Swift Navigation)
2525

26-
RTK NTRIP corrections services often require you to send them your location in NMEA GPGGA format. v2.2 of the library makes this easy by providing get functions and automatic callbacks
26+
u-blox's PointPerfect GNSS augmentation service uses the secure MQTT protocol to download SPARTN format correction data, providing "3-6 cm accuracy and convergence within seconds". Please see the new [PointPerfect Client example](https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Library/tree/main/examples/ZED-F9P/Example18_PointPerfectClient) for more details.
27+
28+
v2.3 also supports L-band correction services using the new u-blox NEO-D9S correction data receiver. Please see the new [L-band Corrections example](https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Library/tree/main/examples/ZED-F9P/Example19_LBand_Corrections_with_NEO-D9S) for more details.
29+
30+
Other RTK NTRIP corrections services often require you to send them your location in NMEA GPGGA format. v2.2 of the library makes this easy by providing get functions and automatic callbacks
2731
for both GPGGA and GNGGA messages. You can now instruct your module to output GPGGA (e.g.) every 10 seconds and then push it to the correction server directly from the callback. No more polling, no more parsing!
2832

2933
v2.2 also includes two new functions useful for correction services:

Diff for: examples/AssistNow/AssistNow_Autonomous/Example1_AssistNowAutonomous/Example1_AssistNowAutonomous.ino

+15-15
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,22 @@ SFE_UBLOX_GNSS myGNSS;
4242
// | / _____ You can use any name you like for the struct
4343
// | | /
4444
// | | |
45-
void printSATdata(UBX_NAV_SAT_data_t ubxDataStruct)
45+
void printSATdata(UBX_NAV_SAT_data_t *ubxDataStruct)
4646
{
4747
//Serial.println();
4848

4949
Serial.print(F("UBX-NAV-SAT contains data for "));
50-
Serial.print(ubxDataStruct.header.numSvs);
51-
if (ubxDataStruct.header.numSvs == 1)
50+
Serial.print(ubxDataStruct->header.numSvs);
51+
if (ubxDataStruct->header.numSvs == 1)
5252
Serial.println(F(" SV"));
5353
else
5454
Serial.println(F(" SVs"));
5555

5656
uint16_t numAopAvail = 0; // Count how many SVs have AssistNow Autonomous data available
5757

58-
for (uint16_t block = 0; block < ubxDataStruct.header.numSvs; block++) // For each SV
58+
for (uint16_t block = 0; block < ubxDataStruct->header.numSvs; block++) // For each SV
5959
{
60-
if (ubxDataStruct.blocks[block].flags.bits.aopAvail == 1) // If the aopAvail bit is set
60+
if (ubxDataStruct->blocks[block].flags.bits.aopAvail == 1) // If the aopAvail bit is set
6161
numAopAvail++; // Increment the number of SVs
6262
}
6363

@@ -78,12 +78,12 @@ void printSATdata(UBX_NAV_SAT_data_t ubxDataStruct)
7878
// | / _____ You can use any name you like for the struct
7979
// | | /
8080
// | | |
81-
void printAOPstatus(UBX_NAV_AOPSTATUS_data_t ubxDataStruct)
81+
void printAOPstatus(UBX_NAV_AOPSTATUS_data_t *ubxDataStruct)
8282
{
8383
//Serial.println();
8484

8585
Serial.print(F("AOPSTATUS status is "));
86-
Serial.println(ubxDataStruct.status);
86+
Serial.println(ubxDataStruct->status);
8787
}
8888

8989
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -95,27 +95,27 @@ void printAOPstatus(UBX_NAV_AOPSTATUS_data_t ubxDataStruct)
9595
// | / _____ You can use any name you like for the struct
9696
// | | /
9797
// | | |
98-
void printPVTdata(UBX_NAV_PVT_data_t ubxDataStruct)
98+
void printPVTdata(UBX_NAV_PVT_data_t *ubxDataStruct)
9999
{
100100
// Print the UBX-NAV-PVT data so we can see how quickly the fixType goes to 3D
101101

102102
Serial.println();
103103

104-
long latitude = ubxDataStruct.lat; // Print the latitude
104+
long latitude = ubxDataStruct->lat; // Print the latitude
105105
Serial.print(F("Lat: "));
106106
Serial.print(latitude);
107107

108-
long longitude = ubxDataStruct.lon; // Print the longitude
108+
long longitude = ubxDataStruct->lon; // Print the longitude
109109
Serial.print(F(" Long: "));
110110
Serial.print(longitude);
111111
Serial.print(F(" (degrees * 10^-7)"));
112112

113-
long altitude = ubxDataStruct.hMSL; // Print the height above mean sea level
113+
long altitude = ubxDataStruct->hMSL; // Print the height above mean sea level
114114
Serial.print(F(" Alt: "));
115115
Serial.print(altitude);
116116
Serial.print(F(" (mm)"));
117117

118-
byte fixType = ubxDataStruct.fixType; // Print the fix type
118+
byte fixType = ubxDataStruct->fixType; // Print the fix type
119119
Serial.print(F(" Fix: "));
120120
if(fixType == 0) Serial.print(F("No fix"));
121121
else if(fixType == 1) Serial.print(F("Dead reckoning"));
@@ -171,9 +171,9 @@ void setup()
171171

172172
myGNSS.setNavigationFrequency(1); //Produce one solution per second
173173

174-
myGNSS.setAutoNAVSATcallback(&printSATdata); // Enable automatic NAV SAT messages with callback to printSATdata
175-
myGNSS.setAutoAOPSTATUScallback(&printAOPstatus); // Enable automatic NAV AOPSTATUS messages with callback to printAOPstatus
176-
myGNSS.setAutoPVTcallback(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata
174+
myGNSS.setAutoNAVSATcallbackPtr(&printSATdata); // Enable automatic NAV SAT messages with callback to printSATdata
175+
myGNSS.setAutoAOPSTATUScallbackPtr(&printAOPstatus); // Enable automatic NAV AOPSTATUS messages with callback to printAOPstatus
176+
myGNSS.setAutoPVTcallbackPtr(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata
177177
}
178178

179179
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Diff for: examples/AssistNow/AssistNow_Autonomous/Example2_AssistNowAutonomous_DatabaseRead/Example2_AssistNowAutonomous_DatabaseRead.ino

+9-9
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,22 @@ SFE_UBLOX_GNSS myGNSS;
3535
// | / _____ You can use any name you like for the struct
3636
// | | /
3737
// | | |
38-
void printSATdata(UBX_NAV_SAT_data_t ubxDataStruct)
38+
void printSATdata(UBX_NAV_SAT_data_t *ubxDataStruct)
3939
{
4040
Serial.println();
4141

4242
Serial.print(F("UBX-NAV-SAT contains data for "));
43-
Serial.print(ubxDataStruct.header.numSvs);
44-
if (ubxDataStruct.header.numSvs == 1)
43+
Serial.print(ubxDataStruct->header.numSvs);
44+
if (ubxDataStruct->header.numSvs == 1)
4545
Serial.println(F(" SV"));
4646
else
4747
Serial.println(F(" SVs"));
4848

4949
uint16_t numAopAvail = 0; // Count how many SVs have AssistNow Autonomous data available
5050

51-
for (uint16_t block = 0; block < ubxDataStruct.header.numSvs; block++) // For each SV
51+
for (uint16_t block = 0; block < ubxDataStruct->header.numSvs; block++) // For each SV
5252
{
53-
if (ubxDataStruct.blocks[block].flags.bits.aopAvail == 1) // If the aopAvail bit is set
53+
if (ubxDataStruct->blocks[block].flags.bits.aopAvail == 1) // If the aopAvail bit is set
5454
numAopAvail++; // Increment the number of SVs
5555
}
5656

@@ -71,12 +71,12 @@ void printSATdata(UBX_NAV_SAT_data_t ubxDataStruct)
7171
// | / _____ You can use any name you like for the struct
7272
// | | /
7373
// | | |
74-
void printAOPstatus(UBX_NAV_AOPSTATUS_data_t ubxDataStruct)
74+
void printAOPstatus(UBX_NAV_AOPSTATUS_data_t *ubxDataStruct)
7575
{
7676
//Serial.println();
7777

7878
Serial.print(F("AOPSTATUS status is "));
79-
Serial.println(ubxDataStruct.status);
79+
Serial.println(ubxDataStruct->status);
8080
}
8181

8282
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -126,8 +126,8 @@ void setup()
126126

127127
myGNSS.setNavigationFrequency(1); //Produce one solution per second
128128

129-
myGNSS.setAutoNAVSATcallback(&printSATdata); // Enable automatic NAV SAT messages with callback to printSATdata
130-
myGNSS.setAutoAOPSTATUScallback(&printAOPstatus); // Enable automatic NAV AOPSTATUS messages with callback to printAOPstatus
129+
myGNSS.setAutoNAVSATcallbackPtr(&printSATdata); // Enable automatic NAV SAT messages with callback to printSATdata
130+
myGNSS.setAutoAOPSTATUScallbackPtr(&printAOPstatus); // Enable automatic NAV AOPSTATUS messages with callback to printAOPstatus
131131

132132
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
133133
// Keep displaying NAV SAT and AOPSTATUS until the user presses a key

Diff for: examples/Automatic_NMEA/Example2_NMEA_GGA_Callbacks/Example2_NMEA_GGA_Callbacks.ino

+8-8
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ SFE_UBLOX_GNSS myGNSS;
3939
// | / _____ You can use any name you like for the struct
4040
// | | /
4141
// | | |
42-
void printGPGGA(NMEA_GGA_data_t nmeaData)
42+
void printGPGGA(NMEA_GGA_data_t *nmeaData)
4343
{
4444
Serial.print(F("\r\nGPGGA: Length: "));
45-
Serial.print(nmeaData.length);
45+
Serial.print(nmeaData->length);
4646
Serial.print(F("\tData: "));
47-
Serial.print((const char *)nmeaData.nmea); // .nmea is printable (NULL-terminated) and already has \r\n on the end
47+
Serial.print((const char *)nmeaData->nmea); // .nmea is printable (NULL-terminated) and already has \r\n on the end
4848
}
4949

5050
// Callback: printGNGGA will be called if new GNGGA NMEA data arrives
@@ -54,12 +54,12 @@ void printGPGGA(NMEA_GGA_data_t nmeaData)
5454
// | / _____ You can use any name you like for the struct
5555
// | | /
5656
// | | |
57-
void printGNGGA(NMEA_GGA_data_t nmeaData)
57+
void printGNGGA(NMEA_GGA_data_t *nmeaData)
5858
{
5959
Serial.print(F("\r\nGNGGA: Length: "));
60-
Serial.print(nmeaData.length);
60+
Serial.print(nmeaData->length);
6161
Serial.print(F("\tData: "));
62-
Serial.print((const char *)nmeaData.nmea); // .nmea is printable (NULL-terminated) and already has \r\n on the end
62+
Serial.print((const char *)nmeaData->nmea); // .nmea is printable (NULL-terminated) and already has \r\n on the end
6363
}
6464

6565
void setup()
@@ -101,10 +101,10 @@ void setup()
101101
//myGNSS.setNMEAOutputPort(Serial); // Uncomment this line to echo all NMEA data to Serial for debugging
102102

103103
// Set up the callback for GPGGA
104-
myGNSS.setNMEAGPGGAcallback(&printGPGGA);
104+
myGNSS.setNMEAGPGGAcallbackPtr(&printGPGGA);
105105

106106
// Set up the callback for GNGGA
107-
myGNSS.setNMEAGNGGAcallback(&printGNGGA);
107+
myGNSS.setNMEAGNGGAcallbackPtr(&printGNGGA);
108108
}
109109

110110
void loop()

Diff for: examples/Callbacks/CallbackExample1_NAV_PVT/CallbackExample1_NAV_PVT.ino

+9-9
Original file line numberDiff line numberDiff line change
@@ -33,38 +33,38 @@ SFE_UBLOX_GNSS myGNSS;
3333
// | / _____ You can use any name you like for the struct
3434
// | | /
3535
// | | |
36-
void printPVTdata(UBX_NAV_PVT_data_t ubxDataStruct)
36+
void printPVTdata(UBX_NAV_PVT_data_t *ubxDataStruct)
3737
{
3838
Serial.println();
3939

4040
Serial.print(F("Time: ")); // Print the time
41-
uint8_t hms = ubxDataStruct.hour; // Print the hours
41+
uint8_t hms = ubxDataStruct->hour; // Print the hours
4242
if (hms < 10) Serial.print(F("0")); // Print a leading zero if required
4343
Serial.print(hms);
4444
Serial.print(F(":"));
45-
hms = ubxDataStruct.min; // Print the minutes
45+
hms = ubxDataStruct->min; // Print the minutes
4646
if (hms < 10) Serial.print(F("0")); // Print a leading zero if required
4747
Serial.print(hms);
4848
Serial.print(F(":"));
49-
hms = ubxDataStruct.sec; // Print the seconds
49+
hms = ubxDataStruct->sec; // Print the seconds
5050
if (hms < 10) Serial.print(F("0")); // Print a leading zero if required
5151
Serial.print(hms);
5252
Serial.print(F("."));
53-
unsigned long millisecs = ubxDataStruct.iTOW % 1000; // Print the milliseconds
53+
unsigned long millisecs = ubxDataStruct->iTOW % 1000; // Print the milliseconds
5454
if (millisecs < 100) Serial.print(F("0")); // Print the trailing zeros correctly
5555
if (millisecs < 10) Serial.print(F("0"));
5656
Serial.print(millisecs);
5757

58-
long latitude = ubxDataStruct.lat; // Print the latitude
58+
long latitude = ubxDataStruct->lat; // Print the latitude
5959
Serial.print(F(" Lat: "));
6060
Serial.print(latitude);
6161

62-
long longitude = ubxDataStruct.lon; // Print the longitude
62+
long longitude = ubxDataStruct->lon; // Print the longitude
6363
Serial.print(F(" Long: "));
6464
Serial.print(longitude);
6565
Serial.print(F(" (degrees * 10^-7)"));
6666

67-
long altitude = ubxDataStruct.hMSL; // Print the height above mean sea level
67+
long altitude = ubxDataStruct->hMSL; // Print the height above mean sea level
6868
Serial.print(F(" Height above MSL: "));
6969
Serial.print(altitude);
7070
Serial.println(F(" (mm)"));
@@ -91,7 +91,7 @@ void setup()
9191

9292
myGNSS.setNavigationFrequency(2); //Produce two solutions per second
9393

94-
myGNSS.setAutoPVTcallback(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata
94+
myGNSS.setAutoPVTcallbackPtr(&printPVTdata); // Enable automatic NAV PVT messages with callback to printPVTdata
9595
}
9696

9797
void loop()

Diff for: examples/Callbacks/CallbackExample2_NAV_ODO/CallbackExample2_NAV_ODO.ino

+5-5
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,22 @@ SFE_UBLOX_GNSS myGNSS;
3333
// | / _____ You can use any name you like for the struct
3434
// | | /
3535
// | | |
36-
void printODOdata(UBX_NAV_ODO_data_t ubxDataStruct)
36+
void printODOdata(UBX_NAV_ODO_data_t *ubxDataStruct)
3737
{
3838
Serial.println();
3939

4040
Serial.print(F("TOW: ")); // Print the Time Of Week
41-
unsigned long iTOW = ubxDataStruct.iTOW; // iTOW is in milliseconds
41+
unsigned long iTOW = ubxDataStruct->iTOW; // iTOW is in milliseconds
4242
Serial.print(iTOW);
4343
Serial.print(F(" (ms)"));
4444

4545
Serial.print(F(" Distance: "));
46-
unsigned long distance = ubxDataStruct.distance; // Print the distance
46+
unsigned long distance = ubxDataStruct->distance; // Print the distance
4747
Serial.print(distance);
4848
Serial.print(F(" (m)"));
4949

5050
Serial.print(F(" Total Distance: "));
51-
unsigned long totalDistance = ubxDataStruct.totalDistance; // Print the total distance
51+
unsigned long totalDistance = ubxDataStruct->totalDistance; // Print the total distance
5252
Serial.print(totalDistance);
5353
Serial.println(F(" (m)"));
5454
}
@@ -76,7 +76,7 @@ void setup()
7676

7777
//myGNSS.resetOdometer(); //Uncomment this line to reset the odometer
7878

79-
myGNSS.setAutoNAVODOcallback(&printODOdata); // Enable automatic NAV ODO messages with callback to printODOdata
79+
myGNSS.setAutoNAVODOcallbackPtr(&printODOdata); // Enable automatic NAV ODO messages with callback to printODOdata
8080
}
8181

8282
void loop()

Diff for: examples/Callbacks/CallbackExample3_TIM_TM2/CallbackExample3_TIM_TM2.ino

+9-9
Original file line numberDiff line numberDiff line change
@@ -48,30 +48,30 @@ int dotsPrinted = 0; // Print dots in rows of 50 while waiting for a TIM TM2 mes
4848
// | / _____ You can use any name you like for the struct
4949
// | | /
5050
// | | |
51-
void printTIMTM2data(UBX_TIM_TM2_data_t ubxDataStruct)
51+
void printTIMTM2data(UBX_TIM_TM2_data_t *ubxDataStruct)
5252
{
5353
Serial.println();
5454

5555
Serial.print(F("newFallingEdge: ")); // 1 if a new falling edge was detected
56-
Serial.print(ubxDataStruct.flags.bits.newFallingEdge);
56+
Serial.print(ubxDataStruct->flags.bits.newFallingEdge);
5757

5858
Serial.print(F(" newRisingEdge: ")); // 1 if a new rising edge was detected
59-
Serial.print(ubxDataStruct.flags.bits.newRisingEdge);
59+
Serial.print(ubxDataStruct->flags.bits.newRisingEdge);
6060

6161
Serial.print(F(" Rising Edge Counter: ")); // Rising edge counter
62-
Serial.print(ubxDataStruct.count);
62+
Serial.print(ubxDataStruct->count);
6363

6464
Serial.print(F(" towMsR: ")); // Time Of Week of rising edge (ms)
65-
Serial.print(ubxDataStruct.towMsR);
65+
Serial.print(ubxDataStruct->towMsR);
6666

6767
Serial.print(F(" towSubMsR: ")); // Millisecond fraction of Time Of Week of rising edge in nanoseconds
68-
Serial.print(ubxDataStruct.towSubMsR);
68+
Serial.print(ubxDataStruct->towSubMsR);
6969

7070
Serial.print(F(" towMsF: ")); // Time Of Week of falling edge (ms)
71-
Serial.print(ubxDataStruct.towMsF);
71+
Serial.print(ubxDataStruct->towMsF);
7272

7373
Serial.print(F(" towSubMsF: ")); // Millisecond fraction of Time Of Week of falling edge in nanoseconds
74-
Serial.println(ubxDataStruct.towSubMsF);
74+
Serial.println(ubxDataStruct->towSubMsF);
7575

7676
dotsPrinted = 0; // Reset dotsPrinted
7777
}
@@ -97,7 +97,7 @@ void setup()
9797

9898
myGNSS.setNavigationFrequency(1); //Produce one solution per second
9999

100-
myGNSS.setAutoTIMTM2callback(&printTIMTM2data); // Enable automatic TIM TM2 messages with callback to printTIMTM2data
100+
myGNSS.setAutoTIMTM2callbackPtr(&printTIMTM2data); // Enable automatic TIM TM2 messages with callback to printTIMTM2data
101101
}
102102

103103
void loop()

0 commit comments

Comments
 (0)