diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-09-28 22:48:27 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-09-28 22:48:27 +0000 |
commit | 70c15cbab26ede25a46330f2860a046b2da3ddb2 (patch) | |
tree | f85d38563303592fb4b9020f2be0e05eb5b837cf /gpsd.c | |
parent | fb8af4b7035f524d724bf729a8c9645f430f45fa (diff) | |
download | gpsd-70c15cbab26ede25a46330f2860a046b2da3ddb2.tar.gz |
Make sure we get a DEVICE message on assignment.
All regression tests pass. Code spplints clean.
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -819,23 +819,28 @@ static /*@null@*/struct channel_t *assign_channel(struct subscriber_t *user, /*@ +sefparams @*/ } #endif /* OLDSTYLE_ENABLE */ + if (newstyle(user) && user->policy.watcher) { + char buf[GPS_JSON_RESPONSE_MAX]; + json_device_dump(channel->device, buf, sizeof(buf)); + (void)throttled_write(user, buf, strlen(buf)); + } } } +#ifdef OLDSTYLE_ENABLE if (was_unassigned) { char buf[NMEA_MAX]; buf[0] = '\0'; -#ifdef OLDSTYLE_ENABLE if (!newstyle(user) && user->policy.watcher) (void)snprintf(buf, sizeof(buf), "GPSD,X=%f,I=%s\r\n", timestamp(), gpsd_id(channel->device)); -#endif /* OLDSTYLE_ENABLE */ /*@ -sefparams +matchanyintegral @*/ if (buf[0]!='\0') (void)throttled_write(user, buf, strlen(buf)); /*@ +sefparams -matchanyintegral @*/ } +#endif /* OLDSTYLE_ENABLE */ channel->subscriber = user; return channel; |