diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-10-16 15:11:58 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-10-16 15:11:58 -0400 |
commit | 6fd78f0f1da86ec302704767e48cec98d5ad6272 (patch) | |
tree | 288fdf4dfd87b5e9659f3c3a9d594324f79cab39 /libgpsd_core.c | |
parent | 97180c05bd1df417cd87b0f0049b39501153efb7 (diff) | |
download | gpsd-6fd78f0f1da86ec302704767e48cec98d5ad6272.tar.gz |
Simplify the drive transition test.
We now *always* change on a new packet type, counting on later logic
to revert if the previous driver was sticky.
All regression tests pass.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r-- | libgpsd_core.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c index bc3508e5..26715362 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -1171,16 +1171,12 @@ gps_mask_t gpsd_poll(struct gps_device_t *session) /* FALL THROUGH */ } else if (session->packet.type > COMMENT_PACKET) { /* - * Only switch drivers if we don't already have one with the - * matching packet type *and* we're not seeing an NMEA packet. - * The reason for the second guard is that some GPSes with - * binary protocols (notably SiRF and uBlox) also have a - * non-native NMEA mode. Without this guard, the code - * would forget the binary driver identification. + * Always change drivers on a new packet type. If thge previous + * driver type was sticky and this one isn't, we'll revert after + * processing the packet. */ identified = (session->device_type == NULL) - || (session->packet.type != session->device_type->packet_type && - session->packet.type != NMEA_PACKET); + || (session->packet.type != session->device_type->packet_type); /*@-nullderef@*/ if (identified) { const struct gps_type_t **dp; |