diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-11-13 03:32:13 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-11-13 03:32:13 -0500 |
commit | 0ddafa77fbdbb2f573d879e060735ab6d3436735 (patch) | |
tree | ad0a54116963fdf38b35df40f29eaccc1a5fb97c /gpsctl.c | |
parent | b360367d400735a46c98f0fc0a604b479c19a1b2 (diff) | |
download | gpsd-0ddafa77fbdbb2f573d879e060735ab6d3436735.tar.gz |
Teach gpsctl to extract subtype information.
This degree of linger after packet sync is sufficient on a BU355 (SiRF-III).
Diffstat (limited to 'gpsctl.c')
-rw-r--r-- | gpsctl.c | 16 |
1 files changed, 3 insertions, 13 deletions
@@ -181,27 +181,17 @@ static char /*@observer@*/ *gpsd_id( /*@in@ */ struct gps_device_t *session) return (buf); } -static void ctlhook(struct gps_device_t *device, gps_mask_t changed UNUSED) +static void ctlhook(struct gps_device_t *device UNUSED, gps_mask_t changed UNUSED) /* recognize when we've achieved sync */ { static int packet_counter = 0; /* - * Anything non-NMEA is an immediate lock. - */ - if (device->device_type != NULL - && device->device_type->packet_type > NMEA_PACKET) - { - hunting = false; - (void) alarm(0); - } - - /* * If it's NMEA, go back around enough times for the type probes to * reveal any secret identity (like SiRF or UBX) the chip might have. + * If it's not, getting more packets might fetch subtype information. */ - if (device->packet.type == NMEA_PACKET - && packet_counter++ >= REDIRECT_SNIFF) + if (packet_counter++ >= REDIRECT_SNIFF) { hunting = false; (void) alarm(0); |