This repository was archived by the owner on Jan 28, 2021. It is now read-only.
This repository was archived by the owner on Jan 28, 2021. It is now read-only.
how should getXXX handle stale/failed data? #46
Closed
Description
ignoring the template because this is philisophical, YOLO.
The m.o. of this library is to try to return fresh data using moduleQueried
. That's great, but it doesn't leave much room for failure. In other words, take getLatitude
:
//Get the current latitude in degrees
//Returns a long representing the number of degrees *10^-7
int32_t SFE_UBLOX_GPS::getLatitude(uint16_t maxWait)
{
if (moduleQueried.latitude == false)
getPVT();
moduleQueried.latitude = false; //Since we are about to give this to user, mark this data as stale
return (latitude);
}
Now, what if a call to getPVT fails? moduleQueried.latitude
will still be false, but we'll just steam right ahead and return.. something. It might be super-super-stale data or the init data, there's no way to know.
I'm using iTOW as a way to sniff "last updated time", but it's a bit of a hack.
Ideas:
haveValidData()
lastValidUpdateTime()
timeSinceLastSuccessfulUpdate()
Metadata
Metadata
Assignees
Labels
No labels