summaryrefslogtreecommitdiff
path: root/libgps_json.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2015-04-01 18:51:53 -0700
committerGary E. Miller <gem@rellim.com>2015-04-01 18:51:53 -0700
commitf7492a6c8582a0c17cb87264709853458056e3a1 (patch)
tree0aed2c5b1ca26b0d30c6d33cdc9854c4694d3f29 /libgps_json.c
parent7084a76e7f0d9e0eeacea5a7236ab12c838eaa1d (diff)
downloadgpsd-f7492a6c8582a0c17cb87264709853458056e3a1.tar.gz
Add precision to the JSON decoder. Throw away the result.
Next rev of gps_data_t->pps needs to add a field for precision.
Diffstat (limited to 'libgps_json.c')
-rw-r--r--libgps_json.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libgps_json.c b/libgps_json.c
index 8f97c274..5f68efb2 100644
--- a/libgps_json.c
+++ b/libgps_json.c
@@ -359,6 +359,7 @@ int json_pps_read(const char *buf, struct gps_data_t *gpsdata,
const char **endptr)
{
int real_sec = 0, real_nsec = 0, clock_sec = 0, clock_nsec = 0;
+ int precision = 0;
const struct json_attr_t json_attrs_pps[] = {
/* *INDENT-OFF* */
{"class", t_check, .dflt.check = "PPS"},
@@ -372,6 +373,8 @@ int json_pps_read(const char *buf, struct gps_data_t *gpsdata,
.dflt.integer = 0},
{"clock_nsec",t_integer, .addr.integer = &clock_nsec,
.dflt.integer = 0},
+ {"precision", t_integer, .addr.integer = &precision,
+ .dflt.integer = 0},
{NULL},
/* *INDENT-ON* */
};