summaryrefslogtreecommitdiff
path: root/gpsd_json.c
diff options
context:
space:
mode:
authorDaniel_M_Williams <dwilliams@sea-machines.com>2018-05-30 13:50:58 -0400
committerGary E. Miller <gem@rellim.com>2018-06-12 18:56:15 -0700
commit5428507f30009df571d19dd01ad1e25cff1df7dc (patch)
treeb16efa89c34b7392d40c726fbc2b44dbe6b8d40b /gpsd_json.c
parent0149f55bc22cdcbe6f662fab2563479170adc653 (diff)
downloadgpsd-5428507f30009df571d19dd01ad1e25cff1df7dc.tar.gz
$GPVTG Added parsing, storage, output of magnetic course
Signed-off-by: Gary E. Miller <gem@rellim.com>
Diffstat (limited to 'gpsd_json.c')
-rw-r--r--gpsd_json.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gpsd_json.c b/gpsd_json.c
index 9c04e9c8..7d45295e 100644
--- a/gpsd_json.c
+++ b/gpsd_json.c
@@ -183,6 +183,9 @@ void json_tpv_dump(const struct gps_device_t *session,
str_appendf(reply, replylen, "\"epv\":%.3f,", gpsdata->fix.epv);
if (isnan(gpsdata->fix.track) == 0)
str_appendf(reply, replylen, "\"track\":%.4f,", gpsdata->fix.track);
+ if (isnan(gpsdata->fix.magnetic_track) == 0)
+ str_appendf(reply, replylen, "\"magtrack\":%.4f,",
+ gpsdata->fix.magnetic_track);
if (isnan(gpsdata->fix.speed) == 0)
str_appendf(reply, replylen, "\"speed\":%.3f,", gpsdata->fix.speed);
if ((gpsdata->fix.mode >= MODE_3D) && isnan(gpsdata->fix.climb) == 0)