You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 28, 2021. It is now read-only.
// uint16_t len : Length of the payload. Does not include cls, id, or checksum bytes
123
+
// uint16_t counter : Keeps track of number of overall bytes received. Some responses are larger than 255 bytes.
124
+
// uint16_t startingSpot : The counter value needed to go past before we begin recording into payload array
125
+
// uint8_t *payload : The payload
126
+
// uint8_t checksumA : Given to us by the module. Checked against the rolling calculated A/B checksums.
127
+
// uint8_t checksumB
128
+
// sfe_ublox_packet_validity_e valid : Goes from NOT_DEFINED to VALID or NOT_VALID when checksum is checked
129
+
// sfe_ublox_packet_validity_e classAndIDmatch : Goes from NOT_DEFINED to VALID or NOT_VALID when the Class and ID match the requestedClass and requestedID
130
+
131
+
// sendCommand will return:
132
+
// SFE_UBLOX_STATUS_DATA_RECEIVED if the data we requested was read / polled successfully
133
+
// SFE_UBLOX_STATUS_DATA_SENT if the data we sent was writted successfully (ACK'd)
134
+
// Other values indicate errors. Please see the sfe_ublox_status_e enum for further details.
135
+
136
+
// 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.
139
+
140
+
customCfg.cls = UBX_CLASS_MON; // This is the message Class
141
+
customCfg.id = UBX_MON_VER; // This is the message ID
142
+
customCfg.len = 0; // Setting the len (length) to zero let's us poll the current settings
143
+
customCfg.startingSpot = 0; // Always set the startingSpot to zero (unless you really know what you are doing)
144
+
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)
147
+
148
+
if (sendCommand(&customCfg, maxWait) != SFE_UBLOX_STATUS_DATA_RECEIVED)
0 commit comments