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

Commit 20490f1

Browse files
committed
Comment updates on Example21
1 parent 814da75 commit 20490f1

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

examples/Example21_ModuleInfo/Example21_ModuleInfo.ino

+12-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
using a custom command.
44
By: @mayopan
55
Date: May 9th, 2020
6+
67
Based on:
78
Send Custom Command
89
By: Paul Clark (PaulZC)
910
Date: April 20th, 2020
11+
1012
License: MIT. See license file for more information but you can
1113
basically do whatever you want with this code.
14+
1215
Previously it was possible to create and send a custom packet
1316
through the library but it would always appear to timeout as
1417
some of the internal functions referred to the internal private
@@ -19,11 +22,13 @@
1922
it had been called from within the library
2023
- the custom packet will be updated with data returned by the module
2124
(previously this was not possible from outside the library)
25+
2226
Feel like supporting open source hardware?
2327
Buy a board from SparkFun!
2428
ZED-F9P RTK2: https://www.sparkfun.com/products/15136
2529
NEO-M8P RTK: https://www.sparkfun.com/products/15005
2630
SAM-M8Q: https://www.sparkfun.com/products/15106
31+
2732
Hardware Connections:
2833
Plug a Qwiic cable into the GPS and a BlackBoard
2934
If you don't have a platform with a Qwiic connection use the SparkFun Qwiic Breadboard Jumper (https://www.sparkfun.com/products/14425)
@@ -42,7 +47,7 @@ class SFE_UBLOX_GPS_ADD : public SFE_UBLOX_GPS
4247
public:
4348
boolean getModuleInfo(uint16_t maxWait = 1100); //Queries module, texts
4449

45-
struct minfoStructure // Structure to hold the module info (uses 340 bytes of RAM)
50+
struct minfoStructure // Structure to hold the module info (uses 341 bytes of RAM)
4651
{
4752
char swVersion[30];
4853
char hwVersion[10];
@@ -134,20 +139,21 @@ boolean SFE_UBLOX_GPS_ADD::getModuleInfo(uint16_t maxWait)
134139
// Other values indicate errors. Please see the sfe_ublox_status_e enum for further details.
135140

136141
// Referring to the u-blox M8 Receiver Description and Protocol Specification we see that
137-
// the navigation rate is configured using the UBX-CFG-RATE message. So let's load our
138-
// custom packet with the correct information so we can read (poll / get) the current settings.
142+
// the module information can be read using the UBX-MON-VER message. So let's load our
143+
// custom packet with the correct information so we can read (poll / get) the module information.
139144

140145
customCfg.cls = UBX_CLASS_MON; // This is the message Class
141146
customCfg.id = UBX_MON_VER; // This is the message ID
142147
customCfg.len = 0; // Setting the len (length) to zero let's us poll the current settings
143148
customCfg.startingSpot = 0; // Always set the startingSpot to zero (unless you really know what you are doing)
144149

145-
// We also need to tell sendCommand how long it should wait for a reply
146-
// uint16_t maxWait = 250; // Wait for up to 250ms (Serial may need a lot longer e.g. 1100)
150+
// Now let's send the command. The module info is returned in customPayload
147151

148152
if (sendCommand(&customCfg, maxWait) != SFE_UBLOX_STATUS_DATA_RECEIVED)
149153
return (false); //If command send fails then bail
150154

155+
// Now let's extract the module info from customPayload
156+
151157
uint16_t position = 0;
152158
for (int i = 0; i < 30; i++)
153159
{
@@ -173,4 +179,4 @@ boolean SFE_UBLOX_GPS_ADD::getModuleInfo(uint16_t maxWait)
173179
}
174180

175181
return (true); //Success!
176-
}
182+
}

0 commit comments

Comments
 (0)