summaryrefslogtreecommitdiff
path: root/libgps_json.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-08-23 15:17:57 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-08-23 15:17:57 +0000
commitc437f0c939ba9611fa01b1ba341a3fe03c6542fd (patch)
tree57c8ddf5afe1b2cdcbccc5297c48a9e5fe6361c7 /libgps_json.c
parent447a4137a696299725e3dc9840efc1fb94a629e6 (diff)
downloadgpsd-c437f0c939ba9611fa01b1ba341a3fe03c6542fd.tar.gz
Parse CONFIGDEV responses.
Diffstat (limited to 'libgps_json.c')
-rw-r--r--libgps_json.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libgps_json.c b/libgps_json.c
index 11bd61da..b6e1678c 100644
--- a/libgps_json.c
+++ b/libgps_json.c
@@ -229,17 +229,24 @@ static int json_version_read(const char *buf,
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) {
return json_sky_read(buf, gpsdata, NULL);
} else if (strstr(buf, "\"class\":\"DEVICE\"") != 0) {
- int status = json_device_read(buf, &gpsdata->devices.list[0], NULL);
+ status = json_device_read(buf, &gpsdata->devices.list[0], NULL);
if (status == 0)
gpsdata->set |= DEVICE_SET;
return status;
} else if (strstr(buf, "\"class\":\"DEVICES\"") != 0) {
return json_devicelist_read(buf, gpsdata, NULL);
+ } else if (strstr(buf, "\"class\":\"CONFIGDEV\"") != 0) {
+ status = json_configdev_read(buf, &gpsdata->dev, NULL);
+ if (status == 0)
+ gpsdata->set |= CONFIGDEV_SET;
+ return status;
} else if (strstr(buf, "\"class\":\"VERSION\"") != 0) {
return json_version_read(buf, gpsdata, NULL);
} else