14953c773SMatthias Ringwald# BTstack Port for QT with H4 Bluetooth Controller 24953c773SMatthias Ringwald 34953c773SMatthias RingwaldUses libusb Library on macOS and Linux and WinUSB on Windows. 44953c773SMatthias RingwaldWindows is supported with the MinGW Kit. 54953c773SMatthias Ringwald 64953c773SMatthias RingwaldWindows with MSVC or Embedded (bare metal) platforms not supported yet. 74953c773SMatthias Ringwald 84953c773SMatthias Ringwald## Configuration 94953c773SMatthias Ringwald 104953c773SMatthias RingwaldMost Bluetooth Bluetooth Controllers connected via UART/H4 require some special configuration, e.g. to set the UART baud rate, and/or require firmware patches during startup. In this port, we've tried to do most of these automatically based on information gathered from the Bluetooth Controller. Here's some Controller specific details: 114953c773SMatthias Ringwald 124953c773SMatthias Ringwald## TI CC256x 134953c773SMatthias RingwaldThe CC2564x needs the correct init script to start up. The Makfile already has entries for most silicon revisions: 144953c773SMatthias Ringwald 154953c773SMatthias Ringwald- CC2560: bluetooth_init_cc2564_2.14.c 16f2eb0907SMatthias Ringwald- CC2564B: bluetooth_init_cc2564B_1.8_BT_Spec_4.1.c 17*01f72e3dSMatthias Ringwald- CC2564C: bluetooth_init_cc2564C_1.5.c 184953c773SMatthias Ringwald 194953c773SMatthias RingwaldPlease pick the correct one. The main.c verifies that the correct script is loaded, but the init script is linked to the executable. 204953c773SMatthias Ringwald 214953c773SMatthias Ringwald## Broadcom BCM/CYW 43430 224953c773SMatthias Ringwald 234953c773SMatthias RingwaldThe correct firmware file needs to be provided in the current working directory. The Makefile downloads the one for the BCM43430 e.g. found on later Raspberry Pi editions. Please see the separate port/raspi, too. 244953c773SMatthias Ringwald 254953c773SMatthias Ringwald## Compilation 264953c773SMatthias Ringwald 274953c773SMatthias RingwaldOn all platforms, you'll need Qt Python 3 installed. 284953c773SMatthias RingwaldOn macOS/Linux [libusb-1.0](http://libusb.info) or higher is required, too. 294953c773SMatthias Ringwald 304953c773SMatthias RingwaldWhen everything is ready, you can open the provided CMakelists.txt project in Qt Creator and run any of the provided examples. 314953c773SMatthias RingwaldSee Qt documentation on how to compile on the command line or with other IDEs 324953c773SMatthias Ringwald 334953c773SMatthias Ringwald 344953c773SMatthias Ringwald## Running the examples 354953c773SMatthias Ringwald 364953c773SMatthias RingwaldBTstack's HCI USB transport will try to find a suitable Bluetooth module and use it. 374953c773SMatthias Ringwald 384953c773SMatthias RingwaldOn start, BTstack will try to find a suitable Bluetooth module. It will also print the path to the packet log as well as the USB path. 394953c773SMatthias Ringwald 404953c773SMatthias Ringwald $ ./le_counter 414953c773SMatthias Ringwald Packet Log: /tmp/hci_dump.pklg 424953c773SMatthias Ringwald BTstack counter 0001 434953c773SMatthias Ringwald USB Path: 06 444953c773SMatthias Ringwald BTstack up and running on 00:1A:7D:DA:71:13. 454953c773SMatthias Ringwald 46