diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-01-03 10:43:16 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-01-03 10:43:16 -0500 |
commit | 80d7c002ba0656918c4461034956fb6bbd3bb35b (patch) | |
tree | 7276761835c30ea5dd69fa9ac28b2950cda4f791 /gpsd.c | |
parent | 7b432754a88822894a7fd97cca478b6497de1103 (diff) | |
download | gpsd-80d7c002ba0656918c4461034956fb6bbd3bb35b.tar.gz |
Reporting framework for subframes. All regression tests pass.
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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, |