在 Android 中定位已知的蓝牙设备

发布于 2024-12-16 18:26:48 字数 118 浏览 0 评论 0原文

我有一个已知蓝牙设备地址的列表,并且想知道哪些地址在附近。依次扫描每个都太慢了。我不想强制设备被发现,因为这需要用户提示,从而破坏我的工作流程。

有没有一种方法可以有效地确定一组蓝牙设备中的哪些设备在附近?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

相思故 2024-12-23 18:26:48

依次扫描每个都太慢了。

这是否意味着尝试连接到每一个都非常慢?我认为除了让其他设备可被发现之外,这是您能够做到这一点的唯一方法。稍微简单一点:为了让您知道那里有哪些设备,您需要向它们发送消息并获得响应。当您获得附近可发现设备的列表时,您基本上是在发出一般响应请求。不可发现的设备不会回复此请求,因此为了找到它们,您需要分别向每个设备发送一条消息。

Scanning each in turn is far too slow.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文