Skip to content

Commit

Permalink
It looks like UBLOX ROM version 2.01 omits the = sign from PROTVER (i…
Browse files Browse the repository at this point in the history
…NavFlight#9132)

* It looks like ROM version 2.01 ommits the = sign from PROTVER

* can't have strcmp in there

* s/gpsParceUBLOX/gpsParseUBLOX/g
  • Loading branch information
mmosca authored and rmaia3d committed Jul 20, 2023
1 parent 2feb439 commit cfc9264
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/io/gps_ublox.c
Expand Up @@ -483,7 +483,7 @@ static void configureSBAS(void)

static void gpsDecodeProtocolVersion(const char *proto, size_t bufferLength)
{
if (bufferLength > 13 && !strncmp(proto, "PROTVER=", 8)) {
if (bufferLength > 13 && (!strncmp(proto, "PROTVER=", 8) || !strncmp(proto, "PROTVER ", 8))) {
proto+=8;

float ver = atof(proto);
Expand Down Expand Up @@ -528,7 +528,7 @@ static uint32_t gpsDecodeHardwareVersion(const char * szBuf, unsigned nBufSize)
return UBX_HW_VERSION_UNKNOWN;
}

static bool gpsParceFrameUBLOX(void)
static bool gpsParseFrameUBLOX(void)
{
switch (_msg_id) {
case MSG_POSLLH:
Expand Down Expand Up @@ -644,7 +644,7 @@ static bool gpsParceFrameUBLOX(void)
}
}
for (int j = 40; j < _payload_length; j += 30) {
if (strnstr((const char *)(_buffer.bytes + j), "PROTVER=", 30)) {
if (strnstr((const char *)(_buffer.bytes + j), "PROTVER", 30)) {
gpsDecodeProtocolVersion((const char *)(_buffer.bytes + j), 30);
break;
}
Expand Down Expand Up @@ -769,7 +769,7 @@ static bool gpsNewFrameUBLOX(uint8_t data)
break;
}

if (gpsParceFrameUBLOX()) {
if (gpsParseFrameUBLOX()) {
parsed = true;
}
}
Expand Down

0 comments on commit cfc9264

Please sign in to comment.