gpsd-dev
[Top][All Lists]
Advanced

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

Re: [gpsd-dev] Port to QNX: PPS without SHM?


From: Eric
Subject: Re: [gpsd-dev] Port to QNX: PPS without SHM?
Date: Tue, 5 Jan 2016 03:12:06 -0500
User-agent: Mutt/1.5.23 (2014-03-12)

Norton Allen <address@hidden>:
> I am attempting to use ntpd and gpsd in order obtain accurate system time
> and position data from an NMEA GPS device with PPS output under QNX. If
> you're unfamiliar with QNX, it is very POSIX and a little more BSD than
> Linux.
> 
> In the initial build of both gpsd and ntpd, I determined that both were
> looking for SYSV IPC shared memory, and QNX only provides POSIX shared
> memory, so I figured I would try to use gpsd's JSON interface instead.
> 
> I have a driver that supports the PPS API, so I expect gpsd should be able
> to talk to it.
> 
> I configured a minimal build with:
> 
>    scons minimal=yes socket_export=yes nmea0183=yes pps=yes
> 
> The serial data is coming in on /dev/ser11, and I have a soft link /dev/gsp1
> -> /dev/ser11. The PPS signal is routed to DCD on /dev/ser1, and the pps
> driver monitors that and provide the PPS API on /dev/pps1. I am invoking
> gpsd as:
> 
>         gpsd /dev/gps1 /dev/pps1
> 
> That mostly worked: I was able to see the JSON data and watch the NMEA
> interface, but ntpd was unable to synch. I believe this is because gpsd
> never attempted to access the PPS device, so never had data of sufficient
> quality to pass on to ntpd.
> 
> Looking into the gpsd souce code, it appears that in order to get PPS
> monitoring going, pps_thread_activate() needs to be called, and the only
> place that is called is from ntpshm_link_activate() in timehint.c. Not
> surprisingly, that is all qualified by #ifdef NTPSHM_ENABLE.
> 
> Any thoughts on what would be necessary to get PPS_ENABLE to work without
> NTPSHM_ENABLE?

It shouldn't be very difficult if you have reasonable C chops.  I
didn't originally write the PPS thread handling (it's Gary Miller's
baby) but I was pretty careful about isolating it from the SHM stuff -
I had in mind that we might end up re-using it elsewhere, someday.

Take a look after "Entry points begin here." in ppsthread.c.  Study the way
those four functions are used elsewhere in the codebase.  Probably most of
what you need to do is arrange for pps_thread_activate() to be called
in gpsd::open_device() when PPS is enabled but NTPSHM_ENABLE is not.
-- 
                <a href="http://www.catb.org/~esr/";>Eric S. Raymond</a>



reply via email to

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