Hacker News new | ask | show | jobs
by montecarl 1038 days ago
I an the sole developer of a product that uses bluetooth (classic not BLE) and have struggled so much with bluetooth (documentation and APIs just seem not that helpful or complete or are at such a low level that they aren't useful unless you already know everything), but I will try to give an answer and hopefully if I am wrong someone can educate us.

My understanding is that most bluetooth devices interface with the operating system over a standardized host controller interface (HCI) over a UART or SPI interface. Basically the OS sends some standardized commands to the HCI and receives some data back. This means that the OS doesn't have full control over the radio and are limited in what they can do to a set of standardized commands[1]. For example, even if you monitor everything that OS sends/receives over this HCI channel (using, e.g. btmon on Linux) you will not see everything that is going on.

For example, with bluetooth classic, during inquiry (discovering pairable devices) you don't really see all the details of what the device is doing. The hardware doesn't seem to signal anything about a host devices scanning you and the reply packets that are sent. I was trying to debug some issues with Windows 11 not discovering my device (despite it being in inquiry scan mode and that my phone could see it but not my desktop) and btmon was totally unhelpful in this case and I believe it to be a limitation of how the OS and the bluetooth device communicate at a fundamental level. It turns out the answer to my particular issue was the "class of device" that my device reported wasn't one that Windows 11 will show during pairing.

[1] https://software-dl.ti.com/simplelink/esd/simplelink_cc13x2_...