From c5ee5b328f8ee6a31468e76b2ee869096f4af188 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Wed, 23 Aug 2017 22:21:23 +0200 Subject: [PATCH] posix-h4: allow to specify h4 device with -u option --- port/posix-h4/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/port/posix-h4/main.c b/port/posix-h4/main.c index f0efe20ed..819927579 100644 --- a/port/posix-h4/main.c +++ b/port/posix-h4/main.c @@ -221,6 +221,14 @@ int main(int argc, const char * argv[]){ // config.device_name = "/dev/tty.usbserial-A9OVNX5P"; // RedBear IoT pHAT breakout board config.device_name = "/dev/tty.usbserial-A900K0VK"; // CSR8811 breakout board + // accept path from command line + if (argc >= 3 && strcmp(argv[1], "-u") == 0){ + config.device_name = argv[2]; + argc -= 2; + memmove(&argv[0], &argv[2], argc * sizeof(char *)); + } + printf("H4 device: %s\n", config.device_name); + // init HCI const btstack_uart_block_t * uart_driver = btstack_uart_block_posix_instance(); const hci_transport_t * transport = hci_transport_h4_instance(uart_driver);