diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-10-03 15:37:50 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-10-04 16:23:27 -0400 |
commit | 85971992215d9ee830046c18d3899f663c8a20df (patch) | |
tree | 1b3f22dc14c1183e68acb175996ac1ac8e71329b /libgpsd_core.c | |
parent | f2600d4761a493826122f2427c7d041c47156264 (diff) | |
download | gpsd-85971992215d9ee830046c18d3899f663c8a20df.tar.gz |
Make binary driver selection sticky again.
See the comment at libgpsd_core.c:1084 for explanation.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r-- | libgpsd_core.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c index 73e53a9c..dd317a03 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -1082,12 +1082,17 @@ gps_mask_t gpsd_poll(struct gps_device_t *session) } else if (session->packet.type > COMMENT_PACKET) { first_sync = (session->device_type == NULL); /* - * Only switch drivers, if we don't already have one with the - * matching packet type. + * 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. */ /*@-nullderef@*/ if (first_sync || - session->packet.type != session->device_type->packet_type) { + (session->packet.type != session->device_type->packet_type && + session->packet.type != NMEA_PACKET)) { const struct gps_type_t **dp; for (dp = gpsd_drivers; *dp; dp++) |