问题
I understand the BluetoothManager Framework is part of the private API, but I'm curious if anyone has any experience working with it.
I'm able to turn Bluetooth on and off, but I'd like to get a list of devices.
Calling the pairedDevices
method seems to write all the info I need to the log, but doesn't return an array of devices.
回答1:
You can get the list of devices, by registering a notification for discovered devices, and then triggering the discovery itself. The incoming notification object is actually a BluetoothDevice object, that you can use to extract name and address of the remote device. There is no RSSI data built into this structure. I wrote a complete sample for OS 5.1, drop me a message if you need it.
来源:https://stackoverflow.com/questions/5877879/ios-bluetoothmanager-framework