diff options
author | John Klug <John.Klug@multitech.com> | 2017-03-06 20:57:10 +0000 |
---|---|---|
committer | Fred Wright <fw@fwright.net> | 2017-03-17 15:24:37 -0700 |
commit | 02d31b09c4e85942c23ef8de52bbaa1240286d9c (patch) | |
tree | c005255e279df2030d3d895617308c2084665db9 /gpsctl.c | |
parent | da6175a230865d6492de1bbad226ff1e00f6979c (diff) | |
download | gpsd-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.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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) |