summaryrefslogtreecommitdiff
path: root/driver_garmin.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_garmin.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_garmin.c')
-rw-r--r--driver_garmin.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/driver_garmin.c b/driver_garmin.c
index a196def4..2f9139f6 100644
--- a/driver_garmin.c
+++ b/driver_garmin.c
@@ -854,10 +854,9 @@ static bool garmin_detect(struct gps_device_t *session)
return true;
}
-static void garmin_configurator(struct gps_device_t *session,
- event_t event, unsigned int seq)
+static void garmin_event_hook(struct gps_device_t *session, event_t event)
{
- if (event == event_probe_subtype && seq == 0) {
+ if (event == event_probe_subtype && session->packet.counter == 0) {
// Tell the device to send product data
gpsd_report(LOG_PROG, "Get Garmin Product Data\n");
Build_Send_SER_Packet(session, GARMIN_LAYERID_APPL
@@ -1220,7 +1219,7 @@ const struct gps_type_t garmin_usb_binary_old =
.control_send = garmin_control_send, /* send raw bytes */
#endif /* ALLOW_CONTROLSEND */
#ifdef ALLOW_RECONFIGURE
- .configurator = garmin_configurator, /* enable what we need */
+ .event_hook = garmin_event_hook,/* enable what we need */
.speed_switcher = NULL, /* no speed switcher */
.mode_switcher = NULL, /* no mode switcher */
.rate_switcher = NULL, /* no sample-rate switcher */
@@ -1246,7 +1245,7 @@ const struct gps_type_t garmin_usb_binary =
.control_send = garmin_control_send, /* send raw bytes */
#endif /* ALLOW_CONTROLSEND */
#ifdef ALLOW_RECONFIGURE
- .configurator = garmin_configurator, /* enable what we need */
+ .event_hook = garmin_event_hook,/* enable what we need */
.speed_switcher = NULL, /* no speed switcher */
.mode_switcher = garmin_switcher, /* how to change modes */
.rate_switcher = NULL, /* no sample-rate switcher */
@@ -1271,7 +1270,7 @@ const struct gps_type_t garmin_ser_binary =
.control_send = garmin_control_send, /* send raw bytes */
#endif /* ALLOW_CONTROLSEND */
#ifdef ALLOW_RECONFIGURE
- .configurator = NULL, /* enable what we need */
+ .event_hook = NULL, /* enable what we need */
.speed_switcher = NULL, /* no speed switcher */
.mode_switcher = garmin_switcher, /* how to change modes */
.rate_switcher = NULL, /* no sample-rate switcher */