默认情况下是否可以发现启用BLE的设备? [英] Are BLE-enabled devices discoverable by default?
问题描述
我正在尝试做与此类似的事情 answer ),它表明设备只有在发射数据包时才能被发现信息.
I am looking to do something similar to this question, based on the answer it suggests that devices are only discoverable if they are emitting packets of information.
我想了解的是,默认情况下,像移动电话(iOS/Android)这样的设备会发送这些可发现的数据包吗?还是需要对其进行配置(例如通过应用程序)以显式地宣传自己或数据的某些部分?
What I would like to understand is, do devices like mobile phones (iOS/Android) send these discoverable packets by default? Or would they need to be configured (e.g. via an app) to explicitly advertise themselves or some bits of data?
推荐答案
否,默认情况下无法发现它们.
No, they are not discoverable by default.
Vol 3 of the Bluetooth 4.x spec defines two discoverable modes:
- 9.2.3-受限的可发现模式
受限可发现模式通常在以下情况下使用用户执行特定操作以使设备在有限的时间内可被发现时间段.
The limited discoverable mode is typically used when a user performs a specific action to make the device discoverable for a limited period of time.
- 9.2.4-常规可发现模式
一般可发现模式通常在设备打算要使用可以在很长一段时间内发现.
The general discoverable mode is typically used when the device is intending to be discoverable for a long period of time.
一个好的BLE设计将使设备无限期休眠,以节省电池电量,直到需要采取某些措施为止.设计者完全可以决定何时进行广告,持续多长时间以及以什么间隔进行广告.您可以在启动后立即将其激活或激活.
A good BLE design will be to have the device dormant indefinitely to conserve battery power until some action is required. It is entirely up to the designer to decide when to advertise, for how long, and at what interval. You can have it button activated or active immediately from boot.
但是,如果您的设备没有用户界面并且无法手动激活(例如,广播传感器节点),那么您似乎别无选择,只能使用常规可发现模式"并连续进行广告.您将不得不选择一个广告间隔,这是在保护功能和发现广告之间最好的折衷方案.
However, if your device has no user interface and no way of being manually activated (such as a broadcasting sensor node) then it would seem that you have no choice but to use General Discoverable Mode, and advertise continuously. You will have to choose an advertising interval which is the best compromise between conserving power and being discoverable.
还可能具有受限可发现模式"的重复出现窗口.
It is also possible to have recurring windows of Limited Discoverable Mode.
The Laird module I'm using has this in an app note:
由于BLE旨在节省功耗,因此该设备通常处于休眠状态,直到需要采取措施为止.
Because BLE is designed to save power, the device is typically dormant until action is required.
我还发现了 大量BLE产品大多数时候都处于睡眠状态,仅在需要时醒来进行广告宣传并进行连接.这意味着广告对功耗有很大的影响.
A large number of BLE products sleep most of the time, waking up only to advertise and connect when needed. This means advertisements have a big impact on power consumption. And to answer the 2nd part of your question, If a device isn't advertising, it's impossible for any Central to connect to it. 现在,话虽如此.从安装电池的那一刻起,许多设备就一直在做广告.例如,与Apple iBeacon兼容的设备将以100ms的间隔连续进行广告,直到电池耗尽.有关广告间隔与电池寿命的有趣介绍,请参见此处. Now, with all that said. A lot of devices do advertise all the time from the moment the batteries are installed. As an example, devices compatible with Apple iBeacon will advertise continuously at 100ms interval until the batteries die. An interesting introduction to the topic of advertising interval vs battery life is given here. 这篇关于默认情况下是否可以发现启用BLE的设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!