xref: /btstack/port/libusb/README.md (revision c75587468f82e2f5711bc0f0cceb7c8196f66d85)
1304b2f4dSMatthias Ringwald# BTstack Port for POSIX Systems with libusb library
2304b2f4dSMatthias Ringwald
3304b2f4dSMatthias RingwaldThe quickest way to try BTstack is on a Linux or OS X system with an
4304b2f4dSMatthias Ringwaldadditional USB Bluetooth dongle. It requires
5304b2f4dSMatthias Ringwald[pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config/)
6304b2f4dSMatthias Ringwaldand [libusb-1.0](http://libusb.info) or higher to be
7304b2f4dSMatthias Ringwaldinstalled.
8304b2f4dSMatthias Ringwald
9304b2f4dSMatthias RingwaldOn Linux, the USB Bluetooth donle is usually not accessible to a regular user. You can:
10304b2f4dSMatthias Ringwald- run the examples as root
11304b2f4dSMatthias Ringwald- add a udev rule for your dongle to extend access rights to user processes
12304b2f4dSMatthias Ringwald
13304b2f4dSMatthias RingwaldTo add an udev rule, please create `/etc/udev/rules.d/btstack.rules` and add this
14304b2f4dSMatthias Ringwald
15304b2f4dSMatthias Ringwald	# Match all devices from CSR
16304b2f4dSMatthias Ringwald	SUBSYSTEM=="usb", ATTRS{idVendor}=="0a12", MODE="0666"
17304b2f4dSMatthias Ringwald
18304b2f4dSMatthias Ringwald	# Match DeLOCK Bluetooth 4.0 dongle
19304b2f4dSMatthias Ringwald	SUBSYSTEM=="usb", ATTRS{idVendor}=="0a5c", ATTRS{device}=="21e8", MODE="0666"
20304b2f4dSMatthias Ringwald
21304b2f4dSMatthias Ringwald	# Match Asus BT400
22304b2f4dSMatthias Ringwald	SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", ATTRS{device}=="17cb", MODE="0666"
23304b2f4dSMatthias Ringwald
24304b2f4dSMatthias RingwaldOn OS X, it’s necessary to tell the OS to only use the internal
25304b2f4dSMatthias RingwaldBluetooth. For this, execute:
26304b2f4dSMatthias Ringwald
27304b2f4dSMatthias Ringwald    sudo nvram bluetoothHostControllerSwitchBehavior=never
28304b2f4dSMatthias Ringwald
29*c7558746SMatthias Ringwaldand then reboot to activate the change.
30*c7558746SMatthias Ringwald
31