连接到不可发现的蓝牙设备
我正在开发一个安卓应用程序。只是一个一般性问题,是否可以连接到公开不可发现的设备?
提前致谢。
I am developing an app for android. Just a general questions as to , if is it possible to connect to a device which is non discoverable publicly?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您之前已与该设备配对,则即使该设备未处于可发现模式,也可以再次连接到该设备。参见这篇文章:
以编程方式连接到-paired-bluetooth-device
If you have previously paired with the device then it is possible to connect to it again even if it is not in discoverable mode. See this post:
programmatically-connect-to-paired-bluetooth-device
通过可发现,我假设您的意思是响应来自另一台设备的设备搜索。一些制造商也将其称为可见的。
根据设备制造商的不同,某些设备允许打开蓝牙并将可见性/发现能力设置为关闭。
因此,如果您已经知道设备的蓝牙地址(MAC 地址),即使设备不可发现/可见,您也可以直接连接到该设备。
在实践中,这是一件好事,许多制造商通过仅在特定时间段(例如在配对过程中)可见设备来实现这一点,或者具有明确的菜单选项来打开特定时间段的发现能力。
从安全角度来看,这是一个很好的做法,因为它可以防止设备跟踪/黑客攻击。
例如,当蓝牙打开时,默认情况下 iPhone 是不可发现的(但您仍然可以连接到它),只有当您从设置菜单进入蓝牙菜单时才能发现它。
By discoverable I assume you meant responding to device searchs from another device. Some manufacturers also refer to it as visible.
Depending on the manufacturer of the device , some devices allow Bluetooth to be on and visibility/discover-ability to be set to off.
So if you already know the Bluetooth Address (MAC Address) of the device you can directly connect to it even when the device is not discoverable/visible.
In practice it is a good thing to do, many manufacturers allow for this by having the device visible only during specific periods like during the paring process or have explicit menu option to turn on discover-ability for a specific period.
This is a good practice from a security stand-point as it prevents device tracking / hacking.
iPhone for example is by default non-discoverable when Bluetooth is on, (but you can still connect to it) it is only discoverable when you enter the Bluetooth menu from the settings menu.
在蓝牙标准下这是可能的。我已经多次这样做了,只需使用我提前知道的 MAC 地址即可将 Bluegiga 的两个模块连接在一起。
Android 将允许您使用 createInsecureRfcommSocketToServiceRecord< 来执行此操作/a>
It is possible under the Bluetooth standard. I have done this many times connecting two modules from Bluegiga together simply using the MAC address that I knew ahead of time.
Android will let you do this with createInsecureRfcommSocketToServiceRecord