diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-08-27 13:41:17 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-08-27 13:41:17 +0000 |
commit | c9bbc90053093222192f1f9982e990907e9e54ac (patch) | |
tree | 38462a37cdff53b41e3f9e6cb4e3bc9638d57d0f /rtcm2_json.c | |
parent | 831cecc1bb9ae26594e99d3ea8f6347044e08cbd (diff) | |
download | gpsd-c9bbc90053093222192f1f9982e990907e9e54ac.tar.gz |
Parse RTCM2 message type 5, and fix an error in the RTCM2 dump code.
Diffstat (limited to 'rtcm2_json.c')
-rw-r--r-- | rtcm2_json.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/rtcm2_json.c b/rtcm2_json.c index f8c9b6e2..545cde43 100644 --- a/rtcm2_json.c +++ b/rtcm2_json.c @@ -40,6 +40,7 @@ int json_rtcm2_read(const char *buf, {"station_health", uinteger, .addr.uinteger = &rtcm2->stathlth}, int status, satcount; + const struct json_attr_t rtcm1_satellite[] = { {"ident", uinteger, STRUCTOBJECT(struct rangesat_t, ident)}, {"udre", uinteger, STRUCTOBJECT(struct rangesat_t, udre)}, @@ -83,9 +84,20 @@ int json_rtcm2_read(const char *buf, {NULL}, }; + const struct json_attr_t rtcm5_satellite[] = { + {"ident", uinteger, STRUCTOBJECT(struct consat_t, ident)}, + {"iodl", boolean, STRUCTOBJECT(struct consat_t, iodl)}, + {"health", uinteger, STRUCTOBJECT(struct consat_t, health)}, + {"health_en", boolean, STRUCTOBJECT(struct consat_t, health_en)}, + {"new_data", boolean, STRUCTOBJECT(struct consat_t, new_data)}, + {"los_warning", boolean, STRUCTOBJECT(struct consat_t, los_warning)}, + {"tou", uinteger, STRUCTOBJECT(struct consat_t, tou)}, + {NULL}, + }; const struct json_attr_t json_rtcm5[] = { - // FIXME RTCM2_HEADER + {"satellites", array, STRUCTARRAY(rtcm2->conhealth.sat, + rtcm5_satellite, &satcount)}, {NULL}, }; @@ -130,6 +142,8 @@ int json_rtcm2_read(const char *buf, status = json_read_object(buf, json_rtcm4, endptr); } else if (strstr(buf, "\"type\":5") != NULL) status = json_read_object(buf, json_rtcm5, endptr); + if (status == 0) + rtcm2->conhealth.nentries = (unsigned)satcount; else if (strstr(buf, "\"type\":6") != NULL) status = json_read_object(buf, json_rtcm6, endptr); else if (strstr(buf, "\"type\":7") != NULL) |