summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-11-10 00:37:46 -0500
committerEric S. Raymond <esr@thyrsus.com>2013-11-10 00:37:46 -0500
commit79c9ef1c9a5455342300d24333b982cadd58815e (patch)
tree2b3c7fa3dba30bb1501f2b8f89523635e240a466
parent038f7c549642d361443e133a0cbcdd89c7c3f24d (diff)
downloadgpsd-79c9ef1c9a5455342300d24333b982cadd58815e.tar.gz
Teach the client library about ppsbar...
...against the extremmely unlikely evebtuality of anything but gpsmon wanting to use it.
-rw-r--r--gps.h1
-rw-r--r--gpsmon.c2
-rw-r--r--libgps_sock.c4
3 files changed, 6 insertions, 1 deletions
diff --git a/gps.h b/gps.h
index 817627ec..105735a2 100644
--- a/gps.h
+++ b/gps.h
@@ -1917,6 +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_NEWSTYLE 0x010000u /* force JSON streaming */
#define WATCH_OLDSTYLE 0x020000u /* force old-style streaming */
diff --git a/gpsmon.c b/gpsmon.c
index 8174c8ae..2dbf65ef 100644
--- a/gpsmon.c
+++ b/gpsmon.c
@@ -856,7 +856,7 @@ static /*@observer@*/ char *pps_report(struct gps_device_t *session UNUSED,
/*@+type@*/
packet_log("#------------------------------------"
" PPS "
- "------------------------------------#\n");
+ "------------------------------------#");
return "gpsmon";
}
#endif /* PPS_ENABLE */
diff --git a/libgps_sock.c b/libgps_sock.c
index edb812dc..4232b006 100644
--- a/libgps_sock.c
+++ b/libgps_sock.c
@@ -520,6 +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 (buf[strlen(buf) - 1] == ',')
buf[strlen(buf) - 1] = '\0';
(void)strlcat(buf, "};", sizeof(buf));
@@ -548,6 +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));
/*@-nullpass@*//* shouldn't be needed, splint has a bug */
if (flags & WATCH_DEVICE)
(void)snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),