|
From: | David Huichen Dai |
Subject: | Re: [gpsd-dev] Minimum working example for libgps |
Date: | Sun, 5 Nov 2017 13:38:39 +0800 |
Yo David!
On Sat, 4 Nov 2017 15:13:31 +0800
David Huichen Dai <address@hidden> wrote:
> Thanks for your reply. Why do you say that my sensor reports at
> 1-second interval? I set the gps_waiting time to 2 seconds, which
> means I wait for up to 2 seconds to get the coordinates, not sampling
> every 2 seconds, right?
gps_waiting is client side. But your GPS just sends data when it wants to,
usualy PVT once a second, and gpsd passes it on when it sees it. Thus you
should get PVT once a second.
> Do I need a separate thread to sample the coordinates, store them in a
> variable, and access it from other thread when I need the
> coordinates? Is this the common way to use the libgps?
Nah, the OS buffers the socket for you. Just poll the gpsd interface in
you main loop.
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
[Prev in Thread] | Current Thread | [Next in Thread] |