Skip to content

Commit

Permalink
Merge pull request #56 from sparkfun/release_candidate
Browse files Browse the repository at this point in the history
v3.1.5 - resolve issue #55
  • Loading branch information
PaulZC authored Apr 18, 2024
2 parents 7b2e036 + 4011956 commit 4ac1a71
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SparkFun u-blox GNSS v3
version=3.1.4
version=3.1.5
author=SparkFun Electronics <[email protected]>
maintainer=SparkFun Electronics <sparkfun.com>
sentence=Library for I2C, Serial and SPI Communication with u-blox GNSS modules<br/><br/>
Expand Down
16 changes: 13 additions & 3 deletions src/u-blox_GNSS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8205,7 +8205,8 @@ 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)
{
ptr += strlen("FWVER="); // Point to the firmware type (HPG etc.)
Expand All @@ -8227,7 +8228,8 @@ 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)
ptr = strstr((const char *)&payloadCfg[(30 * extensionNumber)], "PROTVER=");
if (ptr != nullptr)
{
ptr += strlen("PROTVER="); // Point to the protocol version
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 4ac1a71

Please sign in to comment.