[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-dev] Minimum working example for libgps
From: |
Eric S. Raymond |
Subject: |
Re: [gpsd-dev] Minimum working example for libgps |
Date: |
Sat, 4 Nov 2017 10:27:27 -0400 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
David Huichen Dai <address@hidden>:
> Thanks for your reply. Why do you say that my sensor reports at 1-second
> interval?
Because that's what the hardware does, unless you have one of the rare and more
expensive devices with a shorter cycle.
>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?
Correct.
> 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?
That depends entirely on what other kinds of events your application waits on.
Some applications are best written as a simple blocking loop - especially
if they're simple noninteractive report generators. On the other hand, if
you ever wait on a keystroke, having a separate capture thread is probably
a good idea so that your socket buffer doesn't fill up and look to gpsd
like a dead device. It will drop the client connection when that happens.
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
My work is funded by the Internet Civil Engineering Institute: https://icei.org
Please visit their site and donate: the civilization you save might be your own.
- [gpsd-dev] Minimum working example for libgps, David Huichen Dai, 2017/11/03
- Re: [gpsd-dev] Minimum working example for libgps, Michael J. Tubby B.Sc. MIET, 2017/11/03
- Re: [gpsd-dev] Minimum working example for libgps, Eric S. Raymond, 2017/11/03
- Re: [gpsd-dev] Minimum working example for libgps, Hal Murray, 2017/11/03
- Re: [gpsd-dev] Minimum working example for libgps, David Huichen Dai, 2017/11/04
- Re: [gpsd-dev] Minimum working example for libgps,
Eric S. Raymond <=
- Re: [gpsd-dev] Minimum working example for libgps, Gary E. Miller, 2017/11/04
- Re: [gpsd-dev] Minimum working example for libgps, David Huichen Dai, 2017/11/05
- Re: [gpsd-dev] Minimum working example for libgps, Gary E. Miller, 2017/11/06
- Re: [gpsd-dev] Minimum working example for libgps, Hal Murray, 2017/11/07
- Re: [gpsd-dev] Minimum working example for libgps, Gary E. Miller, 2017/11/07
- Re: [gpsd-dev] Minimum working example for libgps, Hal Murray, 2017/11/07
- Re: [gpsd-dev] Minimum working example for libgps, Gary E. Miller, 2017/11/07
- Re: [gpsd-dev] Minimum working example for libgps, Hal Murray, 2017/11/08
- Re: [gpsd-dev] Minimum working example for libgps, Gary E. Miller, 2017/11/08
Re: [gpsd-dev] Minimum working example for libgps, Gary E. Miller, 2017/11/03