summaryrefslogtreecommitdiff
path: root/driver_superstar2.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-09-13 09:03:35 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-09-13 09:03:35 +0000
commitcd419e26ba8bfda8ba3fa8193a792bf2b4f35e44 (patch)
tree124e2d17cbaa9c1d0cdeb6a5b04f056bf34610fc /driver_superstar2.c
parent00cd07ffcaa670709bc492e01d5c97be0262580b (diff)
downloadgpsd-cd419e26ba8bfda8ba3fa8193a792bf2b4f35e44.tar.gz
The configurator member becomes event_hook.
Code that referenced the sequence number argument now looks at session->packet_counter directly. This was almost a pure refactoring step. I added one obviously missing session->packet.counter == 0 test in the oncore driver. Despite temptation, I didn't try to fix when the packet.counter gets zeroed; I'm going to try to confine the behavior changes to one concise patch, which hasn't happened yet. Codebase splints clean. All regression tests pass.
Diffstat (limited to 'driver_superstar2.c')
-rw-r--r--driver_superstar2.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/driver_superstar2.c b/driver_superstar2.c
index 3ecd961c..a0a9c7de 100644
--- a/driver_superstar2.c
+++ b/driver_superstar2.c
@@ -47,8 +47,7 @@ static gps_mask_t superstar2_msg_ephemeris(struct gps_device_t *,
*/
static ssize_t superstar2_control_send(struct gps_device_t *, char *, size_t);
static void superstar2_probe_wakeup(struct gps_device_t *);
-static void superstar2_configurator(struct gps_device_t *,
- event_t, unsigned int);
+static void superstar2_event_hook(struct gps_device_t *, event_t);
static bool superstar2_set_speed(struct gps_device_t *, speed_t, char, int);
static void superstar2_set_mode(struct gps_device_t *, int);
static void superstar2_probe_wakeup(struct gps_device_t *);
@@ -517,11 +516,9 @@ superstar2_probe_wakeup(struct gps_device_t *session)
return;
}
-static void superstar2_configurator(struct gps_device_t *session,
- event_t event,
- unsigned int seq)
+static void superstar2_event_hook(struct gps_device_t *session, event_t event)
{
- if (seq != 0)
+ if (session->packet.counter != 0)
return;
if (event == event_configure) {
@@ -646,7 +643,7 @@ const struct gps_type_t superstar2_binary = {
#endif /* ALLOW_CONTROLSEND */
#ifdef ALLOW_RECONFIGURE
/* Enable what reports we need */
- .configurator = superstar2_configurator,
+ .event_hook = superstar2_event_hook,
/* Speed (baudrate) switch */
.speed_switcher = superstar2_set_speed,
/* Switch to NMEA mode */
@@ -655,7 +652,7 @@ const struct gps_type_t superstar2_binary = {
.rate_switcher = NULL,
/* Minimum cycle time (not used) */
.min_cycle = 1,
- /* Undo the actions of .configurator */
+ /* Undo the actions of event_configure */
.revert = NULL,
#endif /* ALLOW_RECONFIGURE */
/* Puts device back to original settings */