1HCI BRIDGE 2========== 3 4This tool acts as a simple bridge between two HCI transports, with a host on one side and 5a controller on the other. All the HCI packets bridged between the two are printed on the console 6for logging. This bridge also has the ability to short-circuit some HCI packets (respond to them 7with a fixed response instead of bridging them to the other side), which may be useful when used with 8a host that send custom HCI commands that the controller may not understand. 9 10 11!!! info "Running the HCI bridge tool" 12 ``` 13 python hci_bridge.py <host-transport-spec> <controller-transport-spec> [command-short-circuit-list] 14 ``` 15 The command-short-circuit-list field is specified by a series of comma separated Opcode Group 16 Field (OGF) : OpCode Command Field (OCF) pairs. The OGF/OCF values are specified in the Blutooth 17 core specification. 18 19 For the commands that are listed in the short-circuit-list, the HCI bridge will always generate 20 a Command Complete Event for the specified op code. The return parameter will be HCI_SUCCESS. 21 22 This feature can only be used for commands that return Command Complete. Other events will not be 23 generated by the HCI bridge tool. 24 25!!! example "UDP to Serial" 26 ``` 27 python hci_bridge.py udp:0.0.0.0:9000,127.0.0.1:9001 serial:/dev/tty.usbmodem0006839912171,1000000 0x3f:0x0070,0x3f:0x0074,0x3f:0x0077,0x3f:0x0078 28 ``` 29 30 In this example, the short circuit list is specified to respond to the Vendor-specific Opcode Group 31 Field (0x3f) commands 0x70, 0x74, 0x77, 0x78 with Command Complete. The short circuit list can be 32 used where the Host uses some HCI commands that are not supported/implemented by the Controller. 33 34!!! example "PTY to Link Relay" 35 ``` 36 python hci_bridge.py serial:emulated_uart_pty,1000000 link-relay:ws://127.0.0.1:10723/test 37 ``` 38 39 In this example, an emulator that exposes a PTY as an interface to its HCI UART is running as 40 a Bluetooth host, and we are connecting it to a virtual controller attached to a link relay 41 (through which the communication with other virtual controllers will be mediated). 42 43 NOTE: this assumes you're running a Link Relay on port `10723`. 44 45