summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2014-08-23 15:41:33 -0400
committerEric S. Raymond <esr@thyrsus.com>2014-08-23 15:41:33 -0400
commite1b1b5499dc5bd66f1fc266d616fa122453c7cdd (patch)
tree783a31c70ec5e65a090bbdc647350055a905042c
parent9ac48e182a8edda40ff05a7f7e584c0219bc55a5 (diff)
downloadgpsd-e1b1b5499dc5bd66f1fc266d616fa122453c7cdd.tar.gz
Device list fully moved out of terminal union; all regression tests pass.
-rw-r--r--TODO3
-rw-r--r--gps.h15
-rw-r--r--test/clientlib/multipacket.log.chk4
3 files changed, 12 insertions, 10 deletions
diff --git a/TODO b/TODO
index a7233066..9bed147b 100644
--- a/TODO
+++ b/TODO
@@ -165,8 +165,7 @@ need changes.
*** On next API bump ***
-In struct gpsdata_t, move the device list out of the union and move
-the tag field to private data.
+Move the tag field to private data.
*** Make subframe reports available in the C API.
diff --git a/gps.h b/gps.h
index 32e1c5f7..3e9bd804 100644
--- a/gps.h
+++ b/gps.h
@@ -39,7 +39,7 @@ extern "C" {
* 5.1 - GPS_PATH_MAX uses system PATH_MAX; split24 flag added. New
* model and serial members in part B of AIS type 24, conforming
* with ITU-R 1371-4. New timedrift structure (Nov 2013, release 3.10).
- * 5.2 - AIS type 6 and 8 get 'structured' flag.
+ * 5.2 - AIS type 6 and 8 get 'structured' flag; devices moved out of union.
*/
#define GPSD_API_MAJOR_VERSION 5 /* bump on incompatible changes */
#define GPSD_API_MINOR_VERSION 2 /* bump on compatible changes */
@@ -2012,11 +2012,17 @@ struct gps_data_t {
struct policy_t policy; /* our listening policy */
+ struct {
+ timestamp_t time;
+ int ndevices;
+ struct devconfig_t list[MAXUSERDEVS];
+ } devices;
+
/* should be moved to privdata someday */
char tag[MAXTAGLEN+1]; /* tag of last sentence processed */
/* pack things never reported together to reduce structure size */
-#define UNION_SET (RTCM2_SET|RTCM3_SET|SUBFRAME_SET|AIS_SET|ATTITUDE_SET|GST_SET|VERSION_SET|DEVICELIST_SET|LOGMESSAGE_SET|ERROR_SET|TIMEDRIFT_SET)
+#define UNION_SET (RTCM2_SET|RTCM3_SET|SUBFRAME_SET|AIS_SET|ATTITUDE_SET|GST_SET|VERSION_SET|LOGMESSAGE_SET|ERROR_SET|TIMEDRIFT_SET)
union {
/* unusual forms of sensor data that might come up the pipe */
struct rtcm2_t rtcm2;
@@ -2028,11 +2034,6 @@ struct gps_data_t {
struct gst_t gst;
/* "artificial" structures for various protocol responses */
struct version_t version;
- struct {
- timestamp_t time;
- int ndevices;
- struct devconfig_t list[MAXUSERDEVS];
- } devices;
char error[256];
struct timedrift_t timedrift;
};
diff --git a/test/clientlib/multipacket.log.chk b/test/clientlib/multipacket.log.chk
index 9ec3d05a..dbcd18c8 100644
--- a/test/clientlib/multipacket.log.chk
+++ b/test/clientlib/multipacket.log.chk
@@ -1,2 +1,4 @@
-flags: (0x20000000) {POLICY}
+flags: (0x20100000) {DEVICELIST|POLICY}
POLICY: watcher=true nmea=false raw=0 scaled=false timing=false, split24=false pps=false, devpath=
+DEVICELIST:1 devices:
+1: path='/dev/ttyS0' driver='SiRF binary'