summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-08-30 13:02:15 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-08-30 13:02:15 +0000
commita31fa482f5a7c365a448962a857553ab31aac070 (patch)
treec63d516964f659900bf8508b6f60209f905c9a4d /gpsd.c
parente1a8b958ca152fefd30f4dd18b50d065a538b3c3 (diff)
downloadgpsd-a31fa482f5a7c365a448962a857553ab31aac070.tar.gz
Clean up device-state dumping.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gpsd.c b/gpsd.c
index 75945710..44412829 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -588,7 +588,7 @@ static void deactivate_device(struct gps_device_t *device)
#endif /* OLDSTYLE_ENABLE */
#ifdef GPSDNG_ENABLE
notify_watchers(device, true,
- "{\"class\":\"DEVICE\",\"name\":\"%s\",\"activated\":0}\r\n",
+ "{\"class\":\"DEVICE\",\"path\":\"%s\",\"activated\":0}\r\n",
device->gpsdata.dev.path);
#endif /* GPSDNG_ENABLE */
if (device->gpsdata.gps_fd != -1) {
@@ -865,9 +865,7 @@ static struct channel_t *assign_channel(struct subscriber_t *user,
#endif /* OLDSTYLE_ENABLE */
#ifdef GPSDNG_ENABLE
if (newstyle(user) && was_unassigned)
- (void)snprintf(buf, sizeof(buf), "{\"class\":\"DEVICE\",\"device\":\"%s\",\"activated\":%2.2f}\r\n",
- channel->device->gpsdata.dev.path,
- timestamp());
+ json_device_dump(channel->device, buf, sizeof(buf));
#endif /* GPSDNG_ENABLE */
/*@ -sefparams +matchanyintegral @*/
if (buf[0])