如何检查配对的蓝牙设备在黑莓手机中是否可用?
我遇到以下问题: 我需要检查是否存在通过蓝牙配对的设备并且是否可以进行通信。 当我从 DiscoveryAgent 启动 startInquiry 方法时,它会检索所有可用设备而无需配对,
感谢您的帮助
I faced following issue:
I need to check is the paired device via Bluetooth present and availbale to communicate.
When I start startInquiry method from DiscoveryAgent, it retrieves all available devices without paired ones
thanks for any help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一个黑客解决方案是为该配对设备启动 DiscoveryAgent.searchServices() ,如果您没有获得任何服务,那么您可以说该设备不可用于通信。
A hackish solution would be to start DiscoveryAgent.searchServices() for that paired device and if you don't get even a single service then you can say that the device is not available for communication.
方法
BluetoothSerialPort.getSerialPortInfo
仅返回配对的设备。The method
BluetoothSerialPort.getSerialPortInfo
returns only the paired devices.