From 79c9ef1c9a5455342300d24333b982cadd58815e Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 10 Nov 2013 00:37:46 -0500 Subject: Teach the client library about ppsbar... ...against the extremmely unlikely evebtuality of anything but gpsmon wanting to use it. --- gps.h | 1 + gpsmon.c | 2 +- libgps_sock.c | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) 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), -- cgit v1.2.1