0

I'm using the CoreBluetooth framework to have my Mac act as a BLE Central, to scan for, connect to, and exchange data with a nearby IoT BLE Peripheral.

I haven't found an API for enumerating adapters (e.g. an external USB BLE peripheral with its own antenna). Is there a way to programmatically enumerate and select a BLE adapter before my program starts scanning and connecting to a BLE peripheral?

I can restrict the solution space to macOS Sonoma and the latest SDK versions on that OS, if that's helpful. No backwards compatibility support is required.

1
  • Unsure why I'm getting close votes here; The question is on-topic and clear enough to get an equally-clear and correct answer. Commented Jul 11 at 15:35

1 Answer 1

1

Unfortunately there isn't API for selecting the Bluetooth adapter through iOS/MacOS app, at least not through CoreBluetooth. You can check the IOBluetoothHostController API in the IOBluetooth framework as it might help you achieve what you want, but I couldn't find any examples or tutorials on how to use it to select the Bluetooth adapter. Your best bet would probably be to select the Bluetooth adapter through the OS. CoreBluetooth is designed to work with the OS-selected adapter so this should work. Have a look at the links below for selecting the adapter through the OS:-

Not the answer you're looking for? Browse other questions tagged or ask your own question.