diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2014-08-23 18:35:20 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2014-08-23 18:35:20 -0400 |
commit | 88a0c062d32d34138cccdf199db522538840bd09 (patch) | |
tree | aaa5b6a77ab8f151915da56a6dcfeb398519d5dc /gpsd.c | |
parent | 824f200a87df3eb35119492c8affe0358f59d337 (diff) | |
download | gpsd-88a0c062d32d34138cccdf199db522538840bd09.tar.gz |
PPS is no kinger marked unstable/experimental.
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -673,7 +673,6 @@ static ssize_t throttled_write(struct subscriber_t *sub, char *buf, } static void notify_watchers(struct gps_device_t *device, - bool onjson, bool onpps, const char *sentence, ...) /* notify all JSON-watching clients of a given device about an event */ { @@ -687,7 +686,7 @@ static void notify_watchers(struct gps_device_t *device, for (sub = subscribers; sub < subscribers + MAXSUBSCRIBERS; sub++) if (sub->active != 0 && subscribed(sub, device)) { - if ((onjson && sub->policy.json) || (onpps && sub->policy.pps)) + if (sub->policy.json) (void)throttled_write(sub, buf, strlen(buf)); } } @@ -697,7 +696,7 @@ static void deactivate_device(struct gps_device_t *device) /* deactivate device, but leave it in the pool (do not free it) */ { #ifdef SOCKET_EXPORT_ENABLE - notify_watchers(device, true, false, + notify_watchers(device, "{\"class\":\"DEVICE\",\"path\":\"%s\",\"activated\":0}\r\n", device->gpsdata.dev.path); #endif /* SOCKET_EXPORT_ENABLE */ @@ -786,7 +785,7 @@ bool gpsd_add_device(const char *device_name, bool flag_nowait) ret = open_device(devp); } #ifdef SOCKET_EXPORT_ENABLE - notify_watchers(devp, true, false, + notify_watchers(devp, "{\"class\":\"DEVICE\",\"path\":\"%s\",\"activated\":%lf}\r\n", devp->gpsdata.dev.path, timestamp()); #endif /* SOCKET_EXPORT_ENABLE */ @@ -1508,7 +1507,7 @@ static void all_reports(struct gps_device_t *device, gps_mask_t changed) { char id2[GPS_JSON_RESPONSE_MAX]; json_device_dump(device, id2, sizeof(id2)); - notify_watchers(device, true, false, id2); + notify_watchers(device, id2); } } #endif /* SOCKET_EXPORT_ENABLE */ @@ -1701,7 +1700,7 @@ static void ship_pps_drift_message(struct gps_device_t *session, { #ifdef SOCKET_EXPORT_ENABLE /*@-type@*//* splint is confused about struct timespec */ - notify_watchers(session, true, true, + notify_watchers(session, "{\"class\":\"PPS\",\"device\":\"%s\",\"real_sec\":%ld, \"real_nsec\":%ld,\"clock_sec\":%ld,\"clock_nsec\":%ld}\r\n", session->gpsdata.dev.path, td->real.tv_sec, td->real.tv_nsec, |