[LinuxPPS] LinuxPPS 5.0.0-rc1
Udo van den Heuvel
udovdh at xs4all.nl
Fri Aug 10 17:44:21 CEST 2007
Rodolfo Giometti wrote:
> On Fri, Aug 10, 2007 at 04:42:03PM +0200, Udo van den Heuvel wrote:
>> Please review and give feedback so we all can learn.
>>
>
>> --- refclock_nmea.c.origineel 2007-08-10 16:16:16.000000000 +0200
>> +++ refclock_nmea.c 2007-08-10 16:38:01.000000000 +0200
(...)
>> @@ -91,6 +93,7 @@
>> pps_params_t pps_params; /* pps parameters */
>> pps_info_t pps_info; /* last pps data */
>> pps_handle_t handle; /* pps handlebars */
>> + int handle_created; /* pps handle created flag */
>
> Now this is not needed anymore since pps_handle_t is becomed an "int"
> again... however this is not an error, but your patch may result
> smaller if you don't use it! :)
pps_handle_t is not in my patch, but I will change it to int.
>> /*
>> * Open serial port. Use CLK line discipline, if available.
>> */
>> - (void)sprintf(device, DEVICE, unit);
>> + (void)sprintf(gpsdevice, GPSDEVICE, unit);
>> + (void)sprintf(ppsdevice, PPSDEVICE, unit);
>>
>> - fd = refclock_open(device, SPEED232, LDISC_CLK);
>> - if (fd <= 0) {
>> + gps_fd = refclock_open(gpsdevice, SPEED232, LDISC_CLK);
>> + pps_fd = refclock_open(ppsdevice, SPEED232, LDISC_CLK);
>> + if (gps_fd <= 0) {
>
> Make attention here! Refclock should work in both ways:
>
> 1) the GPS source and PPS source are the same device, or
>
> 2) the GPS source and PPS source are __different__ devices.
>
> Your code assumes case 2 only. I suggest you in using bit 7 as PARSE
> refclock in order to know what to do (please see my preovious letter
> on this topic for a code example).
This is what puzzles me. As in the wiki you write:
(under Modifing a reference clock to work with LinuxPPS)
So your programs should check if the GPS data source (the serial port
for instance) is a PPS source too, otherwise they should provide the
possibility to open another device as PPS source.
So I just wait for the 4th octet of the fake IP that ntpd uses?
I browsed the parse reflock source and I found in ntp_request.h there is
some definition of the mode parameter, but how do I fill this struct?
The rest of the patch was OK?
More information about the LinuxPPS
mailing list