diff options
-rw-r--r-- | gps.h | 4 | ||||
-rw-r--r-- | gps/client.py | 10 | ||||
-rw-r--r-- | gpsd.c | 2 | ||||
-rw-r--r-- | gpsd_json.c | 4 | ||||
-rw-r--r-- | gpsd_json.xml | 4 | ||||
-rw-r--r-- | gpsmon.c | 8 | ||||
-rw-r--r-- | libgps_core.c | 4 | ||||
-rw-r--r-- | libgps_sock.c | 8 | ||||
-rw-r--r-- | shared_json.c | 2 | ||||
-rw-r--r-- | test/clientlib/multipacket.log.chk | 2 |
10 files changed, 24 insertions, 24 deletions
@@ -1882,7 +1882,7 @@ struct policy_t { bool scaled; /* requesting report scaling? */ bool timing; /* requesting timing info */ bool split24; /* requesting split AIS Type 24s */ - bool ppsbar; /* requesting PPS bar display */ + bool pps; /* requesting PPS in NMEA/raw modes */ int loglevel; /* requested log level of messages */ char devpath[GPS_PATH_MAX]; /* specific device to watch */ char remote[GPS_PATH_MAX]; /* ...if this was passthrough */ @@ -1917,7 +1917,7 @@ typedef int socket_t; #define WATCH_TIMING 0x000200u /* timing information */ #define WATCH_DEVICE 0x000800u /* watch specific device */ #define WATCH_SPLIT24 0x001000u /* split AIS Type 24s */ -#define WATCH_PPSBAR 0x002000u /* enable PPS comment packets */ +#define WATCH_PPS 0x002000u /* enable PPS JSON */ #define WATCH_NEWSTYLE 0x010000u /* force JSON streaming */ #define WATCH_OLDSTYLE 0x020000u /* force old-style streaming */ diff --git a/gps/client.py b/gps/client.py index 71850563..304fc87e 100644 --- a/gps/client.py +++ b/gps/client.py @@ -129,7 +129,7 @@ WATCH_RAW = 0x000080 # output of raw packets WATCH_SCALED = 0x000100 # scale output to floats WATCH_TIMING = 0x000200 # timing information WATCH_SPLIT24 = 0x001000 # split AIS Type 24s -WATCH_PPSBAR = 0x002000 # enable PPS comment packets +WATCH_PPS = 0x002000 # enable PPS in raw/NMEA WATCH_DEVICE = 0x000800 # watch specific device class gpsjson(gpscommon): @@ -165,8 +165,8 @@ class gpsjson(gpscommon): arg += ',"timing":false' if flags & WATCH_SPLIT24: arg += ',"split24":false' - if flags & WATCH_PPSBAR: - arg += ',"ppsbar":false' + if flags & WATCH_PPS: + arg += ',"pps":false' else: # flags & WATCH_ENABLE: arg = '?WATCH={"enable":true' if flags & WATCH_JSON: @@ -183,8 +183,8 @@ class gpsjson(gpscommon): arg += ',"timing":true' if flags & WATCH_SPLIT24: arg += ',"split24":true' - if flags & WATCH_PPSBAR: - arg += ',"ppsbar":true' + if flags & WATCH_PPS: + arg += ',"pps":true' if flags & WATCH_DEVICE: arg += ',"device":"%s"' % devpath return self.send(arg + "}") @@ -1684,7 +1684,7 @@ static void ship_pps_drift_message(struct gps_device_t *session, struct subscriber_t *sub; for (sub = subscribers; sub < subscribers + MAXSUBSCRIBERS; sub++) { - if (sub->active != 0 && subscribed(sub, session) && sub->policy.ppsbar){ + if (sub->active != 0 && subscribed(sub, session) && sub->policy.pps){ (void)throttled_write(sub, PPSBAR, strlen(PPSBAR)); } } diff --git a/gpsd_json.c b/gpsd_json.c index b3188e99..d80047cd 100644 --- a/gpsd_json.c +++ b/gpsd_json.c @@ -426,7 +426,7 @@ void json_watch_dump(const struct policy_t *ccp, { /*@-compdef@*/ (void)snprintf(reply, replylen, - "{\"class\":\"WATCH\",\"enable\":%s,\"json\":%s,\"nmea\":%s,\"raw\":%d,\"scaled\":%s,\"timing\":%s,\"split24\":%s,\"ppsbar\":%s,", + "{\"class\":\"WATCH\",\"enable\":%s,\"json\":%s,\"nmea\":%s,\"raw\":%d,\"scaled\":%s,\"timing\":%s,\"split24\":%s,\"pps\":%s,", ccp->watcher ? "true" : "false", ccp->json ? "true" : "false", ccp->nmea ? "true" : "false", @@ -434,7 +434,7 @@ void json_watch_dump(const struct policy_t *ccp, ccp->scaled ? "true" : "false", ccp->timing ? "true" : "false", ccp->split24 ? "true" : "false", - ccp->ppsbar ? "true" : "false"); + ccp->pps ? "true" : "false"); if (ccp->devpath[0] != '\0') (void)snprintf(reply + strlen(reply), replylen - strlen(reply), "\"device\":\"%s\",", ccp->devpath); diff --git a/gpsd_json.xml b/gpsd_json.xml index df05cfb4..d54764c9 100644 --- a/gpsd_json.xml +++ b/gpsd_json.xml @@ -1011,11 +1011,11 @@ object.</para> false. Applies only to AIS reports.</entry> </row> <row> - <entry>ppsbar</entry> + <entry>pps</entry> <entry>No</entry> <entry>boolean</entry> <entry>If true, emit a PPS bar when the device issues - 1PPS. Intended to be used with the nmea and raw modes. + 1PPS. Intended to be used with the "nmea" and "raw" modes. Default is false. <emphasis role="bold">Note: this is an unstable experimental feature which may change or be removed without notice.</emphasis></entry> @@ -880,10 +880,10 @@ static void onsig(int sig UNUSED) longjmp(assertbuf, 1); } -#define WATCHRAW "?WATCH={\"raw\":2,\"ppsbar\":true}\r\n" -#define WATCHRAWDEVICE "?WATCH={\"raw\":2,\"ppsbar\":true,\"device\":\"%s\"}\r\n" -#define WATCHNMEA "?WATCH={\"nmea\":true,\"ppsbar\":true}\r\n" -#define WATCHNMEADEVICE "?WATCH={\"nmea\":true,\"ppsbar\":true,\"device\":\"%s\"}\r\n" +#define WATCHRAW "?WATCH={\"raw\":2,\"pps\":true}\r\n" +#define WATCHRAWDEVICE "?WATCH={\"raw\":2,\"pps\":true,\"device\":\"%s\"}\r\n" +#define WATCHNMEA "?WATCH={\"nmea\":true,\"pps\":true}\r\n" +#define WATCHNMEADEVICE "?WATCH={\"nmea\":true,\"pps\":true,\"device\":\"%s\"}\r\n" int main(int argc, char **argv) { diff --git a/libgps_core.c b/libgps_core.c index 9d6b21a9..bbaf8957 100644 --- a/libgps_core.c +++ b/libgps_core.c @@ -321,14 +321,14 @@ void libgps_dump_state(struct gps_data_t *collect) collect->version.proto_minor); if (collect->set & POLICY_SET) (void)fprintf(debugfp, - "POLICY: watcher=%s nmea=%s raw=%d scaled=%s timing=%s, split24=%s ppsbar=%s, devpath=%s\n", + "POLICY: watcher=%s nmea=%s raw=%d scaled=%s timing=%s, split24=%s pps=%s, devpath=%s\n", collect->policy.watcher ? "true" : "false", collect->policy.nmea ? "true" : "false", collect->policy.raw, collect->policy.scaled ? "true" : "false", collect->policy.timing ? "true" : "false", collect->policy.split24 ? "true" : "false", - collect->policy.ppsbar ? "true" : "false", + collect->policy.pps ? "true" : "false", collect->policy.devpath); if (collect->set & SATELLITE_SET) { int i; diff --git a/libgps_sock.c b/libgps_sock.c index 4232b006..c7f706ad 100644 --- a/libgps_sock.c +++ b/libgps_sock.c @@ -520,8 +520,8 @@ int gps_sock_stream(struct gps_data_t *gpsdata, unsigned int flags, (void)strlcat(buf, "\"timing\":false,", sizeof(buf)); if (flags & WATCH_SPLIT24) (void)strlcat(buf, "\"split24\":false,", sizeof(buf)); - if (flags & WATCH_PPSBAR) - (void)strlcat(buf, "\"ppsbar\":false,", sizeof(buf)); + if (flags & WATCH_PPS) + (void)strlcat(buf, "\"pps\":false,", sizeof(buf)); if (buf[strlen(buf) - 1] == ',') buf[strlen(buf) - 1] = '\0'; (void)strlcat(buf, "};", sizeof(buf)); @@ -550,8 +550,8 @@ int gps_sock_stream(struct gps_data_t *gpsdata, unsigned int flags, (void)strlcat(buf, "\"timing\":true,", sizeof(buf)); if (flags & WATCH_SPLIT24) (void)strlcat(buf, "\"split24\":true,", sizeof(buf)); - if (flags & WATCH_PPSBAR) - (void)strlcat(buf, "\"ppsbar\":true,", sizeof(buf)); + if (flags & WATCH_PPS) + (void)strlcat(buf, "\"pps\":true,", sizeof(buf)); /*@-nullpass@*//* shouldn't be needed, splint has a bug */ if (flags & WATCH_DEVICE) (void)snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), diff --git a/shared_json.c b/shared_json.c index 9c8320db..4c6f14ed 100644 --- a/shared_json.c +++ b/shared_json.c @@ -97,7 +97,7 @@ int json_watch_read(const char *buf, {"scaled", t_boolean, .addr.boolean = &ccp->scaled}, {"timing", t_boolean, .addr.boolean = &ccp->timing}, {"split24", t_boolean, .addr.boolean = &ccp->split24}, - {"ppsbar", t_boolean, .addr.boolean = &ccp->ppsbar}, + {"pps", t_boolean, .addr.boolean = &ccp->pps}, {"device", t_string, .addr.string = ccp->devpath, .len = sizeof(ccp->devpath)}, {"remote", t_string, .addr.string = ccp->remote, diff --git a/test/clientlib/multipacket.log.chk b/test/clientlib/multipacket.log.chk index 99030468..9ec3d05a 100644 --- a/test/clientlib/multipacket.log.chk +++ b/test/clientlib/multipacket.log.chk @@ -1,2 +1,2 @@ flags: (0x20000000) {POLICY} -POLICY: watcher=true nmea=false raw=0 scaled=false timing=false, split24=false ppsbar=false, devpath= +POLICY: watcher=true nmea=false raw=0 scaled=false timing=false, split24=false pps=false, devpath= |