summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-01-03 10:43:16 -0500
committerEric S. Raymond <esr@thyrsus.com>2011-01-03 10:43:16 -0500
commit80d7c002ba0656918c4461034956fb6bbd3bb35b (patch)
tree7276761835c30ea5dd69fa9ac28b2950cda4f791 /gpsd.c
parent7b432754a88822894a7fd97cca478b6497de1103 (diff)
downloadgpsd-80d7c002ba0656918c4461034956fb6bbd3bb35b.tar.gz
Reporting framework for subframes. All regression tests pass.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gpsd.c b/gpsd.c
index 8529d804..bedf7c0d 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -1286,6 +1286,19 @@ static void json_report(struct subscriber_t *sub,
buf, sizeof(buf));
(void)throttled_write(sub, buf, strlen(buf));
}
+ /*
+ * Subframe reporting works a bit differently because
+ * it has to be enabled at device level in order for
+ * *any* subscriber to see it, but *not all* subscribers
+ * necessarily want it. So we leave it up to the device
+ * drivers to decide whether to turn subframe reporting on,
+ * and gate the reports here.
+ */
+ if (sub->policy.subframe && (changed & SUBFRAME_IS) != 0) {
+ subframe_json_dump(&device->gpsdata.subframe,
+ buf, sizeof(buf));
+ (void)throttled_write(sub, buf, strlen(buf));
+ }
#ifdef COMPASS_ENABLE
if ((changed & ATT_IS) != 0) {
json_att_dump(&device->gpsdata,