summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-08-17 21:07:21 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-08-17 21:07:21 +0000
commitda9947b545847988e42c1975eac36708a367fd0a (patch)
tree90e6299096970e9ac56e636df3d981fbcdd0f486 /gpsd.c
parent6dcf899894786dd2814bbe955474215f4da19680 (diff)
downloadgpsd-da9947b545847988e42c1975eac36708a367fd0a.tar.gz
Add cycle-time reporting and setting to new protocol.
Steps towards making gpsctl work with new protocol. Incidentally, fixes a bug where min_cycle was not reported correctly in the C command.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/gpsd.c b/gpsd.c
index 06f535c9..b581e09f 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -1088,7 +1088,7 @@ static bool handle_oldstyle(struct subscriber_t *sub, char *buf,
",C=%.2f", channel->device->gpsdata.cycle);
else
(void)snprintf(phrase, sizeof(phrase), ",C=%.2f %.2f",
- channel->device->gpsdata.cycle, channel->device->gpsdata.cycle);
+ channel->device->gpsdata.cycle, channel->device->gpsdata.mincycle);
}
break;
#endif /* ALLOW_RECONFIGURE */
@@ -1718,18 +1718,7 @@ static void handle_newstyle_request(struct subscriber_t *sub,
else if (devconf.device[0] != '\0' && chp->device && strcmp(chp->device->gpsdata.gps_device, devconf.device)!=0)
continue;
else {
- (void)strlcpy(devconf.device,
- chp->device->gpsdata.gps_device,
- sizeof(devconf.device));
- (void)snprintf(devconf.serialmode,
- sizeof(devconf.serialmode),
- "%u%c%u",
- 9 - chp->device->gpsdata.stopbits,
- (int)chp->device->gpsdata.parity,
- chp->device->gpsdata.stopbits);
- devconf.bps=(int)gpsd_get_speed(&chp->device->ttyset);
- devconf.native = chp->device->gpsdata.driver_mode;
- json_configdev_dump(&devconf,
+ json_configdev_dump(chp->device,
reply + strlen(reply),
replylen - strlen(reply));
(void)strlcat(reply, "\r\n", replylen);