[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-users] Getting fixes without polling
From: |
Gary E. Miller |
Subject: |
Re: [gpsd-users] Getting fixes without polling |
Date: |
Wed, 1 Feb 2017 10:23:17 -0800 |
Yo Lisandro!
On Wed, 01 Feb 2017 10:57:31 -0300
Lisandro Damián Nicanor Pérez Meyer <address@hidden> wrote:
> On martes, 31 de enero de 2017 11:00:38 ART Gary E. Miller wrote:
> > Yo Lisandro!
> >
> > On Tue, 31 Jan 2017 12:23:37 -0300
> >
> > Lisandro Damián Nicanor Pérez Meyer <address@hidden> wrote:
> > > Is there any way to get fixes without the need to poll? I guess
> > > dbus might help here, but...
> >
> > Open the gpsd port, 2947, and tell it to stream JSON at you.
>
> I think that's what I'm doing:
>
> result = gps_open("localhost", 37455, &mGPSData);
> [check result...]
> result = gps_stream(&mGPSData,WATCH_ENABLE|WATCH_JSON, NULL);
> [check result...]
No, you are using libgps, a big layer of complexity. I'm saying just
use fopen() and then wait on a select().
> But then I need a timer to poll using gps_read(). Is there a way to
> have a callback in order to avoid the timer?
Have you looked at gps_waiting() or gps_stream(). Have you read the example
on the libgps man page?
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
pgp0L6kWqAofF.pgp
Description: OpenPGP digital signature