[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] Minimum working example for libgps

From: Gary E. Miller
Subject: Re: [gpsd-dev] Minimum working example for libgps
Date: Mon, 6 Nov 2017 20:19:32 -0800

Yo David!

On Sun, 5 Nov 2017 13:38:39 +0800
David Huichen Dai <address@hidden> wrote:

> So how do I get the coordinate once a second? Put a sleep(1) in the
> loop?

No, you don't wait, you just poll the gpsd socket.

> And for the problem that gpsd starts automatically, I think I will
> kill the gpsd process, and restart it with the -n option. Is this OK?

Prolly not good to fight what your Distro is trying to do.  Fix it
right.  Either fix your distro's startup script, or write your own.

> > Nah, the OS buffers the socket for you.  Just poll the gpsd
> > interface in you main loop.
> >  
> Here is the question, I dont have a main loop in my code, and I dont
> need to have it.

I see no way around a main loop.  You need to keep polling gpsd.

> Again, some example code from a real project is very much appreciated.

Look at the gpsd code.  Look at cgps, xgps, etc.

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

Attachment: pgpKQoTFQxTWz.pgp
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]