summaryrefslogtreecommitdiff
path: root/driver_proto.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_proto.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_proto.c')
-rw-r--r--driver_proto.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/driver_proto.c b/driver_proto.c
index e6cc9ceb..dbeacc54 100644
--- a/driver_proto.c
+++ b/driver_proto.c
@@ -419,17 +419,11 @@ static void _proto__event_hook(struct gps_device_t *session, event_t event)
*/
static gps_mask_t _proto__parse_input(struct gps_device_t *session)
{
- gps_mask_t st;
-
if (session->packet.type == _PROTO__PACKET) {
- st = _proto__dispatch(session, session->packet.outbuffer, session->packet.outbuflen);
- session->gpsdata.driver_mode = MODE_BINARY;
- return st;
+ return _proto__dispatch(session, session->packet.outbuffer, session->packet.outbuflen);
#ifdef NMEA_ENABLE
} else if (session->packet.type == NMEA_PACKET) {
- st = nmea_parse((char *)session->packet.outbuffer, session);
- session->gpsdata.driver_mode = MODE_NMEA;
- return st;
+ return nmea_parse((char *)session->packet.outbuffer, session);
#endif /* NMEA_ENABLE */
} else
return 0;
@@ -452,7 +446,6 @@ static void _proto__set_mode(struct gps_device_t *session, int mode)
{
if (mode == MODE_NMEA) {
// _proto__to_nmea(session->gpsdata.gps_fd,session->gpsdata.baudrate); /* send the mode switch control string */
- session->gpsdata.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
@@ -461,7 +454,6 @@ static void _proto__set_mode(struct gps_device_t *session, int mode)
(void)gpsd_switch_driver(session, "Generic NMEA");
} else {
session->back_to_nmea = false;
- session->gpsdata.driver_mode = MODE_BINARY;
}
}
#endif /* RECONFIGURE_ENABLE */