Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.1.5 - resolve issue #55 #56

Merged
merged 2 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading