This repository was archived by the owner on Jan 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 85
how should getXXX handle stale/failed data? #46
Comments
tedder
added a commit
to tedder/SparkFun_Ublox_Arduino_Library
that referenced
this issue
Nov 20, 2019
HPPOS isn't necessary to get the iTOW, which is a nice substitute for both a generic epoch and a 'time since last valid communication' from the library (because of sparkfun#40 and sparkfun#46).
An example of how this is problematic is when getPVT fails. Imagine calling getYear/getMonth/getDay/getHour etc with getPVT failing. Each one of those will try the call and wait to time out, so calling all those functions takes a huge amount of time. |
IMHO all the getXXX functions are optimistic and YMMV (designed to make a first encounter of the library easy). If you are concerned about failures why don't you call getPVT explicitly yourself, check the return value, and then proceed to call the appropriate getXXX functions only if the result is OK? |
Thanks tve. I can do that, for sure. I didn't know that was the m.o. If I get some time to focus on it I'll update docs and perhaps code to encourage that (like |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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, takegetLatitude
: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()
The text was updated successfully, but these errors were encountered: