summaryrefslogtreecommitdiff
path: root/gps2udp.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2014-01-03 11:27:51 -0800
committerGary E. Miller <gem@rellim.com>2014-01-03 11:27:51 -0800
commit17d1650f752ebdce066a0e99ef118954a7473970 (patch)
tree22903324ea77123247b9b1cab8291c8b67c02332 /gps2udp.c
parent539333a81b5786f2edf4b6378b75e5c966eb5125 (diff)
downloadgpsd-17d1650f752ebdce066a0e99ef118954a7473970.tar.gz
gps2udp: do not send out JSON when not configured to do so
From: Ferry Huberts <mailings@hupie.com>
Diffstat (limited to 'gps2udp.c')
-rw-r--r--gps2udp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gps2udp.c b/gps2udp.c
index ac816bc8..8549a129 100644
--- a/gps2udp.c
+++ b/gps2udp.c
@@ -105,6 +105,11 @@ static int send_udp (char *nmeastring, size_t ind)
buffer[ind] = '\r'; ind++;
buffer[ind] = '\0';
+ if (!(flags & WATCH_JSON) && buffer[0] == '{') {
+ /* do not send JSON when not configured to do so */
+ return 0;
+ }
+
/* send message on udp channel */
/*@-type@*/
for (channel=0; channel < udpchannel; channel ++) {