在 Android 中定位已知的蓝牙设备
我有一个已知蓝牙设备地址的列表,并且想知道哪些地址在附近。依次扫描每个都太慢了。我不想强制设备被发现,因为这需要用户提示,从而破坏我的工作流程。
有没有一种方法可以有效地确定一组蓝牙设备中的哪些设备在附近?
I have a list of known Bluetooth device addresses, and would like to know which ones are in proximity. Scanning each in turn is far too slow. I don't want to force the devices to be discoverable, since this requires a user prompt that breaks my workflow.
Is there a way to efficiently determine which of a set of Bluetooth devices are in proximity?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是否意味着尝试连接到每一个都非常慢?我认为除了让其他设备可被发现之外,这是您能够做到这一点的唯一方法。稍微简单一点:为了让您知道那里有哪些设备,您需要向它们发送消息并获得响应。当您获得附近可发现设备的列表时,您基本上是在发出一般响应请求。不可发现的设备不会回复此请求,因此为了找到它们,您需要分别向每个设备发送一条消息。
Does this mean attempting to connect to each one is far to slow? I think that besides making the other devices discoverable this is the only way you are going to be able to do it. To oversimplify a bit: in order for you to know what devices are out there, you need to send a message to them and get a response. When you get a list of discoverable devices in proximity, you are basically sending out a general request for a response. Devices that are not discoverable won't reply to this request, so in order to find them you need to send a message to each one individually.