diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2016-04-27 21:06:54 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2016-04-27 21:11:26 +0300 |
commit | 67e35de97e2a7b940ee52274577df448cffe4e33 (patch) | |
tree | d2c78cfc33d144820e4fc0ae8e76da7b567e1648 /monitor/main.c | |
parent | e0ecf26de207483aa5e8cf797e38eece3098b422 (diff) | |
download | bluez-67e35de97e2a7b940ee52274577df448cffe4e33.tar.gz |
Make use of new tty_get_speed helper
Diffstat (limited to 'monitor/main.c')
-rw-r--r-- | monitor/main.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/monitor/main.c b/monitor/main.c index be3d55e0f..c9041663e 100644 --- a/monitor/main.c +++ b/monitor/main.c @@ -33,6 +33,7 @@ #include <getopt.h> #include "src/shared/mainloop.h" +#include "src/shared/tty.h" #include "packet.h" #include "lmp.h" @@ -99,7 +100,7 @@ int main(int argc, char *argv[]) const char *analyze_path = NULL; const char *ellisys_server = NULL; const char *tty = NULL; - unsigned int tty_speed = 115200; + unsigned int tty_speed = B115200; unsigned short ellisys_port = 0; const char *str; int exit_status; @@ -122,7 +123,11 @@ int main(int argc, char *argv[]) tty= optarg; break; case 'B': - tty_speed = atoi(optarg); + tty_speed = tty_get_speed(atoi(optarg)); + if (!tty_speed) { + fprintf(stderr, "Unknown speed: %s\n", optarg); + return EXIT_FAILURE; + } break; case 'r': reader_path = optarg; |