Ciao Gary,
thank you for your help.
in some example I see this:
if (newdata->set & ONLINE_SET)
(void)fprintf(stdout, "ONLINE: %lf\n", newdata->online);
if (newdata->set & MODE_SET)
(void)fprintf(stdout, "MODE: mode: %d\n", newdata->fix.mode);
if (newdata->set & DOP_SET)
(void)fprintf(stdout,
"DOP: satellites %d, pdop=%lf, hdop=%lf, vdop=%lf\n",
newdata->satellites_used, newdata->dop.pdop,
newdata->dop.hdop, newdata->dop.vdop);
it is correct to check "newdata->set & DOP_SET" before use the data?
For example if my gps is not receving data, how I can know if pps subtracted themselves is valid?
The data is set to nan?
Thanks,
Massimiliano
Il giorno sab 25 mag 2019 alle ore 21:15 Gary E. Miller <
address@hidden> ha scritto:
Yo Massimiliano!
On Sat, 25 May 2019 19:46:13 +0200
Massimiliano Fago <address@hidden> wrote:
> how I can know if pps.clock, dop.vdop, pps.real data in my gps_data_t
> struct are valid?
Depends on your definition of 'valid'.
All the DOPs are set to NAN if they are unknown.
struct pps is a timedelta_t, so valid if the two times being subtracted
are themselves valid. Also, struct pps is in a union, so only use it
directly after computing it.
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
address@hidden Tel:+1 541 382 8588
Veritas liberabit vos. -- Quid est veritas?
"If you can’t measure it, you can’t improve it." - Lord Kelvin
--
Massimiliano Fago
Senior Software Engineer
skype: massimomfa