使用私有iOS BluetoothManager框架进行设备配对

时间:2011-12-08 21:30:07

标签: iphone ios bluetooth iphone-privateapi

我一直在使用iOS 5.0中的私有BluetoothManager框架,我已经能够成功启动/停止蓝牙并获取设备列表,但我无法弄清楚如何启动配对。

我最接近的是尝试连接:

[[BluetoothManager sharedInstance] connectDevice:dev];

其中 dev 是扫描期间发现的BluetoothDevice对象。

这似乎试图配对(当我尝试连接到我的iMac时,配对对话框会暂时出现),但很快就会失败。

我注意到BluetoothManager.h包含一个 BTPairingAgentImpl 结构,这可能有所帮助,但我不知道这个结构包含什么或如何使用它。

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

正确的方法是获取一个BluetoothDevice对象(参见BluetoothDevice.h)并使用其方法:配对,连接等。