summaryrefslogtreecommitdiff
path: root/gpsd.h-tail
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-10-13 09:11:31 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-10-13 09:11:31 -0400
commite2499963397f5c06ef0109f96384d3f4cb5178f3 (patch)
treefda00274e5bd9e85c30a9c180911abbd655378b3 /gpsd.h-tail
parent6dfd7a4e1f1cc20859e6f74e4636011f3cd69ee0 (diff)
downloadgpsd-e2499963397f5c06ef0109f96384d3f4cb5178f3.tar.gz
Observer-driver reversion logic. This is a simple but major change.
Device drivers are now sorted into two categories: observers and controllers. An "observer" is a device type for which there are no control methods (that is, no mode switcher, no speed switcher, and no rate switcher). Note that observers *are* allowed to require initialization sends (such as wakeup probes or commands to set a sentence mix). Important observers include Generic NMEA, AIVDM, RTCM2, and RTCM3. Any other driver is a controller. The new behavior is simple: each time after you have recognized a packet to be handled by an observer driver, *revert the session's device-driver pointer to the previous controller* (if we've seen one). This means that seeing AIDVM or RTCM packets in an NMEA stream no longer causes us to lose information about the type of the driver if it had control methods we might want to use later. All regression tests pass.
Diffstat (limited to 'gpsd.h-tail')
-rw-r--r--gpsd.h-tail3
1 files changed, 3 insertions, 0 deletions
diff --git a/gpsd.h-tail b/gpsd.h-tail
index f4f1582a..7f424a05 100644
--- a/gpsd.h-tail
+++ b/gpsd.h-tail
@@ -404,6 +404,9 @@ struct gps_device_t {
/* session object, encapsulates all global state */
struct gps_data_t gpsdata;
/*@relnull@*/const struct gps_type_t *device_type;
+#ifdef RECONFIGURE_ENABLE
+ /*@relnull@*/const struct gps_type_t *last_controller;
+#endif /* RECONFIGURE_ENABLE */
struct gps_context_t *context;
sourcetype_t sourcetype;
servicetype_t servicetype;