From ab6b0d294fc2fd04dd35d1e08e83adc5268b2067 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 15 Oct 2013 06:02:11 -0400 Subject: Remove dead code and clean up. All regression tests pass. Under the new transition rules, the Zodiac driver can never see an NMEA packet. --- driver_zodiac.c | 40 +++------------------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) (limited to 'driver_zodiac.c') diff --git a/driver_zodiac.c b/driver_zodiac.c index 1af2250d..30ab0a58 100644 --- a/driver_zodiac.c +++ b/driver_zodiac.c @@ -362,52 +362,18 @@ static void handle1108(struct gps_device_t *session) static gps_mask_t zodiac_analyze(struct gps_device_t *session) { - char buf[BUFSIZ]; - int i; unsigned int id = (unsigned int)((session->packet.outbuffer[3] << 8) | session->packet.outbuffer[2]); - - if (session->packet.type != ZODIAC_PACKET) { - const struct gps_type_t **dp; - gpsd_report(session->context->debug, LOG_PROG, - "zodiac_analyze packet type %d\n", - session->packet.type); - // Wrong packet type ? - // Maybe find a trigger just in case it's an Earthmate - gpsd_report(session->context->debug, LOG_RAW + 4, - "Is this a trigger: %s ?\n", - (char *)session->packet.outbuffer); - - for (dp = gpsd_drivers; *dp; dp++) { - char *trigger = (*dp)->trigger; - - if (trigger != NULL - && strncmp((char *)session->packet.outbuffer, trigger, - strlen(trigger)) == 0 - && isatty(session->gpsdata.gps_fd) != 0) { - gpsd_report(session->context->debug, LOG_PROG, "found %s.\n", trigger); - - (void)gpsd_switch_driver(session, (*dp)->type_name); - return 0; - } - } - return 0; - } - - buf[0] = '\0'; - for (i = 0; i < (int)session->packet.outbuflen; i++) - (void)snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), - "%02x", (unsigned int)session->packet.outbuffer[i]); gpsd_report(session->context->debug, LOG_RAW, "Raw Zodiac packet type %d length %zd: %s\n", - id, session->packet.outbuflen, buf); + id, session->packet.outbuflen, gpsd_prettydump(session)); if (session->packet.outbuflen < 10) return 0; - (void)snprintf(session->gpsdata.tag, sizeof(session->gpsdata.tag), "%u", - id); + (void)snprintf(session->gpsdata.tag, sizeof(session->gpsdata.tag), + "%u", id); /* * Normal cycle for these devices is 1001 1002. -- cgit v1.2.1