diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2006-11-07 03:25:41 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2006-11-07 03:25:41 +0000 |
commit | a961236300450960213ee2432c500c48c016ef4d (patch) | |
tree | 1d29870bdf0e98cc91e075b4775776cd55ab8b00 /libgpsd_core.c | |
parent | 4e901caa5b1a0417009f9c50e554153d5c60ffab (diff) | |
download | gpsd-a961236300450960213ee2432c500c48c016ef4d.tar.gz |
Interleave NMEA subtype probes with received packets. This seems to
*immediately* improve detection of SiRF devices in NMEA mode, and probably
solves Davor Emard's Garmin GPS-10 bug as well (though this is not yet proven.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r-- | libgpsd_core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c index 27c34529..33bfa3e6 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -41,7 +41,7 @@ int gpsd_switch_driver(struct gps_device_t *session, char* typename) session->device_type->wrapup(session); /*@i@*/session->device_type = *dp; if (session->device_type->probe_subtype != NULL) - session->device_type->probe_subtype(session); + session->device_type->probe_subtype(session, session->packet_counter = 0); #ifdef ALLOW_RECONFIGURE if (session->context->enable_reconfigure && session->device_type->configurator != NULL) @@ -558,6 +558,8 @@ gps_mask_t gpsd_poll(struct gps_device_t *session) if (session->device_type) { newlen = session->device_type->get_packet(session); session->gpsdata.d_xmit_time = timestamp(); + if (session->device_type->probe_subtype != 0) + session->device_type->probe_subtype(session, ++session->packet_counter); } else { newlen = packet_get(session); session->gpsdata.d_xmit_time = timestamp(); |