SparkFun_u-blox_GNSS_Arduino_Library - help with UBX_NAV_PVT

Hello,

Can you help me get unconfused about the behaviour of the get* helper functions in the SparkFun_u-blox_GNSS_Arduino_Library?

What I’m trying to do is execute the UBX_NAV_PVT protocol query then extract the information from that single transaction. I’m using a UART at 38400.

After getting an update from the UBX NAV_PVT query to the module, the library examples typically show calls to the helper functions to get fix parameters longitude, latitude, etc. However, reading the source (yes, it’s lovely), it seems that each helper function call causes the UBX_NAV_PVT query to be resent for the next call.

// starting at line 17404 of SparkFun u-blox GNSS Arduino Library/src/SparkFun_u-blox_GNSS_Arduino_Library.cpp
// Get the number of satellites used in fix
uint8_t SFE_UBLOX_GNSS::getSIV(uint16_t maxWait)
{
  if (packetUBXNAVPVT == NULL)
    initPacketUBXNAVPVT();     // Check that RAM has been allocated for the PVT data
  if (packetUBXNAVPVT == NULL) // Bail if the RAM allocation failed
    return 0;

  if (packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.numSV == false)
    getPVT(maxWait);
  packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.numSV = false; // Since we are about to give this to user, mark this data as stale
  packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.all = false;
  return (packetUBXNAVPVT->data.numSV);
}

This example is from getSIV() satellites-in-view, but others do the same thing. The way I read it is that not only is it invalidating the single bit numSV as stale, but the next line marks all the bits in that union as stale. So the next call to any of the helper functions would apparently trigger a new query.

Did I read it right? My concern is that successive get* calls might get fields from two consecutive fix solutions if a new solution becomes available between calls.

To read the module once and extract the fields and bits directly, should I simply access the packetUBXNAVPVT struct directly, as done in the helper function? It feels risky to bypass the API.

Thanks in advance

P.S. That library is obviously the result of hard work, very complete. Much thanks.