summaryrefslogtreecommitdiff
path: root/driver_oncore.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-10-03 16:12:47 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-10-04 16:23:28 -0400
commit7eacbef3fa19f37e85d452787a605aad1396a4d2 (patch)
tree6dffcfb82c66f69ba096385a3eb60c1256ef37df /driver_oncore.c
parent85971992215d9ee830046c18d3899f663c8a20df (diff)
downloadgpsd-7eacbef3fa19f37e85d452787a605aad1396a4d2.tar.gz
Change the logic for managing the drive mode bit to report reality...
...rather than setting it ad-hoc on a per-driver basis.
Diffstat (limited to 'driver_oncore.c')
-rw-r--r--driver_oncore.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/driver_oncore.c b/driver_oncore.c
index cf383a72..06c94b3b 100644
--- a/driver_oncore.c
+++ b/driver_oncore.c
@@ -491,7 +491,6 @@ static void oncore_set_mode(struct gps_device_t *session, int mode)
if (mode == MODE_NMEA) {
/* send the mode switch control string */
/* oncore_to_nmea(session->gpsdata.gps_fd,session->gpsdata.baudrate); */
- session->gpsdata.dev.driver_mode = MODE_NMEA;
/*
* Anticipatory switching works only when the packet getter is the
* generic one and it recognizes packets of the type this driver
@@ -500,7 +499,6 @@ static void oncore_set_mode(struct gps_device_t *session, int mode)
(void)gpsd_switch_driver(session, "Generic NMEA");
} else {
session->back_to_nmea = false;
- session->gpsdata.dev.driver_mode = MODE_BINARY;
}
}
#endif /* RECONFIGURE_ENABLE */
@@ -510,15 +508,11 @@ static gps_mask_t oncore_parse_input(struct gps_device_t *session)
gps_mask_t st;
if (session->packet.type == ONCORE_PACKET) {
- st = oncore_dispatch(session, session->packet.outbuffer,
+ return oncore_dispatch(session, session->packet.outbuffer,
session->packet.outbuflen);
- session->gpsdata.dev.driver_mode = MODE_BINARY;
- return st;
#ifdef NMEA_ENABLE
} else if (session->packet.type == NMEA_PACKET) {
- st = nmea_parse((char *)session->packet.outbuffer, session);
- session->gpsdata.dev.driver_mode = MODE_NMEA;
- return st;
+ return nmea_parse((char *)session->packet.outbuffer, session);
#endif /* NMEA_ENABLE */
} else
return 0;