posix-h4: allow to specify h4 device with -u option

This commit is contained in:
Matthias Ringwald 2017-08-23 22:21:23 +02:00
parent 5ddac27281
commit c5ee5b328f

View File

@ -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);