连接到您只知道地址的蓝牙设备

发布于 2024-12-28 02:23:28 字数 216 浏览 5 评论 0原文

我正在尝试创建一个应用程序,用最简单的术语来说,将其蓝牙 MAC 地址发送到服务器(通过 3G 连接),然后并行设备上的应用程序接收它(再次通过 3G),并尝试通过蓝牙连接到第一个设备。 是否有可能没有第二个设备运行发现,然后将发现的地址与从服务器获得的地址进行比较。

换句话说,是否有类似 "BT.connect(macaddress);"

感谢您的帮助。

I'm trying to create an application that, in simplest terms, sends its bluetooth mac address to a server (via 3G connection), then the application on a parallel device receives it (again via 3G), and tries to connect via Bluetooth to the first device.
Is it possible without the second device running discovery and then comparing the discovered addresses with the one it got from the server.

In other words is there something like "BT.connect(macaddress);"

Thanks for your help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

停顿的约定 2025-01-04 02:23:28

是的,这是可能的。如果您已经知道 MAC 地址,则不需要发现。您还可以使用 BluetoothAdapter.listenUsingInsecureRfcommWithServiceRecord,但是这仅适用于 API 级别 10 及以上。

只要注意安全问题即可。

Yes, this is possible. Discovery is not needed if you already know the mac address. You can also look into an insecure Bluetooth connection to avoid pairing, using BluetoothAdapter.listenUsingInsecureRfcommWithServiceRecord, but this is only available from API level 10 and above.

Just be aware of the security issues.

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