[LinuxPPS] another refclock_nmea patch ([Bug 610] Generic NMEA
GPS Receiver driver w/ PPS expects PPS after NMEA data)
Rodolfo Giometti
giometti at enneenne.com
Tue Nov 6 17:31:03 CET 2007
On Tue, Nov 06, 2007 at 05:15:28PM +0100, Udo van den Heuvel wrote:
>
> atom refclock code: (from atom_start)
>
> sprintf(device, DEVICE, unit);
> up->fddev = open(device, O_RDWR, 0777);
> if (up->fddev <= 0) {
> msyslog(LOG_ERR,
> "refclock_atom: %s: %m", device);
> return (0);
> }
>
> /*
> * Light off the PPSAPI interface.
> */
> if (time_pps_create(up->fddev, &up->handle) < 0) {
> msyslog(LOG_ERR,
> "refclock_atom: time_pps_create failed: %m");
> return (0);
> }
>
> /*
> * If the mode is nonzero, use that for the time_pps_setparams()
> * mode; otherwise, PPS_CAPTUREASSERT. Enable kernel PPS if
> * flag3 is lit.
> */
> mode = peer->ttl;
> if (mode == 0)
> mode = PPS_CAPTUREASSERT;
> return (atom_ppsapi(peer, mode));
>
> So a device IS opened?!
You open the PPS device which is not the serial port, right? You do an
open() on /dev/pps*, don't you?
> What would explain the different behaviour?
My it's just a proposal... however you should do somethig similar to
NMEA: open the main device and, if you discover that it's not a PPS
source also, try open an alternate device leaving the main device just
opened.
In this manner everything should continue to work properly. But
please, submit this proposal to the NTPD mail list.
Ciao,
Rodolfo
--
GNU/Linux Solutions e-mail: giometti at enneenne.com
Linux Device Driver giometti at gnudd.com
Embedded Systems giometti at linux.it
UNIX programming phone: +39 349 2432127
More information about the LinuxPPS
mailing list