summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gpsd.c b/gpsd.c
index 70d2f110..dbda5a83 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -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,