diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-05-02 13:17:42 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-05-02 13:17:42 -0400 |
commit | dfbea279a00c3565c32f7f908e176b9f5b2cfbef (patch) | |
tree | b2aa0804cf6f7bf9d715b540e042323bd6930818 /rtcm3_json.c | |
parent | 04293ddbc091058131e91a8b27ff6b34aa98ba0f (diff) | |
download | gpsd-dfbea279a00c3565c32f7f908e176b9f5b2cfbef.tar.gz |
RTCM3 R104 JSON unoacking.
Diffstat (limited to 'rtcm3_json.c')
-rw-r--r-- | rtcm3_json.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/rtcm3_json.c b/rtcm3_json.c index 6b1e97b0..1fc2a637 100644 --- a/rtcm3_json.c +++ b/rtcm3_json.c @@ -177,6 +177,23 @@ int json_rtcm3_read(const char *buf, #undef R1010 /*@+type@*/ + /*@-type@*//* STRUCTARRAY confuses splint */ +#define R1014 &rtcm3->rtcmtypes.rtcm3_1014 + const struct json_attr_t json_rtcm1014[] = { + RTCM3_HEADER + {"netid", t_uinteger, .addr.uinteger = R1014.network_id}, + {"subnetid", t_uinteger, .addr.uinteger = R1014.subnetwork_id}, + {"statcount", t_uinteger, .addr.uinteger = R1014.stationcount}, + {"master", t_uinteger, .addr.uinteger = R1014.master_id}, + {"aux", t_uinteger, .addr.uinteger = R1014.aux_id}, + {"lat", t_real, .addr.real = R1014.d_lat}, + {"lon", t_real, .addr.real = R1014.d_lon}, + {"alt", t_real, .addr.real = R1014.d_alt}, + {NULL}, + }; +#undef R1014 + /*@+type@*/ + /*@-type@*//* complex union array initislizations confuses splint */ const struct json_attr_t json_rtcm3_fallback[] = { RTCM3_HEADER @@ -212,6 +229,8 @@ int json_rtcm3_read(const char *buf, status = json_read_object(buf, json_rtcm1009, endptr); } else if (strstr(buf, "\"type\":1010,") != NULL) { status = json_read_object(buf, json_rtcm1010, endptr); + } else if (strstr(buf, "\"type\":1014,") != NULL) { + status = json_read_object(buf, json_rtcm1010, endptr); } else { int n; status = json_read_object(buf, json_rtcm3_fallback, endptr); |