summaryrefslogtreecommitdiff
path: root/gpsctl.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-11-11 07:11:38 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-11-11 07:11:38 +0000
commit9f63c7a03a3d1fc5c5fa0a83720fc0e0b283e6fc (patch)
treef7e1cfa5722aa7c989c813bd562f354e4e3a8fd5 /gpsctl.c
parent07f7c76ec8562367db7db907b4ae5400c7a91c05 (diff)
downloadgpsd-9f63c7a03a3d1fc5c5fa0a83720fc0e0b283e6fc.tar.gz
Correct DEVICE invocations for gpsctl.c.
Diffstat (limited to 'gpsctl.c')
-rw-r--r--gpsctl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gpsctl.c b/gpsctl.c
index fcc29c96..f79d2884 100644
--- a/gpsctl.c
+++ b/gpsctl.c
@@ -77,7 +77,7 @@ static int gps_query(struct gps_data_t *gpsdata, const char *fmt, ... )
}
gpsd_report(LOG_PROG, "gps_query(), wrote, %s\n", buf);
ret = gps_poll(gpsdata);
- if ( ERR_SET & gpsdata->set) {
+ if (ERR_SET & gpsdata->set) {
gpsd_report(LOG_ERROR, "gps_query() error '%s'\n", gpsdata->error);
}
return ret;
@@ -314,16 +314,16 @@ int main(int argc, char **argv)
}
if (to_nmea) {
- (void)gps_query(gpsdata, "?DEVICE={\"device\":%s,\"mode\":0}\r\n", device);
- if (gpsdata->dev.driver_mode != MODE_NMEA) {
+ (void)gps_query(gpsdata, "?DEVICE={\"path\":\"%s\",\"mode\":0}\r\n", device);
+ if ((gpsdata->set & ERR_SET) || (gpsdata->dev.driver_mode != MODE_NMEA)) {
gpsd_report(LOG_ERROR, "%s mode change to NMEA failed\n", gpsdata->dev.path);
status = 1;
} else
gpsd_report(LOG_PROG, "%s mode change succeeded\n", gpsdata->dev.path);
}
else if (to_binary) {
- (void)gps_query(gpsdata, "?DEVICE={\"device\":%s,\"mode\":1}\r\n", device);
- if (gpsdata->dev.driver_mode != MODE_BINARY) {
+ (void)gps_query(gpsdata, "?DEVICE={\"path\":\"%s\",\"mode\":1}\r\n", device);
+ if ((gpsdata->set & ERR_SET) || (gpsdata->dev.driver_mode != MODE_BINARY)) {
gpsd_report(LOG_ERROR, "%s mode change to native mode failed\n", gpsdata->dev.path);
status = 1;
} else