xref: /btstack/port/libusb/README.md (revision 304b2f4d7e690d7723175252ac3de3f393e7cb65)
1*304b2f4dSMatthias Ringwald# BTstack Port for POSIX Systems with libusb library
2*304b2f4dSMatthias Ringwald
3*304b2f4dSMatthias RingwaldThe quickest way to try BTstack is on a Linux or OS X system with an
4*304b2f4dSMatthias Ringwaldadditional USB Bluetooth dongle. It requires
5*304b2f4dSMatthias Ringwald[pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config/)
6*304b2f4dSMatthias Ringwaldand [libusb-1.0](http://libusb.info) or higher to be
7*304b2f4dSMatthias Ringwaldinstalled.
8*304b2f4dSMatthias Ringwald
9*304b2f4dSMatthias RingwaldOn Linux, the USB Bluetooth donle is usually not accessible to a regular user. You can:
10*304b2f4dSMatthias Ringwald- run the examples as root
11*304b2f4dSMatthias Ringwald- add a udev rule for your dongle to extend access rights to user processes
12*304b2f4dSMatthias Ringwald
13*304b2f4dSMatthias RingwaldTo add an udev rule, please create `/etc/udev/rules.d/btstack.rules` and add this
14*304b2f4dSMatthias Ringwald
15*304b2f4dSMatthias Ringwald	# Match all devices from CSR
16*304b2f4dSMatthias Ringwald	SUBSYSTEM=="usb", ATTRS{idVendor}=="0a12", MODE="0666"
17*304b2f4dSMatthias Ringwald
18*304b2f4dSMatthias Ringwald	# Match DeLOCK Bluetooth 4.0 dongle
19*304b2f4dSMatthias Ringwald	SUBSYSTEM=="usb", ATTRS{idVendor}=="0a5c", ATTRS{device}=="21e8", MODE="0666"
20*304b2f4dSMatthias Ringwald
21*304b2f4dSMatthias Ringwald	# Match Asus BT400
22*304b2f4dSMatthias Ringwald	SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", ATTRS{device}=="17cb", MODE="0666"
23*304b2f4dSMatthias Ringwald
24*304b2f4dSMatthias RingwaldOn OS X, it’s necessary to tell the OS to only use the internal
25*304b2f4dSMatthias RingwaldBluetooth. For this, execute:
26*304b2f4dSMatthias Ringwald
27*304b2f4dSMatthias Ringwald    sudo nvram bluetoothHostControllerSwitchBehavior=never
28*304b2f4dSMatthias Ringwald
29*304b2f4dSMatthias RingwaldYou may need to reboot for the change to become active.
30