summaryrefslogtreecommitdiff
path: root/gpsctl.c
diff options
context:
space:
mode:
authorJohn Klug <John.Klug@multitech.com>2017-03-06 20:57:10 +0000
committerFred Wright <fw@fwright.net>2017-03-17 15:24:37 -0700
commit02d31b09c4e85942c23ef8de52bbaa1240286d9c (patch)
treec005255e279df2030d3d895617308c2084665db9 /gpsctl.c
parentda6175a230865d6492de1bbad226ff1e00f6979c (diff)
downloadgpsd-02d31b09c4e85942c23ef8de52bbaa1240286d9c.tar.gz
Fixes spurious error message from gpsctl -e.
Prevent message: (null) identified as a unknown, at 0 baud. which occurs in the control stream when the output is stdout (-c option).
Diffstat (limited to 'gpsctl.c')
-rw-r--r--gpsctl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gpsctl.c b/gpsctl.c
index 69d5e932..756f7081 100644
--- a/gpsctl.c
+++ b/gpsctl.c
@@ -195,6 +195,7 @@ int main(int argc, char **argv)
char *device = NULL, *devtype = NULL;
char *speed = NULL, *control = NULL, *rate = NULL;
bool to_binary = false, to_nmea = false, reset = false;
+ bool control_stdout = false;
bool lowlevel=false, echo=false;
struct gps_data_t gpsdata;
const struct gps_type_t *forcetype = NULL;
@@ -236,6 +237,7 @@ int main(int argc, char **argv)
break;
case 'e': /* echo specified control string with wrapper */
lowlevel = true;
+ control_stdout = true; /* Prevent message going to stdout */
echo = true;
break;
case 'f': /* force direct access to the device */
@@ -723,9 +725,10 @@ int main(int argc, char **argv)
}
}
- (void)printf("%s identified as a %s at %u baud.\n",
- device, gpsd_id(&session),
- session.gpsdata.dev.baudrate);
+ if(!control_stdout)
+ (void)printf("%s identified as a %s at %u baud.\n",
+ device, gpsd_id(&session),
+ session.gpsdata.dev.baudrate);
/* if no control operation was specified, we're done */
if (speed==NULL && !to_nmea && !to_binary && control==NULL)