summaryrefslogtreecommitdiff
path: root/driver_proto.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-09-13 09:40:29 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-09-13 09:40:29 +0000
commitbfede96dcb989353be781759f337a7b34393aac2 (patch)
tree62c6df31e74bace28c197397e348043b621e3445 /driver_proto.c
parentcd419e26ba8bfda8ba3fa8193a792bf2b4f35e44 (diff)
downloadgpsd-bfede96dcb989353be781759f337a7b34393aac2.tar.gz
Fold the revert method into the generic event hook.
Abolish the wrapup method; there were only two users, one was trivial, and the other belonged as a revert.
Diffstat (limited to 'driver_proto.c')
-rw-r--r--driver_proto.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/driver_proto.c b/driver_proto.c
index e03ab721..ccdc2bc5 100644
--- a/driver_proto.c
+++ b/driver_proto.c
@@ -72,8 +72,6 @@ static void _proto__probe_wakeup(struct gps_device_t *);
static void _proto__event_hook(struct gps_device_t *, event_t);
static bool _proto__set_speed(struct gps_device_t *, speed_t, char, int);
static void _proto__set_mode(struct gps_device_t *, int);
-static void _proto__revert(struct gps_device_t *);
-static void _proto__wrapup(struct gps_device_t *);
/*
* Decode the navigation solution message
@@ -317,7 +315,7 @@ static void _proto__event_hook(struct gps_device_t *session, event_t event)
{
/*
* Remember that session->packet.counter is available when yoo write
- these hooks; session->packet.counter == 0 is often a useful condition.
+ * these hooks; session->packet.counter == 0 is often a useful condition.
*/
if (event == event_configure) {
/*
@@ -332,6 +330,15 @@ static void _proto__event_hook(struct gps_device_t *session, event_t event)
* anything, but conditionalizing probes on them gives the device
* time to respond to each one.
*/
+ } else if (event == event_revert) {
+ /*
+ * Reverse whatever was done art configure_event time.
+ */
+ } else if (event == event_wrapup) {
+ /*
+ * Do release actions that are independent of whether the
+ * event_configure hook ran or not.
+ */
}
}
@@ -387,21 +394,10 @@ static void _proto__set_mode(struct gps_device_t *session, int mode)
session->gpsdata.driver_mode = MODE_BINARY;
}
}
-
-static void _proto__revert(struct gps_device_t *session)
-{
- /*
- * Reverse whatever was done art configure_event time.
- */
-}
#endif /* ALLOW_RECONFIGURE */
static void _proto__wrapup(struct gps_device_t *session)
{
- /*
- * Do release actions that are independent of whether the event_configure
- * hook ran or not.
- */
}
/* The methods in this code take parameters and have */
@@ -453,11 +449,7 @@ const struct gps_type_t _proto__binary = {
.rate_switcher = NULL,
/* Minimum cycle time of the device */
.min_cycle = 1,
- /* Undo the actions at configure_event time */
- .revert = _proto__revert,
#endif /* ALLOW_RECONFIGURE */
- /* Puts device back to original settings */
- .wrapup = _proto__wrapup,
};
#endif /* defined(_PROTO__ENABLE) && defined(BINARY_ENABLE) */