Lines Matching +full:data +full:- +full:rate +full:- +full:bps
2 * refclock_pst - clock driver for PSTI/Traconex WWV/WWVH receivers
25 * The DIPswitches should be set for 9600 bps line speed, 24-hour day-
26 * of-year format and UTC time zone. Automatic correction for DST should
41 * on-time = first <cr>
43 * a = AM/PM indicator (' ' for 24-hour mode)
46 * s = daylight-saving indicator (' ' for 24-hour mode)
48 * r = baud rate (3 = 1200, 6 = 9600)
76 #define PRECISION (-10) /* precision assumed (about 1 ms) */
80 #define PST_PHI (10e-6) /* max clock oscillator offset */
88 char *lastptr; /* pointer to timecode data */
114 * pst_start - open the devices and initialize data for processing
131 fd = refclock_open(&peer->srcadr, device, SPEED232, LDISC_CLK);
139 pp = peer->procptr;
140 pp->io.clock_recv = pst_receive;
141 pp->io.srcclock = peer;
142 pp->io.datalen = 0;
143 pp->io.fd = fd;
144 if (!io_addclock(&pp->io)) {
146 pp->io.fd = -1;
150 pp->unitptr = up;
155 peer->precision = PRECISION;
156 pp->clockdesc = DESCRIPTION;
157 memcpy((char *)&pp->refid, WWVREFID, 4);
163 * pst_shutdown - shut down the clock
174 pp = peer->procptr;
175 up = pp->unitptr;
176 if (-1 != pp->io.fd)
177 io_closeclock(&pp->io);
184 * pst_receive - receive data from the serial interface
204 peer = rbufp->recv_peer;
205 pp = peer->procptr;
206 up = pp->unitptr;
207 up->lastptr += refclock_gtlin(rbufp, up->lastptr, pp->a_lastcode
208 + BMAX - 2 - up->lastptr, &trtmp);
209 *up->lastptr++ = ' ';
210 *up->lastptr = '\0';
216 if (up->tcswitch == 0)
217 pp->lastrec = trtmp;
218 up->tcswitch++;
219 pp->lencode = up->lastptr - pp->a_lastcode;
220 if (up->tcswitch < 3)
228 if (pp->lencode < LENPST) {
237 if (sscanf(pp->a_lastcode,
239 &mchar, &pp->hour, &pp->minute, &pp->second, &pp->nsec,
240 &daychar, junque, &pp->day, info, <emp) != 10) {
244 pp->nsec *= 1000000;
254 pp->leap = LEAP_NOTINSYNC;
256 memcpy((char *)&pp->refid, WWVHREFID, 4);
258 memcpy((char *)&pp->refid, WWVREFID, 4);
259 if (peer->stratum <= 1)
260 peer->refid = pp->refid;
262 pp->lastref = pp->lastrec;
263 pp->disp = PST_PHI * ltemp * 60;
271 else if (peer->disp > MAXDISTANCE)
277 * pst_poll - called by the transmit procedure
296 pp = peer->procptr;
297 up = pp->unitptr;
298 up->tcswitch = 0;
299 up->lastptr = pp->a_lastcode;
300 if (write(pp->io.fd, "QTQDQMT", 6) != 6)
302 if (pp->coderecv == pp->codeproc) {
307 record_clock_stats(&peer->srcadr, pp->a_lastcode);
310 printf("pst: timecode %d %s\n", pp->lencode,
311 pp->a_lastcode);
313 pp->polls++;