diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-11-25 16:35:34 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-11-25 16:35:34 -0500 |
commit | 819e357d71db864fba7ff9637752f73a06ec0677 (patch) | |
tree | b1b1874ab08383774840b8f8a4cc482ff5025bdb /gpsmon.c | |
parent | b3d3b2da747786daae76441db7a5df61a9c4f4e8 (diff) | |
download | gpsd-819e357d71db864fba7ff9637752f73a06ec0677.tar.gz |
Add a licensing answer to the FAQ.
Diffstat (limited to 'gpsmon.c')
-rw-r--r-- | gpsmon.c | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -24,6 +24,7 @@ #endif /* S_SPLINT_S */ #include "gpsd.h" +#include "gps_json.h" #include "gpsmon.h" #include "revision.h" @@ -652,12 +653,8 @@ bool monitor_control_send( /*@in@*/ unsigned char *buf, size_t len) static bool monitor_raw_send( /*@in@*/ unsigned char *buf, size_t len) { - if (!serial) - return false; - else { - ssize_t st = gpsd_write(&session, (char *)buf, len); - return (st > 0 && (size_t) st == len); - } + ssize_t st = gpsd_write(&session, (char *)buf, len); + return (st > 0 && (size_t) st == len); } #endif /* CONTROLSEND_ENABLE */ @@ -723,6 +720,17 @@ static void gpsmon_hook(struct gps_device_t *device, gps_mask_t changed UNUSED) else #endif /* PPS_ENABLE */ { +#ifdef __future__ + if (!serial) + { + if (device->packet.type == JSON_PACKET) + { + const char *end = NULL; + libgps_json_unpack((char *)device->packet.outbuffer, &session.gpsdata, &end); + } + } +#endif /* __future__ */ + if (curses_active) select_packet_monitor(device); |