diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-02-28 16:32:28 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-02-28 16:32:28 -0500 |
commit | 5f28af9f91b118e13c49b949777187ab57d1cff2 (patch) | |
tree | 07f00cfeb4ce92708dd952aad6210883fdf2d558 /rtcm2_json.c | |
parent | 51bf98b8da22f882349ff5fc9c52ab157209e81a (diff) | |
download | gpsd-5f28af9f91b118e13c49b949777187ab57d1cff2.tar.gz |
Implement and document RTCM2.3 message type 14. All regression tests pass.
Diffstat (limited to 'rtcm2_json.c')
-rw-r--r-- | rtcm2_json.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/rtcm2_json.c b/rtcm2_json.c index e67b7266..7ea15c3e 100644 --- a/rtcm2_json.c +++ b/rtcm2_json.c @@ -78,7 +78,7 @@ int json_rtcm2_read(const char *buf, /* * Beware! Needs to stay synchronized with a corresponding - * nam,e array in the RTCM2 JSON dump code. This interpretation of + * name array in the RTCM2 JSON dump code. This interpretation of * NAVSYSTEM_GALILEO is assumed from RTCM3, it's not actually * documented in RTCM 2.1. */ @@ -147,6 +147,14 @@ int json_rtcm2_read(const char *buf, }; /*@+type@*/ + const struct json_attr_t json_rtcm14[] = { + RTCM2_HEADER + {"week", t_uinteger, .addr.uinteger = &rtcm2->gpstime.week}, + {"hour", t_uinteger, .addr.uinteger = &rtcm2->gpstime.hour}, + {"leapsecs", t_uinteger, .addr.uinteger = &rtcm2->gpstime.leapsecs}, + {NULL}, + }; + const struct json_attr_t json_rtcm16[] = { RTCM2_HEADER {"message", t_string, .addr.string = rtcm2->message, @@ -200,6 +208,8 @@ int json_rtcm2_read(const char *buf, status = json_read_object(buf, json_rtcm7, endptr); if (status == 0) rtcm2->almanac.nentries = (unsigned)satcount; + } else if (strstr(buf, "\"type\":14,") != NULL) { + status = json_read_object(buf, json_rtcm14, endptr); } else if (strstr(buf, "\"type\":16,") != NULL) { status = json_read_object(buf, json_rtcm16, endptr); } else { |