summaryrefslogtreecommitdiff
path: root/libgps_json.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-08-23 15:45:54 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-08-23 15:45:54 +0000
commit2d130236d0dd5b52f652e257210d9f8ab9bb5933 (patch)
tree8018d4f9216dd6922c6d55ae17fb3fd7dd7ec718 /libgps_json.c
parentc437f0c939ba9611fa01b1ba341a3fe03c6542fd (diff)
downloadgpsd-2d130236d0dd5b52f652e257210d9f8ab9bb5933.tar.gz
Parse WATCH responses in the client library. All regression tests pass.
Diffstat (limited to 'libgps_json.c')
-rw-r--r--libgps_json.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libgps_json.c b/libgps_json.c
index b6e1678c..fc293de6 100644
--- a/libgps_json.c
+++ b/libgps_json.c
@@ -230,7 +230,6 @@ int libgps_json_unpack(const char *buf, struct gps_data_t *gpsdata)
/* the only entry point - unpack a JSON object into gpsdata_t substructures */
{
int status;
- // FIXME: Still need to parse WATCH
if (strstr(buf, "\"class\":\"TPV\"") != 0) {
return json_tpv_read(buf, gpsdata, NULL);
} else if (strstr(buf, "\"class\":\"SKY\"") != 0) {
@@ -240,6 +239,12 @@ int libgps_json_unpack(const char *buf, struct gps_data_t *gpsdata)
if (status == 0)
gpsdata->set |= DEVICE_SET;
return status;
+ } else if (strstr(buf, "\"class\":\"WATCH\"") != 0) {
+ status = json_watch_read(buf, &gpsdata->policy, NULL);
+ if (status == 0)
+ gpsdata->set |= POLICY_SET;
+ return status;
+
} else if (strstr(buf, "\"class\":\"DEVICES\"") != 0) {
return json_devicelist_read(buf, gpsdata, NULL);
} else if (strstr(buf, "\"class\":\"CONFIGDEV\"") != 0) {