Possible Framework and API to get list of registered bluetooth audio (A2DP) devices?

Hi all,


Not sure this has been asked before or even possible, but I tried to do some googling for this and couldn't find a whole lot of cohesive information on this so I thought I'd go to the source.


I am thinking of building a nice simple app that would present a centrallized list of all bluetooth audio devices across my iPad, iPhone, and MacBook Pro and indicate which audio device was paired to which specific iOS or MacOS device. While I like the new disconnect functionality in iOS 9, I sometimes have a device (like a pair of Beat's headphones) that like to pair with a specific device by default and I'd like to have it paired with a different iOS (or Mac OS) device. While I can do this by switching and repairing the headphones manually, I think it would be simpler and more efficient to unpair and and re-pair the headphones from a single UI rather than having to work between an iPhone and my Macbook. For example sometimes my Beats headphones like to pair with my iPad which could be inside the house while I'm outside doing some work and want to listen to music. To switch I have to hunt down the iPad, disconnect the headphones and then connect to the iPhone. I'd really like to have this all done from a single app (or settings panel) that would allow me to simply switch the device to what ever audio source I'd like to to use.

Is there a common Framework and API to get a list of all bluetooth audio devices similar to what's shown in the Bluetooth Settings panel? I'm just assuming that this is only exposed through the Bluetooth Manager private framework and I don't want to violate the contract by creating an App that uses this. As I understand, the CoreBluetooth framework seems targeted to BLE only devices, and that the ExternalAccessory framework is only for MFi devices. I also researched the AVFoundation APIs and see that these only seem to show the current paired device and the built-in speaker/microphone.

If this isn't possible, is there some place I could request this as a feature? It would really make managing differnet audio devices much easier from a single UI from one device.

Regards,

Rick

Hi!


Have you had success with your project?


I am trying to do something similar to your project but I am not able to list all of the paired A2DP devices nor can I connect to one of them within an iOS app. When using the iOS system bluetooth settings, pairing, connecting & disconnecting works without any problems.

It's possible to get at list of attached audio devices from the AudioSession (kAudioSessionProperty_InputSources and kAudioSessionProperty_OutputDestinations).


Your app would not be able to unpair the audio device from iOS. Devices are owned by the system, not apps.

Thanks for your reply!


I tried around with the AudioSession also. But actually I wasn't able to find paired audio devices. It only was possible to list the audio devices that were already connected. Does it work for you to show all devices, even the only paired once (so when they are not connected)? And are you able to connect to them also?

You will only be able to get a list of connected devices. The system will not supply the app with a list of paired devices.

I would look into the IOBluetooth API. It defines a IOBluetoothDeviceInquiry object that finds all bluetooth devices within range.


The downside:


IOBluetooth framework is only available on MacOS.


https://developer.apple.com/documentation/iobluetooth


The iOS framework for CoreBluetooth might be of some assistance but from my experience it is a high level API with little to no ability to commicate with the kernel.


https://developer.apple.com/documentation/corebluetooth

Possible Framework and API to get list of registered bluetooth audio (A2DP) devices?
 
 
Q