Lines Matching defs:??

2  * /src/NTP/ntp4-dev/libparse/clk_wharton.c,v 4.2 2004/11/14 15:29:41 kardel RELEASE_20050508_A
4 * clk_wharton.c,v 4.2 2004/11/14 15:29:41 kardel RELEASE_20050508_A
6 * From Philippe De Muyter <phdm@macqel.be>, 1999
12 #if defined(REFCLOCK) && defined(CLOCK_PARSE) && defined(CLOCK_WHARTON_400A)
16 * Copyright (C) 1999, 2000 by Philippe De Muyter <phdm@macqel.be>
18 * This program is distributed in the hope that it will be useful, but WITHOUT
19 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
37 * In private e-mail alastair@wharton.co.uk said :
38 * "If you are going to use the 400A and 404.2 system [for ntp] I recommend
39 * that you set the 400A to output the message every second. The start of
40 * transmission of the first byte of the message is synchronised to the
42 * The WHARTON 400A Series is able to send date/time serial messages
43 * in 7 output formats. We use format 1 here because it is the shortest.
44 * For use with this driver, the WHARTON 400A Series clock must be set-up
45 * as follows :
47 * Option No Option
48 * BST or CET display 3 9 or 11
49 * No external controller 7 0
51 * Baud rate 9600 bps 10 96
52 * Bit length 8 bits 11 8
53 * Parity even 12 E
55 * WHARTON 400A Series output format 1 is as follows :
63 * ss Second expressed in reversed decimal (units then tens)
64 * mm Minute expressed in reversed decimal
65 * hh Hour expressed in reversed decimal
66 * DD Day of month expressed in reversed decimal
67 * MM Month expressed in reversed decimal (January is 1)
68 * YY Year (without century) expressed in reversed decimal
73 * bit 3 0 = no early warning 1 = early warning
97 if (size != 15 || buffer[0] != STX || buffer[14] != ETX
98 || buffer[13] < '0' || buffer[13] > ('0' + 0xf))
100 for (i = 1; i < 13; i += 1)
101 if (buffer[i] < '0' || buffer[i] > '9')
103 clock_time->second = (buffer[2] - '0') * 10 + buffer[1] - '0';
104 clock_time->minute = (buffer[4] - '0') * 10 + buffer[3] - '0';
105 clock_time->hour = (buffer[6] - '0') * 10 + buffer[5] - '0';
106 clock_time->day = (buffer[8] - '0') * 10 + buffer[7] - '0';
107 clock_time->month = (buffer[10] - '0') * 10 + buffer[9] - '0';
108 clock_time->year = (buffer[12] - '0') * 10 + buffer[11] - '0';
110 if (buffer[13] & 0x1) /* We have CET time */
111 clock_time->utcoffset = -1*60*60;
112 else /* We have BST time */
114 if (buffer[13] & 0x2) {
116 clock_time->utcoffset += -1*60*60;
118 if (!(buffer[13] & 0x4))
120 if (buffer[13] & 0x8)
134 char ch,
140 parseprintf(DD_PARSE, ("inp_wharton_400a(0x%p, 0x%x, ...)\n", (void*)parseio, ch));
142 switch (ch)
148 parseio->parse_data[0] = ch;
154 if ((rtc = parse_addchar(parseio, ch)) == PARSE_INP_SKIP)
160 return parse_addchar(parseio, ch);
168 0, /* no PPS monitoring */
171 15, /* string buffer */
172 0 /* no private data (complete packets) */
181 * Revision 4.1 1999/02/28 15:27:24 kardel