Hello,
I am working on a project that accesses Bluetooth hardware by its hci number. My Raspberry Pis have an internal bluetooth chip, which comes up as hci0
:
root@2165xxx:/app# hciconfig -a
hci0: Type: Primary Bus: UART
BD Address: DC:A6:32:C3:xx:xx ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING
[...]
Manufacturer: Cypress Semiconductor Corporation (305)
if I plug in a USB bluetooth dongle after the Pi has booted, it shows up as hci1
:
root@2165xxx:/app# hciconfig -a
hci1: Type: Primary Bus: USB
BD Address: 00:01:95:62:xx:xx ACL MTU: 310:10 SCO MTU: 64:8
[...]
Manufacturer: Cambridge Silicon Radio (10)
hci0: Type: Primary Bus: UART
BD Address: DC:A6:32:C3:xx:xx ACL MTU: 1021:8 SCO MTU: 64:1
[...]
Manufacturer: Cypress Semiconductor Corporation (305)
BUT, if the Pi boots with the USB bluetooth dongle already connected, the hci assignment seems to switch so that the USB device is hci0
and the internal chip is hci1
:
root@2165xxx:/app# hciconfig -a
hci1: Type: Primary Bus: UART
BD Address: DC:A6:32:C3:xx:xx ACL MTU: 1021:8 SCO MTU: 64:1
[...]
Manufacturer: Cypress Semiconductor Corporation (305)
hci0: Type: Primary Bus: USB
BD Address: 00:01:95:62:xx:xx ACL MTU: 310:10 SCO MTU: 64:8
[...]
Manufacturer: Cambridge Silicon Radio (10)
this assignment persists even if the USB device is disconnected, until the next reboot (and then it depends if the USB device is plugged in or not).
Is this a bug in the kernel somewhere? It seems like the internal hardware should always be hci0
, and then externally-connected devices should get assigned starting at hci1
.
I could probably work around this issue if there was a way for me to a) list connected BT chips from inside my app and b) enable/disable each from inside my app.