diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2014-01-03 22:43:05 -0800 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-01-03 22:43:05 -0800 |
commit | 4f72c38007343612d4a074d4f4c3997c2c8ab724 (patch) | |
tree | e31ae80107408fb018f69dbe0e8c53e6356e9f73 /monitor/main.c | |
parent | 4b31ab4e37977cde5953b1b734677a375b8d90fc (diff) | |
download | bluez-4f72c38007343612d4a074d4f4c3997c2c8ab724.tar.gz |
monitor: Add support for Ellisys HCI Injection
Diffstat (limited to 'monitor/main.c')
-rw-r--r-- | monitor/main.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/monitor/main.c b/monitor/main.c index aed9b03e5..83c99aa54 100644 --- a/monitor/main.c +++ b/monitor/main.c @@ -34,6 +34,7 @@ #include "mainloop.h" #include "packet.h" +#include "ellisys.h" #include "control.h" static void signal_callback(int signum, void *user_data) @@ -59,6 +60,7 @@ static void usage(void) "\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" + "\t-E, --ellisys [ip] Send Ellisys HCI Injection\n" "\t-h, --help Show help options\n"); } @@ -70,6 +72,7 @@ static const struct option main_options[] = { { "time", no_argument, NULL, 't' }, { "date", no_argument, NULL, 'T' }, { "sco", no_argument, NULL, 'S' }, + { "ellisys", required_argument, NULL, 'E' }, { "todo", no_argument, NULL, '#' }, { "version", no_argument, NULL, 'v' }, { "help", no_argument, NULL, 'h' }, @@ -79,7 +82,10 @@ static const struct option main_options[] = { int main(int argc, char *argv[]) { unsigned long filter_mask = 0; - const char *str, *reader_path = NULL, *writer_path = NULL; + const char *reader_path = NULL, *writer_path = NULL; + const char *ellisys_server = NULL; + unsigned short ellisys_port = 0; + const char *str; sigset_t mask; mainloop_init(); @@ -89,7 +95,7 @@ int main(int argc, char *argv[]) for (;;) { int opt; - opt = getopt_long(argc, argv, "r:w:s:i:tTSvh", + opt = getopt_long(argc, argv, "r:w:s:i:tTSE:vh", main_options, NULL); if (opt < 0) break; @@ -127,6 +133,10 @@ int main(int argc, char *argv[]) case 'S': filter_mask |= PACKET_FILTER_SHOW_SCO_DATA; break; + case 'E': + ellisys_server = optarg; + ellisys_port = 24352; + break; case '#': packet_todo(); return EXIT_SUCCESS; @@ -157,6 +167,9 @@ int main(int argc, char *argv[]) packet_set_filter(filter_mask); if (reader_path) { + if (ellisys_server) + ellisys_enable(ellisys_server, ellisys_port); + control_reader(reader_path); return EXIT_SUCCESS; } @@ -164,6 +177,9 @@ int main(int argc, char *argv[]) if (writer_path) control_writer(writer_path); + if (ellisys_server) + ellisys_enable(ellisys_server, ellisys_port); + if (control_tracing() < 0) return EXIT_FAILURE; |