summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-02-20 16:52:53 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-02-20 16:52:53 -0500
commit54fb5427ed51ec65e620159ab0d0474d43b5145a (patch)
treebfd13a95e78a03bf0d98d6fe190cb7e40e9a085f
parent54fe1ec39a26c8cef311fdf7963f22252ebf5664 (diff)
downloadgpsd-54fb5427ed51ec65e620159ab0d0474d43b5145a.tar.gz
Avoid overexposure of an internal mask. EOF_SET -> EOF_IS
Also, use PPSDRIFT_SET as a client-side status flag for JSON PPS rather than the (not yet shipped) TIMEDRIFT_SET. Next release we're probably going to add a drift object for in-line time. No logic changes. All regression tests pass.
-rw-r--r--gps.h2
-rw-r--r--gpsd.h-tail19
-rw-r--r--libgps_json.c2
-rw-r--r--libgpsd_core.c4
4 files changed, 14 insertions, 13 deletions
diff --git a/gps.h b/gps.h
index c7515510..15467f25 100644
--- a/gps.h
+++ b/gps.h
@@ -1957,7 +1957,7 @@ struct gps_data_t {
#define LOGMESSAGE_SET (1llu<<30)
#define ERROR_SET (1llu<<31)
#define TIMEDRIFT_SET (1llu<<32)
-#define EOF_SET (1llu<<33)
+#define PPSDRIFT_SET (1llu<<33)
#define SET_HIGH_BIT 34
timestamp_t online; /* NZ if GPS is on line, 0 if not.
*
diff --git a/gpsd.h-tail b/gpsd.h-tail
index 741f58b0..a9d25063 100644
--- a/gpsd.h-tail
+++ b/gpsd.h-tail
@@ -327,15 +327,16 @@ typedef enum {
#define STATUS_DGPS_FIX 2 /* yes, with DGPS */
#define INTERNAL_SET(n) ((gps_mask_t)(1llu<<(SET_HIGH_BIT+(n))))
-#define RAW_IS INTERNAL_SET(1) /* raw pseudorange data available */
-#define USED_IS INTERNAL_SET(2) /* sat-used count available */
-#define DRIVER_IS INTERNAL_SET(3) /* driver type identified */
-#define CLEAR_IS INTERNAL_SET(4) /* starts a reporting cycle */
-#define REPORT_IS INTERNAL_SET(5) /* ends a reporting cycle */
-#define NODATA_IS INTERNAL_SET(6) /* no data read from fd */
-#define PPSTIME_IS INTERNAL_SET(7) /* precision time is available */
-#define PERR_IS INTERNAL_SET(8) /* PDOP set */
-#define PASSTHROUGH_IS INTERNAL_SET(9) /* passthrough mode */
+#define RAW_IS INTERNAL_SET(1) /* raw pseudoranges available */
+#define USED_IS INTERNAL_SET(2) /* sat-used count available */
+#define DRIVER_IS INTERNAL_SET(3) /* driver type identified */
+#define CLEAR_IS INTERNAL_SET(4) /* starts a reporting cycle */
+#define REPORT_IS INTERNAL_SET(5) /* ends a reporting cycle */
+#define NODATA_IS INTERNAL_SET(6) /* no data read from fd */
+#define PPSTIME_IS INTERNAL_SET(7) /* precision time is available */
+#define PERR_IS INTERNAL_SET(8) /* PDOP set */
+#define PASSTHROUGH_IS INTERNAL_SET(9) /* passthrough mode */
+#define EOF_IS INTERNAL_SET(10) /* synthetic EOF */
#define DATA_IS ~(ONLINE_SET|PACKET_SET|CLEAR_IS|REPORT_IS)
typedef /*@unsignedintegraltype@*/ unsigned int driver_mask_t;
diff --git a/libgps_json.c b/libgps_json.c
index f58de8be..156ddf1b 100644
--- a/libgps_json.c
+++ b/libgps_json.c
@@ -521,7 +521,7 @@ int libgps_json_unpack(const char *buf,
status = json_pps_read(buf, gpsdata, end);
if (status == 0) {
gpsdata->set &= ~UNION_SET;
- gpsdata->set |= TIMEDRIFT_SET;
+ gpsdata->set |= PPSDRIFT_SET;
}
return status;
} else
diff --git a/libgpsd_core.c b/libgpsd_core.c
index f9eec664..149982fc 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -1226,7 +1226,7 @@ gps_mask_t gpsd_poll(struct gps_device_t *session)
if (strcmp((const char *)session->lexer.outbuffer, "# EOF\n") == 0) {
gpsd_report(&session->context->errout, LOG_PROG,
"synthetic EOF\n");
- return EOF_SET;
+ return EOF_IS;
}
else
gpsd_report(&session->context->errout, LOG_PROG,
@@ -1507,7 +1507,7 @@ int gpsd_multipoll(const bool data_ready,
for (fragments = 0; ; fragments++) {
gps_mask_t changed = gpsd_poll(device);
- if (changed == EOF_SET) {
+ if (changed == EOF_IS) {
gpsd_report(&device->context->errout, LOG_WARN,
"device signed off %s\n",
device->gpsdata.dev.path);