diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2014-08-25 07:35:41 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2014-08-25 07:35:41 -0400 |
commit | 2f7a78002f012c7ed322767cf3e413b961a640b4 (patch) | |
tree | 50d95ee10f3a8e972489e5502a75dd970483a15f /driver_geostar.c | |
parent | 3517cd53afabac201b3563f58a33dc15fd35bfdd (diff) | |
download | gpsd-2f7a78002f012c7ed322767cf3e413b961a640b4.tar.gz |
Split firmwqre version query out of the init method.
This enables us to force readonly off while it's being called.
The practical effect is that gpsmon can get a firmware version (if this
is possible) without reconfiguring the device.
Diffstat (limited to 'driver_geostar.c')
-rw-r--r-- | driver_geostar.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/driver_geostar.c b/driver_geostar.c index e2f5899e..a7c37689 100644 --- a/driver_geostar.c +++ b/driver_geostar.c @@ -502,6 +502,14 @@ static ssize_t geostar_control_send(struct gps_device_t *session, } #endif /* CONTROLSEND_ENABLE */ + +static void geostar_init_query(struct gps_device_t *session) +{ + unsigned char buf[2 * 4]; + /* Poll Software Version */ + (void)geostar_write(session, 0xc1, buf, 1); +} + static void geostar_event_hook(struct gps_device_t *session, event_t event) { unsigned char buf[2 * 4]; @@ -537,8 +545,6 @@ static void geostar_event_hook(struct gps_device_t *session, event_t event) (void)geostar_write(session, 0x8e, buf, 1); /* Poll binary packets selected */ (void)geostar_write(session, 0x8f, buf, 1); - /* Poll Software Version */ - (void)geostar_write(session, 0xc1, buf, 1); } if (event == event_deactivate) { @@ -620,6 +626,7 @@ const struct gps_type_t driver_geostar = .get_packet = generic_get, /* use the generic packet getter */ .parse_packet = geostar_parse_input, /* parse message packets */ .rtcm_writer = NULL, /* doesn't accept DGPS corrections */ + .init_query = geostar_init_query, /* non-perturbing initial query */ .event_hook = geostar_event_hook, /* fire on various lifetime events */ #ifdef RECONFIGURE_ENABLE .speed_switcher = geostar_speed_switch,/* change baud rate */ |