1*4953c773SMatthias Ringwald# BTstack Port for QT with H4 Bluetooth Controller 2*4953c773SMatthias Ringwald 3*4953c773SMatthias RingwaldUses libusb Library on macOS and Linux and WinUSB on Windows. 4*4953c773SMatthias RingwaldWindows is supported with the MinGW Kit. 5*4953c773SMatthias Ringwald 6*4953c773SMatthias RingwaldWindows with MSVC or Embedded (bare metal) platforms not supported yet. 7*4953c773SMatthias Ringwald 8*4953c773SMatthias Ringwald## Configuration 9*4953c773SMatthias Ringwald 10*4953c773SMatthias 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: 11*4953c773SMatthias Ringwald 12*4953c773SMatthias Ringwald## TI CC256x 13*4953c773SMatthias RingwaldThe CC2564x needs the correct init script to start up. The Makfile already has entries for most silicon revisions: 14*4953c773SMatthias Ringwald 15*4953c773SMatthias Ringwald- CC2560: bluetooth_init_cc2564_2.14.c 16*4953c773SMatthias Ringwald- CC2564B: bluetooth_init_cc2564B_1.6_BT_Spec_4.1. 17*4953c773SMatthias Ringwald- CC2564C: bluetooth_init_cc2564C_1.3.c 18*4953c773SMatthias Ringwald 19*4953c773SMatthias RingwaldPlease pick the correct one. The main.c verifies that the correct script is loaded, but the init script is linked to the executable. 20*4953c773SMatthias Ringwald 21*4953c773SMatthias Ringwald## Broadcom BCM/CYW 43430 22*4953c773SMatthias Ringwald 23*4953c773SMatthias 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. 24*4953c773SMatthias Ringwald 25*4953c773SMatthias Ringwald## Compilation 26*4953c773SMatthias Ringwald 27*4953c773SMatthias RingwaldOn all platforms, you'll need Qt Python 3 installed. 28*4953c773SMatthias RingwaldOn macOS/Linux [libusb-1.0](http://libusb.info) or higher is required, too. 29*4953c773SMatthias Ringwald 30*4953c773SMatthias RingwaldWhen everything is ready, you can open the provided CMakelists.txt project in Qt Creator and run any of the provided examples. 31*4953c773SMatthias RingwaldSee Qt documentation on how to compile on the command line or with other IDEs 32*4953c773SMatthias Ringwald 33*4953c773SMatthias Ringwald 34*4953c773SMatthias Ringwald## Running the examples 35*4953c773SMatthias Ringwald 36*4953c773SMatthias RingwaldBTstack's HCI USB transport will try to find a suitable Bluetooth module and use it. 37*4953c773SMatthias Ringwald 38*4953c773SMatthias 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. 39*4953c773SMatthias Ringwald 40*4953c773SMatthias Ringwald $ ./le_counter 41*4953c773SMatthias Ringwald Packet Log: /tmp/hci_dump.pklg 42*4953c773SMatthias Ringwald BTstack counter 0001 43*4953c773SMatthias Ringwald USB Path: 06 44*4953c773SMatthias Ringwald BTstack up and running on 00:1A:7D:DA:71:13. 45*4953c773SMatthias Ringwald 46