diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-08-30 13:02:15 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-08-30 13:02:15 +0000 |
commit | a31fa482f5a7c365a448962a857553ab31aac070 (patch) | |
tree | c63d516964f659900bf8508b6f60209f905c9a4d /gpsd.c | |
parent | e1a8b958ca152fefd30f4dd18b50d065a538b3c3 (diff) | |
download | gpsd-a31fa482f5a7c365a448962a857553ab31aac070.tar.gz |
Clean up device-state dumping.
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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]) |