I've been messing around with the private BluetoothManager framework in iOS 5.0 and I've been able to successfully start/stop Bluetooth and get a list of devices, however I can't figure out how to initiate pairing.
The closest I've come is to try to connect using:
[[BluetoothManager sharedInstance] connectDevice:dev];
where dev is a BluetoothDevice object discovered during scanning.
This seems to attempt to pair (when I try to connect to my iMac, the pairing dialog appears for a split second), but then quickly fails.
I've noticed that the BluetoothManager.h includes a BTPairingAgentImpl struct which might help, but I have no idea of what this struct includes or how to use it.
Any help would be greatly appreciated.
这样做的正确方法是获取BluetoothDevice对象(请参阅BluetoothDevice.h)并使用其方法:配对,连接等。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.