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.
//Poll for the current settings for a given message
2236
2237
packetCfg.cls = UBX_CLASS_CFG;
2237
2238
packetCfg.id = UBX_CFG_MSG;
2238
-
packetCfg.len = 8;
2239
+
packetCfg.len = 2;
2239
2240
packetCfg.startingSpot = 0;
2240
2241
2241
-
//Clear packet payload
2242
-
for (uint8_t x = 0; x < packetCfg.len; x++)
2243
-
packetCfg.payload[x] = 0;
2242
+
payloadCfg[0] = msgClass;
2243
+
payloadCfg[1] = msgID;
2244
2244
2245
-
packetCfg.payload[0] = msgClass;
2246
-
packetCfg.payload[1] = msgID;
2247
-
packetCfg.payload[2 + portID] = sendRate; //Send rate is relative to the event a message is registered on. For example, if the rate of a navigation message is set to 2, the message is sent every 2nd navigation solution.
2245
+
//This will load the payloadCfg array with current settings of the given register
2246
+
if (sendCommand(&packetCfg, maxWait) != SFE_UBLOX_STATUS_DATA_RECEIVED) // We are expecting data and an ACK
2247
+
return (false); //If command send fails then bail
2248
+
2249
+
//Now send it back with new mods
2250
+
packetCfg.len = 8;
2251
+
2252
+
//payloadCfg is now loaded with current bytes. Change only the ones we need to
2253
+
payloadCfg[2 + portID] = sendRate; //Send rate is relative to the event a message is registered on. For example, if the rate of a navigation message is set to 2, the message is sent every 2nd navigation solution.
2248
2254
2249
2255
return ((sendCommand(&packetCfg, maxWait)) == SFE_UBLOX_STATUS_DATA_SENT); // We are only expecting an ACK
0 commit comments