1*7eac9e22SMatthias Ringwald# BTstack Port for POSIX Systems with Intel Wireless 8260/8265 Controllers 2*7eac9e22SMatthias Ringwald 3*7eac9e22SMatthias RingwaldSame as port/libusb, but customized for Intel Wireless 8260 and 8265 Controllers. 4*7eac9e22SMatthias RingwaldThese controller require firmware upload and configuration to work. Firmware and config is downloaded from the Linux firmware repository. 5*7eac9e22SMatthias Ringwald 6*7eac9e22SMatthias Ringwald## Compilation 7*7eac9e22SMatthias Ringwald 8*7eac9e22SMatthias RingwaldRequirements: 9*7eac9e22SMatthias Ringwald- [pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config/) 10*7eac9e22SMatthias Ringwald- [libusb-1.0](http://libusb.info) 11*7eac9e22SMatthias Ringwald 12*7eac9e22SMatthias RingwaldOn a recent Debian-based system, all you need is: 13*7eac9e22SMatthias Ringwald 14*7eac9e22SMatthias Ringwald apt-get install gcc git libusb-1.0 pkg-config 15*7eac9e22SMatthias Ringwald 16*7eac9e22SMatthias Ringwald 17*7eac9e22SMatthias RingwaldWhen everything is ready, you compile all examples with: 18*7eac9e22SMatthias Ringwald 19*7eac9e22SMatthias Ringwald make 20*7eac9e22SMatthias Ringwald 21*7eac9e22SMatthias Ringwald## Environment 22*7eac9e22SMatthias Ringwald 23*7eac9e22SMatthias RingwaldOn Linux, the USB Bluetooth dongle is usually not accessible to a regular user. You can either: 24*7eac9e22SMatthias Ringwald- run the examples as root 25*7eac9e22SMatthias Ringwald- add a udev rule for your dongle to extend access rights to user processes 26*7eac9e22SMatthias Ringwald 27*7eac9e22SMatthias RingwaldTo add an udev rule, please create `/etc/udev/rules.d/btstack.rules` and add this 28*7eac9e22SMatthias Ringwald 29*7eac9e22SMatthias Ringwald # Match all devices from CSR 30*7eac9e22SMatthias Ringwald SUBSYSTEM=="usb", ATTRS{idVendor}=="0a12", MODE="0666" 31*7eac9e22SMatthias Ringwald 32*7eac9e22SMatthias Ringwald # Match DeLOCK Bluetooth 4.0 dongle 33*7eac9e22SMatthias Ringwald SUBSYSTEM=="usb", ATTRS{idVendor}=="0a5c", ATTRS{device}=="21e8", MODE="0666" 34*7eac9e22SMatthias Ringwald 35*7eac9e22SMatthias Ringwald # Match Asus BT400 36*7eac9e22SMatthias Ringwald SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", ATTRS{device}=="17cb", MODE="0666" 37*7eac9e22SMatthias Ringwald 38*7eac9e22SMatthias Ringwald # Match Laird BT860 / Cypress Semiconductor CYW20704A2 39*7eac9e22SMatthias Ringwald SUBSYSTEM=="usb", ATTRS{idVendor}=="04b4", ATTRS{device}=="f901", MODE="0666" 40*7eac9e22SMatthias Ringwald 41*7eac9e22SMatthias Ringwald # Match Intel Wireless 8260 8265 42*7eac9e22SMatthias Ringwald SUBSYSTEM=="usb", ATTRS{idVendor}=="8027", ATTRS{device}=="0a2b, MODE="0666" 43*7eac9e22SMatthias Ringwald 44*7eac9e22SMatthias RingwaldOn macOS, the OS will try to use a plugged-in Bluetooth Controller if one is available. 45*7eac9e22SMatthias RingwaldIt's best to to tell the OS to always use the internal Bluetooth Contoller. 46*7eac9e22SMatthias Ringwald 47*7eac9e22SMatthias RingwaldFor this, execute: 48*7eac9e22SMatthias Ringwald 49*7eac9e22SMatthias Ringwald sudo nvram bluetoothHostControllerSwitchBehavior=never 50*7eac9e22SMatthias Ringwald 51*7eac9e22SMatthias Ringwaldand then reboot to activate the change. 52*7eac9e22SMatthias Ringwald 53*7eac9e22SMatthias Ringwald## Running the examples 54*7eac9e22SMatthias Ringwald 55*7eac9e22SMatthias RingwaldBTstack's HCI USB transport will try to find a suitable Bluetooth module and use it. 56*7eac9e22SMatthias Ringwald 57*7eac9e22SMatthias 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. 58*7eac9e22SMatthias Ringwald 59*7eac9e22SMatthias Ringwald $ ./le_counter 60*7eac9e22SMatthias Ringwald Packet Log: /tmp/hci_dump.pklg 61*7eac9e22SMatthias Ringwald USB Path: 03-01-04-03 62*7eac9e22SMatthias Ringwald Firwmare ./ibt-12-16.sfi 63*7eac9e22SMatthias Ringwald Firmware upload complete 64*7eac9e22SMatthias Ringwald Firmware operational 65*7eac9e22SMatthias Ringwald Done 1 66*7eac9e22SMatthias Ringwald BTstack counter 0001 67*7eac9e22SMatthias Ringwald USB Path: 03-01-04-03 68*7eac9e22SMatthias RingwaldBTstack up and running on F8:34:41:D5:BE:6F. 69*7eac9e22SMatthias Ringwald 70*7eac9e22SMatthias RingwaldIf you want to run multiple examples at the same time, it helps to fix the path to the used Bluetooth module by passing -u usb-path to the executable. 71*7eac9e22SMatthias Ringwald 72*7eac9e22SMatthias RingwaldExample running le_streamer and le_streamer_client in two processes, using Bluetooth dongles at USB path 6 and 4: 73*7eac9e22SMatthias Ringwald 74*7eac9e22SMatthias Ringwald ./le_streamer -u 6 75*7eac9e22SMatthias Ringwald Specified USB Path: 06 76*7eac9e22SMatthias Ringwald Packet Log: /tmp/hci_dump_6.pklg 77*7eac9e22SMatthias Ringwald USB Path: 06 78*7eac9e22SMatthias Ringwald BTstack up and running on 00:1A:7D:DA:71:13. 79*7eac9e22SMatthias Ringwald To start the streaming, please run the le_streamer_client example on other device, or use some GATT Explorer, e.g. LightBlue, BLExplr. 80*7eac9e22SMatthias Ringwald 81*7eac9e22SMatthias Ringwald $ ./le_streamer_client -u 4 82*7eac9e22SMatthias Ringwald Specified USB Path: 04 83*7eac9e22SMatthias Ringwald Packet Log: /tmp/hci_dump_4.pklg 84*7eac9e22SMatthias Ringwald USB Path: 04 85*7eac9e22SMatthias Ringwald BTstack up and running on 00:1A:7D:DA:71:13. 86*7eac9e22SMatthias Ringwald Start scanning! 87