diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2016-04-22 15:56:09 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2016-04-27 14:09:16 +0300 |
commit | dac899f0ab81dec8127f2ca32f676735bf4691c7 (patch) | |
tree | c378fb1bbe633e3413e190fa0b16fa19c84701c7 /monitor/main.c | |
parent | 1b45686e605de58d35b1c29fefa4950ecf670fa6 (diff) | |
download | bluez-dac899f0ab81dec8127f2ca32f676735bf4691c7.tar.gz |
monitor: Add --tty-speed command line switch
Diffstat (limited to 'monitor/main.c')
-rw-r--r-- | monitor/main.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/monitor/main.c b/monitor/main.c index e1241578c..38e4fc9a1 100644 --- a/monitor/main.c +++ b/monitor/main.c @@ -64,6 +64,7 @@ static void usage(void) "\t-p, --priority <level> Show only priority or lower\n" "\t-i, --index <num> Show only specified controller\n" "\t-d, --tty <tty> Read data from TTY\n" + "\t-B, --tty-speed <rate> Set TTY speed (default 115200)\n" "\t-t, --time Show time instead of time offset\n" "\t-T, --date Show time and date information\n" "\t-S, --sco Dump SCO traffic\n" @@ -73,6 +74,7 @@ static void usage(void) static const struct option main_options[] = { { "tty", required_argument, NULL, 'd' }, + { "tty-speed", required_argument, NULL, 'B' }, { "read", required_argument, NULL, 'r' }, { "write", required_argument, NULL, 'w' }, { "analyze", required_argument, NULL, 'a' }, @@ -96,6 +98,8 @@ int main(int argc, char *argv[]) const char *writer_path = NULL; const char *analyze_path = NULL; const char *ellisys_server = NULL; + const char *tty = NULL; + unsigned int tty_speed = 115200; unsigned short ellisys_port = 0; const char *str; int exit_status; @@ -115,7 +119,10 @@ int main(int argc, char *argv[]) switch (opt) { case 'd': - control_tty(optarg); + tty= optarg; + break; + case 'B': + tty_speed = atoi(optarg); break; case 'r': reader_path = optarg; @@ -217,6 +224,9 @@ int main(int argc, char *argv[]) if (ellisys_server) ellisys_enable(ellisys_server, ellisys_port); + if (tty) + control_tty(tty, tty_speed); + if (control_tracing() < 0) return EXIT_FAILURE; |