[ntp:questions] Re: Please demistify the SHM driver

Jonathan Buzzard jonathan at buzzard.org.uk
Mon Sep 15 22:34:58 UTC 2003


In article <bk5cj3$1h5$1 at news.univ-mrs.fr>,
	Jerome Oufella <oufella at SPAMBLOCKchez.com> writes:
> Hi everyone,
> 	I'm writing an handler for a proprietary kind of GPS clock, using RS232 
> signals and the SHM driver.
> The NTP documentation describes the structure of the memory segment, and 
> says that :
> 
> "[...] (clockTimeStampSec, clockTimeStampUSec,
>          receiveTimeStampSec,  receiveTimeStampUSec,
>          leap, precision) are passed to ntp
> [...]"
> 
> What value(s) should I set, while my GPS clock only sends me the 
> following values :
>   - Day
>   - Month
>   - Year
>   - Hour (local time)
>   - Minutes
>   - Seconds
> Once every minute. I use them to build a UNIX time_t. Should it be 
> stored in clockTimeStampSec or receiveTimeStampSec ?
> What about leap & precision ?
> 
> Thanks in advance.
> 

Go to http://www.buzzard.org.uk/radioclock.html and download the
code there. This is a functioning example of how to write a Unix
demon application that decodes and passes information from an
external time source to NTP via the SHM interface. This particular
example uses homebrew hardware connected to LW radio clocks, but it
should not be hard to modify for your usage.

It is under the GPL, so is free to use, provided you make your code
GPL as well.

JAB.

-- 
Jonathan A. Buzzard                 Email: jonathan (at) buzzard.me.uk
Northumberland, United Kingdom.       Tel: +44 1661-832195



More information about the questions mailing list