From 34880fc19bb9492c51003c2d82d5aecd67515e06 Mon Sep 17 00:00:00 2001 From: PaulZC Date: Thu, 18 Apr 2024 08:09:44 -0600 Subject: [PATCH 1/2] v3.1.5 - correct #55 --- library.properties | 2 +- src/u-blox_GNSS.cpp | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/library.properties b/library.properties index 6870287..f60bfa7 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SparkFun u-blox GNSS v3 -version=3.1.4 +version=3.1.5 author=SparkFun Electronics maintainer=SparkFun Electronics sentence=Library for I2C, Serial and SPI Communication with u-blox GNSS modules

diff --git a/src/u-blox_GNSS.cpp b/src/u-blox_GNSS.cpp index cbd21c6..9d962e7 100644 --- a/src/u-blox_GNSS.cpp +++ b/src/u-blox_GNSS.cpp @@ -8208,7 +8208,8 @@ bool DevUBLOXGNSS::getModuleInfo(uint16_t maxWait) ptr = strstr((const char *)&payloadCfg[(30 * extensionNumber)], "FWVER="); // Check for FWVER (should be in extension 1) if (ptr != nullptr) { - ptr += strlen("FWVER="); // Point to the firmware type (HPG etc.) + // Point to the firmware type (HPG etc.) + ptr += strlen("FWVER="); int i = 0; while ((i < firmwareTypeLen) && (*ptr != '\0') && (*ptr != ' ')) // Extract the firmware type (3-7 chars) moduleSWVersion->firmwareType[i++] = *ptr++; @@ -8227,8 +8228,9 @@ bool DevUBLOXGNSS::getModuleInfo(uint16_t maxWait) fwProtMod |= 0x01; // Record that we got the FWVER } } - ptr = strstr((const char *)&payloadCfg[(30 * extensionNumber)], "PROTVER="); // Check for PROTVER (should be in extension 2) + // Check for PROTVER (should be in extension 2) if (ptr != nullptr) + ptr = strstr((const char *)&payloadCfg[(30 * extensionNumber)], "PROTVER="); { ptr += strlen("PROTVER="); // Point to the protocol version int protHi = 0; @@ -8241,7 +8243,9 @@ bool DevUBLOXGNSS::getModuleInfo(uint16_t maxWait) fwProtMod |= 0x02; // Record that we got the PROTVER } } - ptr = strstr((const char *)&payloadCfg[(30 * extensionNumber)], "MOD="); // Check for MOD (should be in extension 3) + // Check for MOD (should be in extension 3) + // Note: see issue #55. It appears that the UBX-M10050-KB chip does not report MOD + ptr = strstr((const char *)&payloadCfg[(30 * extensionNumber)], "MOD="); if (ptr != nullptr) { ptr += strlen("MOD="); // Point to the module name @@ -8253,6 +8257,12 @@ bool DevUBLOXGNSS::getModuleInfo(uint16_t maxWait) } } + if ((fwProtMod & 0x04) == 0) // Is MOD missing? + { + strncpy(moduleSWVersion->moduleName, "NONE", moduleNameMaxLen); + fwProtMod |= 0x04; // Record that we updated the MOD + } + if (fwProtMod == 0x07) // Did we extract all three? { #ifndef SFE_UBLOX_REDUCED_PROG_MEM From 4011956f590a065c3e317c9200a658554cd2dd06 Mon Sep 17 00:00:00 2001 From: PaulZC Date: Thu, 18 Apr 2024 08:16:11 -0600 Subject: [PATCH 2/2] More coffee required... --- src/u-blox_GNSS.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/u-blox_GNSS.cpp b/src/u-blox_GNSS.cpp index 9d962e7..a5a1059 100644 --- a/src/u-blox_GNSS.cpp +++ b/src/u-blox_GNSS.cpp @@ -8205,11 +8205,11 @@ bool DevUBLOXGNSS::getModuleInfo(uint16_t maxWait) uint8_t fwProtMod = 0; // Flags to show if we extracted the FWVER, PROTVER and MOD data for (uint8_t extensionNumber = 0; extensionNumber < ((packetCfg.len - 40) / 30); extensionNumber++) { - ptr = strstr((const char *)&payloadCfg[(30 * extensionNumber)], "FWVER="); // Check for FWVER (should be in extension 1) + // Check for FWVER (should be in extension 1) + ptr = strstr((const char *)&payloadCfg[(30 * extensionNumber)], "FWVER="); if (ptr != nullptr) { - // Point to the firmware type (HPG etc.) - ptr += strlen("FWVER="); + ptr += strlen("FWVER="); // Point to the firmware type (HPG etc.) int i = 0; while ((i < firmwareTypeLen) && (*ptr != '\0') && (*ptr != ' ')) // Extract the firmware type (3-7 chars) moduleSWVersion->firmwareType[i++] = *ptr++; @@ -8229,8 +8229,8 @@ bool DevUBLOXGNSS::getModuleInfo(uint16_t maxWait) } } // Check for PROTVER (should be in extension 2) - if (ptr != nullptr) ptr = strstr((const char *)&payloadCfg[(30 * extensionNumber)], "PROTVER="); + if (ptr != nullptr) { ptr += strlen("PROTVER="); // Point to the protocol version int protHi = 0;