I want my program to behave differently if a specific bluetooth headset is "connected" to the system. By "connected" I mean that it is:
- paired with the system
- appears on a list of audio output in Settings (not necessarily selected as default output)
- appears on "My Devices" list in Bluetooth preference pane with "Connected" status.
I want this to determine "availability" of the device, i.e. likehood that establishing an active connection will succeed.
Apparently IOBluetooth does not offer API to easily achieve this... I've tried:
[IOBluetooth pairedDevices]
to iterate though paired device list. This one correctly returns IOBluetoothDevice
object representing my device.
When I call [IOBluetoothDevice isConnected]
it returns false even though device is listed as "connected" on My Devices list in Bluetooth settings.
If I leave the headset at original place, go with my mac to a physically different location and call getLastInqiuryUpdate
or recentAccessDate
, both return current time, even though the headset is not in range for several days now.
So I'm looking to determine the headset "connected" state the same way Bluetooth Settings pane does it and without making an active connection attempt.