diff options
author | Christian Gagneraud <chgans@gna.org> | 2012-05-11 14:54:53 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2012-05-11 14:54:53 -0400 |
commit | 5076fa7fb6bdc0d9c0591cde20a5b20452c4942c (patch) | |
tree | 41ebeca4642d19244c71314c94aaaa14e5ed8b11 /gpsd_json.c | |
parent | 2a62d13b260430097cb4adab0f64901cfb2b13dc (diff) | |
download | gpsd-5076fa7fb6bdc0d9c0591cde20a5b20452c4942c.tar.gz |
Fixes for reporting of AIS met/hydro message.
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Diffstat (limited to 'gpsd_json.c')
-rw-r--r-- | gpsd_json.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gpsd_json.c b/gpsd_json.c index 6d97ff6c..86479346 100644 --- a/gpsd_json.c +++ b/gpsd_json.c @@ -2063,12 +2063,12 @@ void json_aivdm_dump(const struct ais_t *ais, /* layout is almost identical to FID=31 from IMO289 */ if (scaled) (void)snprintf(buf + strlen(buf), buflen - strlen(buf), - "{\"lat\":%.3f,\"lon\":%.3f,", + "\"lat\":%.3f,\"lon\":%.3f,", ais->type8.dac1fid31.lat / AIS_LATLON3_SCALE, ais->type8.dac1fid31.lon / AIS_LATLON3_SCALE); else (void)snprintf(buf + strlen(buf), buflen - strlen(buf), - "{\"lat\":%d,\"lon\":%d,", + "\"lat\":%d,\"lon\":%d,", ais->type8.dac1fid31.lat, ais->type8.dac1fid31.lon); if (ais->type8.fid == 31) @@ -2078,7 +2078,7 @@ void json_aivdm_dump(const struct ais_t *ais, (void)snprintf(buf + strlen(buf), buflen - strlen(buf), "\"timestamp\":\"%02uT%02u:%02uZ\"," "\"wapeed\":%u,\"wgust\":%u,\"wdir\":%u," - "\"wgustdir\":%u,\"humidity\":%u", + "\"wgustdir\":%u,\"humidity\":%u,", ais->type8.dac1fid31.day, ais->type8.dac1fid31.hour, ais->type8.dac1fid31.minute, @@ -2112,7 +2112,7 @@ void json_aivdm_dump(const struct ais_t *ais, ais->type8.dac1fid31.visibility * 0.1); else (void)snprintf(buf + strlen(buf), buflen - strlen(buf), - "\"visibility\":%u,:", + "\"visibility\":%u,", ais->type8.dac1fid31.visibility); if (!scaled) (void)snprintf(buf + strlen(buf), buflen - strlen(buf), @@ -2120,11 +2120,11 @@ void json_aivdm_dump(const struct ais_t *ais, ais->type8.dac1fid31.waterlevel); else if (ais->type8.fid == 31) (void)snprintf(buf + strlen(buf), buflen - strlen(buf), - "\"waterlevel\":%.1f,:", + "\"waterlevel\":%.1f,", ais->type8.dac1fid31.waterlevel * 0.01); else (void)snprintf(buf + strlen(buf), buflen - strlen(buf), - "\"waterlevel\":%.1f,:", + "\"waterlevel\":%.1f,", ais->type8.dac1fid31.waterlevel * 0.1); if (scaled) { @@ -2140,7 +2140,7 @@ void json_aivdm_dump(const struct ais_t *ais, }; (void)snprintf(buf + strlen(buf), buflen - strlen(buf), "\"leveltrend\":\"%s\"," - "\"cspeed\":%.1f,\"cdir\":%u" + "\"cspeed\":%.1f,\"cdir\":%u," "\"cspeed2\":%.1f,\"cdir2\":%u,\"cdepth2\":%u," "\"cspeed3\":%.1f,\"cdir3\":%u,\"cdepth3\":%u," "\"waveheight\":%.1f,\"waveperiod\":%u,\"wavedir\":%u," |