[ntp:questions] Re: Swiss HBG signal
Ulrich Mueller
ulm at kph.uni-mainz.de
Thu Jan 12 15:50:07 UTC 2006
I wrote:
>> The coding is very compatible with the German DCF77. Drivers should
>> be able to decode both, unless they choke on the different minute
>> markers.
> NTP doesn't like it: It inserts an additional bit for each extra
> pulse, and then it cannot decode the telegram.
> If I patch the inp_rawdcf function (in libparse/clk_rawdcf.c) to
> discard all pulses that are less than 700 ms after the previous pulse
> then the driver can decode the signal.
By popular demand, I include the patch below. However, this is only a
quick hack. I am not at all sure if inp_rawdcf is the right place to
suppress the extra pulses.
--- ntp-stable-4.2.0a-20050303/libparse/clk_rawdcf.c.orig 2004-02-25 06:58:09.000000000 +0100
+++ ntp-stable-4.2.0a-20050303/libparse/clk_rawdcf.c 2006-01-12 13:49:42.000000000 +0100
@@ -545,7 +545,8 @@
)
{
static struct timeval timeout = { 1, 500000 }; /* 1.5 secongs denote second #60 */
-
+ static struct timeval timemin = { 0, 700000 };
+
parseprintf(DD_PARSE, ("inp_rawdcf(0x%lx, 0x%x, ...)\n", (long)parseio, ch));
parseio->parse_dtime.parse_stime = *tstamp; /* collect timestamp */
@@ -558,6 +559,11 @@
(void) parse_addchar(parseio, ch);
return PARSE_INP_TIME;
}
+ else if (!parse_timedout(parseio, tstamp, &timemin))
+ {
+ /* discard extra pulses at minute marker for HBG */
+ return PARSE_INP_SKIP;
+ }
else
{
unsigned int rtc;
More information about the questions
mailing list