使用私有 iOS BluetoothManager 框架进行设备配对
我一直在摆弄 iOS 5.0 中的私有蓝牙管理器框架,我已经能够成功启动/停止蓝牙并获取设备列表,但是我不知道如何启动配对。
我最接近的是尝试使用以下方式进行连接:
[[BluetoothManager sharedInstance] connectDevice:dev];
其中 dev 是扫描期间发现的蓝牙设备对象。
这似乎是在尝试配对(当我尝试连接到 iMac 时,配对对话框会瞬间出现),但很快就会失败。
我注意到 BluetoothManager.h 包含一个 BTPairingAgentImpl 结构,这可能会有所帮助,但我不知道该结构包含什么或如何使用它。
任何帮助将不胜感激。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正确的方法是获取一个BluetoothDevice对象(参见BluetoothDevice.h)并使用它的方法:配对、连接等。
The correct way of doing this is getting a BluetoothDevice object (see BluetoothDevice.h) and using its methods: pairing, connect , etc.