GNSS Library problem with myGNSS.getVal8

I’m using the getVal8 library function to see whether the ZED-F9R is responding properly to my commands to turn on and off the sensor fusion. I’m getting variable results —sometimes 0 and sometimes 1 for the RAM enable flag.

I think part of the problem may be that the function can return a zero value for two different issues:

1: It returns 0 when the flag is zero. That’s the desired result.

2: It returns 0 when there is a communications error.

Here’s the source code:

// Given a key, return its value
// This function takes a full 32-bit key
// Default layer is RAM
// Configuration of modern u-blox modules is now done via getVal/setVal/delVal, ie protocol v27 and above found on ZED-F9P
uint8_t SFE_UBLOX_GNSS::getVal8(uint32_t key, uint8_t layer, uint16_t maxWait)
{
  if (getVal(key, layer, maxWait) != SFE_UBLOX_STATUS_DATA_RECEIVED)
    return (0);

  return (extractByte(&packetCfg, 8));
}

I think there should be an error code returned that is not one-half the valid responses for the function return in cases where you are asking for the status of a logical flag that returns either 0 or 1.

Hello @mborgerson,

Thank you for raising this issue. I’m moving it over to the Arduino Library GitHub repository. Please join the discussion here:

https://github.com/sparkfun/SparkFun_u- … issues/172

Best wishes,

Paul

Hello @mborgerson,

This is resolved in v3 of the library:

https://github.com/sparkfun/SparkFun_u- … issues/172

https://github.com/sparkfun/SparkFun_u- … #L427-L434

Best wishes,

Paul