连接到您只知道地址的蓝牙设备
我正在尝试创建一个应用程序,用最简单的术语来说,将其蓝牙 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,这是可能的。如果您已经知道 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.