gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] [PATCH v1 1/1] gps2udp: do not send out JSON when not configu


From: Ferry Huberts
Subject: [gpsd-dev] [PATCH v1 1/1] gps2udp: do not send out JSON when not configured to do so
Date: Fri, 3 Jan 2014 16:21:34 +0100

From: Ferry Huberts <address@hidden>

Signed-off-by: Ferry Huberts <address@hidden>
---
 gps2udp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gps2udp.c b/gps2udp.c
index ac816bc..8549a12 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 */
     /address@hidden@*/
     for (channel=0; channel < udpchannel; channel ++) {
-- 
1.8.4.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]