@@ -5214,19 +5214,25 @@ uint8_t SFE_UBLOX_GNSS::sendCfgValset8(uint32_t key, uint8_t value, uint16_t max
5214
5214
return (sendCommand (&packetCfg, maxWait) == SFE_UBLOX_STATUS_DATA_SENT); // We are only expecting an ACK
5215
5215
}
5216
5216
5217
- // Read 18 sets of key values, for a total of 1088 keys
5217
+ // u-center reads 19 queries, 64 keys obtained in each query for 1216 keys
5218
5218
// Format the output to match the config files that u-center can understand
5219
5219
// Layer number can be 0 (RAM) or layer 7 (Default)
5220
5220
void SFE_UBLOX_GNSS::downloadDeviceConfig (Stream &downloadPort, uint8_t layerNumber, uint16_t maxWait)
5221
5221
{
5222
- for (int x = 0 ; x < 18 ; x++)
5222
+ const uint16_t keysToObtain = 1216 ;
5223
+ const uint16_t keysPerQuery = 64 ;
5224
+ const uint16_t loops = keysToObtain / keysPerQuery;
5225
+
5226
+ const uint32_t keyIDRequestAll = 0x0FFF0000 ; // KeyID of 0x0FFF0000 is request for all items known to the receiver in all groups.
5227
+
5228
+ for (uint16_t x = 0 ; x < loops; x++)
5223
5229
{
5224
- // KeyID of 0x0FFF0000 is magic config read key. Found using u-center and downloading Receiver Configuration from Tools menu.
5225
- // Advance by 64 keys each time
5226
- if (getVal (0x0FFF0000 , layerNumber, x * 64 , maxWait) != SFE_UBLOX_STATUS_SUCCESS )
5230
+
5231
+ // Advance by keysPerQuery keys each time
5232
+ if (getVal (keyIDRequestAll , layerNumber, x * keysPerQuery , maxWait) != SFE_UBLOX_STATUS_DATA_RECEIVED )
5227
5233
{
5228
5234
// Try again
5229
- if (getVal (0x0FFF0000 , layerNumber, x * 64 , maxWait) != SFE_UBLOX_STATUS_SUCCESS )
5235
+ if (getVal (keyIDRequestAll , layerNumber, x * keysPerQuery , maxWait) != SFE_UBLOX_STATUS_DATA_RECEIVED )
5230
5236
{
5231
5237
if (_printDebug == true )
5232
5238
{
@@ -5249,7 +5255,7 @@ void SFE_UBLOX_GNSS::downloadDeviceConfig(Stream &downloadPort, uint8_t layerNum
5249
5255
downloadPort.print (responseLength >> 8 , HEX);
5250
5256
5251
5257
// Pretty print the payload
5252
- for (int x = 0 ; x < 32 ; x++)
5258
+ for (int x = 0 ; x < packetCfg. len ; x++)
5253
5259
{
5254
5260
downloadPort.print (F (" " ));
5255
5261
if (payloadCfg[x] < 0x10 )
0 commit comments