[ntp:questions] help with reference clock driver nomenclature!

Dave Hart davehart at gmail.com
Tue Oct 20 19:40:59 UTC 2009


On Tue, Oct 20, 2009 at 9:57 AM, Aneeq Mahmood <its.aneeq at gmail.com> wrote:
> Can anyone clarify how 'calling ' the receive subroutine actually work and
> where am i getting it wrong?

I don't know where you might be getting it wrong, but the receive
routine for a serial-connected clock is called when a read completes
on that serial device, with the data read and the timestamp when
select() or poll() indicated it was readable.  See ntpd/ntp_io.c:3062
read_refclock_packet().  Take note of the rb->receiver assignment,
this is the pointer to the refclock's receive routine.  The completed
"receive buffer" is put in a queue with other received network packets
and refclock data.  When it is pulled from the queue, the receive
routine is called.

If the device generates CR LF at the end of each line, expect the
clock receive routine to be called with a zero length every other
time.

Cheers,
Dave Hart



More information about the questions mailing list