iOS 蓝牙管理器框架
我知道 BluetoothManager 框架 是私有 API 的一部分,但我很好奇是否有人有使用它的经验。
我可以打开和关闭蓝牙,但我想获取设备列表。
调用 pairedDevices
方法似乎将我需要的所有信息写入日志,但不返回设备数组。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过注册已发现设备的通知,然后触发发现本身来获取设备列表。传入的通知对象实际上是一个 BluetoothDevice 对象,您可以使用它来提取远程设备的名称和地址。此结构中没有内置 RSSI 数据。我为 OS 5.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.