summaryrefslogtreecommitdiff
path: root/libgps_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 /libgps_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 'libgps_json.c')
-rw-r--r--libgps_json.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgps_json.c b/libgps_json.c
index 795e5d76..8afd789d 100644
--- a/libgps_json.c
+++ b/libgps_json.c
@@ -52,6 +52,8 @@ static int json_tpv_read(const char *buf, struct gps_data_t *gpsdata,
.dflt.real = NAN},
{"track", t_real, .addr.real = &gpsdata->fix.track,
.dflt.real = NAN},
+ {"magtrack", t_real, .addr.real = &gpsdata->fix.magnetic_track,
+ .dflt.real = NAN},
{"speed", t_real, .addr.real = &gpsdata->fix.speed,
.dflt.real = NAN},
{"climb", t_real, .addr.real = &gpsdata->fix.climb,
@@ -473,6 +475,8 @@ int libgps_json_unpack(const char *buf,
gpsdata->set |= VERR_SET;
if (isnan(gpsdata->fix.track) == 0)
gpsdata->set |= TRACK_SET;
+ if (isnan(gpsdata->fix.magnetic_track) == 0)
+ gpsdata->set |= MAGNETIC_TRACK_SET;
if (isnan(gpsdata->fix.speed) == 0)
gpsdata->set |= SPEED_SET;
if (isnan(gpsdata->fix.climb) == 0)