summaryrefslogtreecommitdiff
path: root/gpsd_json.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2018-09-11 16:56:35 -0700
committerGary E. Miller <gem@rellim.com>2018-09-11 16:56:35 -0700
commit9628f57fc93982fd22e2e71344d25f41914bbdfb (patch)
treece6d0c02f14c6856a26748f3e631c46940ca04c8 /gpsd_json.c
parent0e42eb0c4a64a1815011fed0c47da1f48067fd78 (diff)
downloadgpsd-9628f57fc93982fd22e2e71344d25f41914bbdfb.tar.gz
ATT: change heading to %.3f to match Trimble precision.
Diffstat (limited to 'gpsd_json.c')
-rw-r--r--gpsd_json.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gpsd_json.c b/gpsd_json.c
index 54124961..4eb13a4b 100644
--- a/gpsd_json.c
+++ b/gpsd_json.c
@@ -3336,8 +3336,9 @@ void json_att_dump(const struct gps_data_t *gpsdata,
(void)strlcpy(reply, "{\"class\":\"ATT\",", replylen);
str_appendf(reply, replylen, "\"device\":\"%s\",", gpsdata->dev.path);
if (isfinite(gpsdata->attitude.heading) != 0) {
+ /* Trimble outputs %.3f, so we do too. */
str_appendf(reply, replylen,
- "\"heading\":%.2f,", gpsdata->attitude.heading);
+ "\"heading\":%.3f,", gpsdata->attitude.heading);
if (gpsdata->attitude.mag_st != '\0')
str_appendf(reply, replylen,
"\"mag_st\":\"%c\",", gpsdata->attitude.mag_st);