diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-08-18 15:30:49 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-08-18 15:30:49 +0000 |
commit | 6885b22471926d3387be8fc491ea016c78917c13 (patch) | |
tree | bb8e2ad915055b4789e99192c7fe7c22b4338a1d /libgps_json.c | |
parent | 22f2dbd5af5ecfcdcd3ce71cb2b6d714887d17cd (diff) | |
download | gpsd-6885b22471926d3387be8fc491ea016c78917c13.tar.gz |
More steps towards ?DEVICES decoding - refactor code.
Diffstat (limited to 'libgps_json.c')
-rw-r--r-- | libgps_json.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libgps_json.c b/libgps_json.c index 39a82025..5732af56 100644 --- a/libgps_json.c +++ b/libgps_json.c @@ -141,15 +141,18 @@ static int json_sky_read(const char *buf, static int json_devices_read(const char *buf, struct gps_data_t *gpsdata, const char **endptr) { + char names[GPS_JSON_DEVICES_MAX][PATH_MAX]; const struct json_attr_t json_attrs_subdevices[] = { // FIXME: Parse device records, too. + {"name", string, .addr.string.ptr = gpsdata->gps_device, + .addr.string.len = sizeof(gpsdata->gps_device)}, {NULL}, }; // FIXME: Can we abolish the hard limit on the number of devices? const struct json_attr_t json_attrs_devices[] = { {"devices", array, .addr.array.element_type = object, .addr.array.arr.subtype = json_attrs_subdevices, - .addr.array.maxlen = 4}, + .addr.array.maxlen = GPS_JSON_DEVICES_MAX}, {NULL}, }; int status; |