diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-10-15 06:02:11 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-10-15 06:02:11 -0400 |
commit | ab6b0d294fc2fd04dd35d1e08e83adc5268b2067 (patch) | |
tree | 6bb8837ad7bac363560ac360e9de11a0b9324543 /driver_zodiac.c | |
parent | ffc1f85ef14ee4b54d4e7f7cfcf75b28a9f044de (diff) | |
download | gpsd-ab6b0d294fc2fd04dd35d1e08e83adc5268b2067.tar.gz |
Remove dead code and clean up. All regression tests pass.
Under the new transition rules, the Zodiac driver can never see an
NMEA packet.
Diffstat (limited to 'driver_zodiac.c')
-rw-r--r-- | driver_zodiac.c | 40 |
1 files changed, 3 insertions, 37 deletions
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. |