summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-03-02 16:11:46 -0500
committerEric S. Raymond <esr@thyrsus.com>2011-03-02 16:11:46 -0500
commit2934f288da7d0e15cc511b5d5bcda27a98152ef5 (patch)
tree9fe417fcad3db5a7a546a7891b7dfb09400a1f47
parent9aa1a85b881f740cfff71a96a1f784b884959f94 (diff)
downloadgpsd-2934f288da7d0e15cc511b5d5bcda27a98152ef5.tar.gz
Code simplification.
-rw-r--r--gpsd_json.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/gpsd_json.c b/gpsd_json.c
index d502231f..405fd733 100644
--- a/gpsd_json.c
+++ b/gpsd_json.c
@@ -1019,6 +1019,7 @@ void json_rtcm3_dump(const struct rtcm3_t *rtcm,
break;
case 1005:
+ case 1006:
(void)snprintf(buf + strlen(buf), buflen - strlen(buf),
"\"station_id\":%u,\"system\":\"%s\","
"\"refstation\":\"%s\",\"sro\":\"%s\","
@@ -1030,21 +1031,10 @@ void json_rtcm3_dump(const struct rtcm3_t *rtcm,
rtcm->rtcmtypes.rtcm3_1005.ecef_x,
rtcm->rtcmtypes.rtcm3_1005.ecef_y,
rtcm->rtcmtypes.rtcm3_1005.ecef_z);
- break;
-
- case 1006:
- (void)snprintf(buf + strlen(buf), buflen - strlen(buf),
- "\"station_id\":%u,\"system\":\"%s\","
- "\"refstation\":\"%s\",\"sro\":\"%s\","
- "\"x\":%.4f,\"y\":%.4f,\"z\":%.4f,\"a\":%.4f,",
- rtcm->rtcmtypes.rtcm3_1006.station_id,
- systems[rtcm->rtcmtypes.rtcm3_1006.system],
- JSON_BOOL(rtcm->rtcmtypes.rtcm3_1006.reference_station),
- JSON_BOOL(rtcm->rtcmtypes.rtcm3_1006.single_receiver),
- rtcm->rtcmtypes.rtcm3_1006.ecef_x,
- rtcm->rtcmtypes.rtcm3_1006.ecef_y,
- rtcm->rtcmtypes.rtcm3_1006.ecef_z,
- rtcm->rtcmtypes.rtcm3_1006.height);
+ if (rtcm->type == 1006)
+ (void)snprintf(buf + strlen(buf), buflen - strlen(buf),
+ "\"h\":%.4f,",
+ rtcm->rtcmtypes.rtcm3_1006.height);
break;
case 1007: