Lines Matching defs:peer
291 static int nmea_start (int, struct peer *);
292 static void nmea_shutdown (int, struct peer *);
294 static void nmea_poll (int, struct peer *);
295 static void nmea_procrec (struct peer * const, l_fp);
299 struct refclockstat *, struct peer *);
304 static void nmea_timer (int, struct peer *);
326 static void gps_send(int, const char *, struct peer *);
349 * return 0 on error, 1 on success. Even on error the peer structures
357 struct peer * peer
360 struct refclockproc * const pp = peer->procptr;
368 rate = (peer->ttl & NMEA_BAUDRATE_MASK) >> NMEA_BAUDRATE_SHIFT;
400 pp->io.srcclock = peer;
413 peer->precision = PRECISION;
421 refnumtoa(&peer->srcadr));
424 pp->io.fd = refclock_open(&peer->srcadr, device, baudrate, LDISC_CLK);
446 struct peer * peer
449 struct refclockproc * const pp = peer->procptr;
479 struct peer * peer
482 struct refclockproc * const pp = peer->procptr;
510 refnumtoa(&peer->srcadr));
514 &peer->srcadr,
531 refnumtoa(&peer->srcadr));
536 refnumtoa(&peer->srcadr));
548 /* clear markers and peer items */
553 peer->flags &= ~FLAG_PPS;
554 peer->precision = PRECISION;
576 struct peer * peer
579 struct refclockproc * const pp = peer->procptr;
587 gps_send(pp->io.fd, "$PMOTG,RMC,0000*1D\r\n", peer);
627 struct peer * const peer,
632 struct refclockproc * const pp = peer->procptr;
673 refnumtoa(&peer->srcadr), up->lb_buf));
674 refclock_report(peer, CEVNT_BADREPLY);
682 refnumtoa(&peer->srcadr), up->lb_len,
715 if (peer->ttl & NMEA_DELAYMEAS_MASK) {
716 mprintf_clock_stats(&peer->srcadr, "delay %0.6f %.*s",
723 if ((peer->ttl & NMEA_MESSAGE_MASK) &&
724 !(peer->ttl & sentence_mode[sentence])) {
750 refnumtoa(&peer->srcadr), up->lb_buf));
751 refclock_report(peer, CEVNT_BADREPLY);
765 refnumtoa(&peer->srcadr));
776 refnumtoa(&peer->srcadr), up->lb_len, up->lb_buf));
863 if (peer->ttl & NMEA_IGNSTATUS_MASK) { /* assume always good? */
888 refclock_report(peer, checkres);
906 warp = !(peer->ttl & NMEA_DATETRUST_MASK);
909 refnumtoa(&peer->srcadr), rc_dtyp));
941 refnumtoa(&peer->srcadr),
946 refnumtoa(&peer->srcadr),
965 refnumtoa(&peer->srcadr), up->lb_buf));
978 peer->precision = PPS_PRECISION;
980 if ( ! (peer->ttl & NMEA_QUIETPPS_MASK))
981 peer->flags |= FLAG_PPS;
983 refnumtoa(&peer->srcadr)));
987 refnumtoa(&peer->srcadr)));
1034 struct peer * const peer = rbufp->recv_peer;
1035 struct refclockproc * const pp = peer->procptr;
1067 nmea_procrec(peer, rbufp->recv_time);
1091 struct peer * peer
1094 struct refclockproc * const pp = peer->procptr;
1107 peer->flags &= ~FLAG_PPS;
1108 peer->precision = PRECISION;
1119 peer->flags &= ~FLAG_PPS;
1121 refclock_report(peer, CEVNT_TIMEOUT);
1126 refclock_receive(peer);
1128 refclock_report(peer, CEVNT_NOMINAL);
1136 if (peer->ttl & NMEA_EXTLOG_MASK) {
1141 &peer->srcadr, "%s %u %u %u %u %u %u",
1147 record_clock_stats(&peer->srcadr, pp->a_lastcode);
1155 * gps_send(fd, cmd, peer) Sends a command to the GPS receiver.
1156 * as in gps_send(fd, "rqts,u", peer);
1174 struct peer * peer
1195 refnumtoa(&peer->srcadr), cmd));
1203 DPRINTF(1, ("%s gps_send: '%.*s'\n", refnumtoa(&peer->srcadr),
1207 if (refclock_fdwrite(peer, fd, cmd, len) != len)
1208 refclock_report(peer, CEVNT_FAULT);