mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-26 05:09:19 +00:00
docs(ble): Replaced BLE with Bluetooth LE
This commit is contained in:
@@ -407,7 +407,7 @@ If none of our chip series meet your needs, please contact `customer support tea
|
||||
please consult `SIG Bluetooth Product Database <https://qualification.bluetooth.com/Listings/Search>`__.
|
||||
|
||||
For certain features, if the majority of the development is completed on the Controller, the Host's support status will be limited by the Controller's support status.
|
||||
If you want BLE Controller and Host to run on different Espressif chips, the functionality of the Host will not be limited by the Controller's support status on the chip running the Host,
|
||||
If you want Bluetooth LE Controller and Host to run on different Espressif chips, the functionality of the Host will not be limited by the Controller's support status on the chip running the Host,
|
||||
please check the :doc:`ESP Host Feature Support Status Table <host-feature-support-status>` .
|
||||
|
||||
It is important to clarify that this document is not a binding commitment to our customers.
|
||||
|
||||
@@ -296,7 +296,7 @@ If you have not completed the ESP-IDF development environment setup, please refe
|
||||
Try It Out
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Please refer to :ref:`BLE Introduction Try It Out <nimble_gatt_server_practice>` 。
|
||||
Please refer to :ref:`Bluetooth LE Introduction Try It Out <nimble_gatt_server_practice>` 。
|
||||
|
||||
|
||||
Code Explanation
|
||||
|
||||
@@ -6,7 +6,7 @@ ESP Host Major Feature Support Status
|
||||
:link_to_translation:`zh_CN:[中文]`
|
||||
|
||||
The table below shows the support status of major features on ESP-Bluedroid and ESP-NimBLE Host.
|
||||
If you plan to run the BLE Controller and Host on {IDF_TARGET_NAME} together, the functionality of the Host may be limited by the support status of the Controller,
|
||||
If you plan to run the Bluetooth LE Controller and Host on {IDF_TARGET_NAME} together, the functionality of the Host may be limited by the support status of the Controller,
|
||||
please check the :doc:`{IDF_TARGET_NAME} Major Feature Support Status Table <ble-feature-support-status>` .
|
||||
|
||||
|supported_def| **This feature has completed development and internal testing.** [1]_
|
||||
|
||||
@@ -3,18 +3,18 @@ Introduction to Low Power Mode in Bluetooth\ :sup:`®` Low Energy Scenarios
|
||||
|
||||
:link_to_translation:`zh_CN:[中文]`
|
||||
|
||||
This section introduces clock source selection in low power modes for Bluetooth Low Energy (BLE), along with common related issues.
|
||||
This section introduces clock source selection in low power modes for Bluetooth Low Energy (Bluetooth LE), along with common related issues.
|
||||
|
||||
Clock Source Selection in Low Power Mode
|
||||
--------------------------------------------
|
||||
|
||||
According to the Bluetooth specification, the sleep clock accuracy must be within 500 PPM, so make sure the clock source selected for BLE low power mode should meet that requirement. Otherwise BLE may not perform normally and cause a series of problem such as ACL connection establishment failure or ACL connection timeout, etc.
|
||||
According to the Bluetooth specification, the sleep clock accuracy must be within 500 PPM, so make sure the clock source selected for Bluetooth LE low power mode should meet that requirement. Otherwise Bluetooth LE may not perform normally and cause a series of problem such as ACL connection establishment failure or ACL connection timeout, etc.
|
||||
|
||||
|
||||
Selecting Main XTAL
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
To select the main XTAL as the BLE internal clock source, configure the following option:
|
||||
To select the main XTAL as the Bluetooth LE internal clock source, configure the following option:
|
||||
|
||||
.. only:: esp32 or esp32c3 or esp32s3
|
||||
|
||||
@@ -53,7 +53,7 @@ When this is selected, the main XTAL remains powered on during light-sleep, resu
|
||||
Selecting 32kHz External Crystal
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
To use a 32kHz external crystal as the BLE internal clock source, configure the following options:
|
||||
To use a 32kHz external crystal as the Bluetooth LE internal clock source, configure the following options:
|
||||
|
||||
.. only:: esp32 or esp32c3 or esp32s3
|
||||
|
||||
@@ -83,7 +83,7 @@ To use a 32kHz external crystal as the BLE internal clock source, configure the
|
||||
|
||||
- \ (X) External 32 kHz crystal
|
||||
|
||||
**Note:** Even if 32kHz is selected in menuconfig, the system will fall back to the main XTAL if the external crystal is not detected during BLE initialization. This may lead to unexpected current consumption in light-sleep mode.
|
||||
**Note:** Even if 32kHz is selected in menuconfig, the system will fall back to the main XTAL if the external crystal is not detected during Bluetooth LE initialization. This may lead to unexpected current consumption in light-sleep mode.
|
||||
|
||||
|
||||
Selecting 136 kHz RC Oscillator
|
||||
@@ -91,7 +91,7 @@ Selecting 136 kHz RC Oscillator
|
||||
|
||||
.. only:: esp32c3 or esp32s3
|
||||
|
||||
To use a 136 kHz internal RC oscillator as the BLE internal clock source, configure the following option:
|
||||
To use a 136 kHz internal RC oscillator as the Bluetooth LE internal clock source, configure the following option:
|
||||
|
||||
**Configuration Path:** `
|
||||
|
||||
@@ -101,15 +101,15 @@ Selecting 136 kHz RC Oscillator
|
||||
|
||||
- \ (X) Internal 136kHz RC oscillator
|
||||
|
||||
Generally, the 136 kHz RC oscillator cannot meet the accuracy requirement of BLE. It is only suitable for scenarios with low clock accuracy requirements, such as legacy advertising (ADV) or scanning. It does not support connections in central or peripheral roles.
|
||||
Generally, the 136 kHz RC oscillator cannot meet the accuracy requirement of Bluetooth LE. It is only suitable for scenarios with low clock accuracy requirements, such as legacy advertising (ADV) or scanning. It does not support connections in central or peripheral roles.
|
||||
|
||||
.. only:: esp32
|
||||
|
||||
**Note:** ESP32 does not support using 136 kHz RC oscillator as the BLE clock source.
|
||||
**Note:** ESP32 does not support using 136 kHz RC oscillator as the Bluetooth LE clock source.
|
||||
|
||||
.. only:: esp32c2 or esp32c6 or esp32h2 or esp32c5 or esp32c61
|
||||
|
||||
To use a 136 kHz internal RC oscillator as the BLE internal clock source, configure the following options:
|
||||
To use a 136 kHz internal RC oscillator as the Bluetooth LE internal clock source, configure the following options:
|
||||
|
||||
**Configuration Path 1:**
|
||||
|
||||
@@ -127,7 +127,7 @@ Selecting 136 kHz RC Oscillator
|
||||
|
||||
- \ (X) Internal 136 kHz RC oscillator
|
||||
|
||||
If low current consumption is required but have no access to the External 32kHz Crystal, then this clock source is recommended. However, selecting this clock source will have the sleep clock accuracy larger than 500 PPM, which is supported if the peer device is also an ESP chip. If the peer device is not an ESP chip, here's some BLE event not supported:
|
||||
If low current consumption is required but have no access to the External 32kHz Crystal, then this clock source is recommended. However, selecting this clock source will have the sleep clock accuracy larger than 500 PPM, which is supported if the peer device is also an ESP chip. If the peer device is not an ESP chip, here's some Bluetooth LE event not supported:
|
||||
|
||||
1. Central role of Connection
|
||||
2. Advertiser of Periodic Advertising
|
||||
@@ -146,12 +146,12 @@ Selecting 136 kHz RC Oscillator
|
||||
**Note:** Using the 136 kHz RC oscillator may cause rare issues like connection establishment failure or connection timeout.
|
||||
|
||||
|
||||
**How to Check the Current Clock Source Used by BLE**
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
**How to Check the Current Clock Source Used by Bluetooth LE**
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
You can determine the BLE clock source from the logs during BLE initialization:
|
||||
You can determine the Bluetooth LE clock source from the logs during Bluetooth LE initialization:
|
||||
|
||||
.. list-table:: BLE Initialization Log Messages and Clock Source Correspondence
|
||||
.. list-table:: Bluetooth LE Initialization Log Messages and Clock Source Correspondence
|
||||
:widths: 50 50
|
||||
:header-rows: 1
|
||||
|
||||
@@ -170,22 +170,22 @@ You can determine the BLE clock source from the logs during BLE initialization:
|
||||
FAQ
|
||||
--------------------------------------
|
||||
|
||||
**1. BLE ACL Connection Fails or Disconnects in Low Power Mode**
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
**1. Bluetooth LE ACL Connection Fails or Disconnects in Low Power Mode**
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
As explained in the clock source selection section above, when ACL connections fail to establish or unexpectedly disconnect in low power mode, first verify whether the current clock source meets BLE accuracy requirements.
|
||||
As explained in the clock source selection section above, when ACL connections fail to establish or unexpectedly disconnect in low power mode, first verify whether the current clock source meets Bluetooth LE accuracy requirements.
|
||||
|
||||
|
||||
**2. Measured light-sleep Current Is Higher Than Expected**
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
As introduced in the clock source selection section above, if the main XTAL is used as the clock source, it will remain powered on during light-sleep, resulting in higher current consumption than other clock sources.
|
||||
|
||||
The average current can be application specific, and depends on the BLE configuration and the period of time in light-sleep mode. Some application may have larger average current because it has BLE taking a larger ratio of time transmitting and receiving.
|
||||
The average current can be application specific, and depends on the Bluetooth LE configuration and the period of time in light-sleep mode. Some application may have larger average current because it has Bluetooth LE taking a larger ratio of time transmitting and receiving.
|
||||
|
||||
**3. Unable to Enter light-sleep Mode**
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
When Auto light-sleep is enabled but the device fails to enter light-sleep, it's often due to insufficient IDLE duration, which prevents meeting the automatic light-sleep entry conditions.
|
||||
|
||||
This could be caused by excessive logging or BLE configuration that prevents sufficient IDLE time, such as continuous scan mode.
|
||||
This could be caused by excessive logging or Bluetooth LE configuration that prevents sufficient IDLE time, such as continuous scan mode.
|
||||
|
||||
@@ -66,7 +66,7 @@ ESP-IDF provides a preset-based configuration system for Mbed TLS to simplify se
|
||||
• Basic X.509 parsing
|
||||
* - **Bluetooth (BT)**
|
||||
- Bluetooth applications
|
||||
- • Optimized for BLE security
|
||||
- • Optimized for Bluetooth LE security
|
||||
• ECC P-256 curve support
|
||||
• Minimal TLS overhead
|
||||
• Bluetooth-specific algorithms
|
||||
|
||||
@@ -435,9 +435,9 @@ ACK 帧格式 (8 bit):
|
||||
-
|
||||
|
||||
* - 0x8 (b’001000)
|
||||
- 断开 BLE GATT 连接。
|
||||
- 断开低功耗蓝牙 GATT 连接。
|
||||
-
|
||||
- ESP 设备收到该指令后主动断开 BLE GATT 连接。
|
||||
- ESP 设备收到该指令后主动断开低功耗蓝牙 GATT 连接。
|
||||
|
||||
* - 0x9 (b’001001)
|
||||
- 获取 Wi-Fi 列表。
|
||||
|
||||
@@ -296,7 +296,7 @@ GATT 数据操作
|
||||
动手试试
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
请参考 :ref:`BLE 介绍 动手试试 <nimble_gatt_server_practice>` 。
|
||||
请参考 :ref:`低功耗蓝牙介绍 动手试试 <nimble_gatt_server_practice>` 。
|
||||
|
||||
|
||||
代码详解
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
低功耗模式下的时钟源选择
|
||||
--------------------------------------------
|
||||
|
||||
在低功耗蓝牙应用场景中,由于协议要求休眠时钟精度需在 500 PPM 以内,light-sleep 和 modem-sleep 模式下所用的时钟源必须满足该要求。如果时钟精度不足,可能会出现 ACL 连接失败或超时断开等问题。**因此在使用前请确保所选时钟源及其精度满足 BLE 要求。**
|
||||
在低功耗蓝牙应用场景中,由于协议要求休眠时钟精度需在 500 PPM 以内,light-sleep 和 modem-sleep 模式下所用的时钟源必须满足该要求。如果时钟精度不足,可能会出现 ACL 连接失败或超时断开等问题。**因此在使用前请确保所选时钟源及其精度满 要求。**
|
||||
|
||||
|
||||
选择主晶振
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
要选择主晶振作为 BLE 内部时钟源,请配置以下选项:
|
||||
要选择主晶振作为低功耗蓝牙内部时钟源,请配置以下选项:
|
||||
|
||||
.. only:: esp32 or esp32c3 or esp32s3
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
选择 32kHz 外部晶振
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
要使用 32kHz 外部晶振作为 BLE 内部时钟源,请配置以下选项:
|
||||
要使用 32kHz 外部晶振作为低功耗蓝牙内部时钟源,请配置以下选项:
|
||||
|
||||
.. only:: esp32 or esp32c3 or esp32s3
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
|
||||
- \ (X) External 32 kHz crystal
|
||||
|
||||
**注意:** 即使在 menuconfig 中选择了 32kHz 外部晶振,如果 BLE 初始化时未检测到外部晶振,系统会自动切换为主晶振,可能导致 light-sleep 电流高于预期。
|
||||
**注意:** 即使在 menuconfig 中选择了 32kHz 外部晶振,如果低功耗蓝牙初始化时未检测到外部晶振,系统会自动切换为主晶振,可能导致 light-sleep 电流高于预期。
|
||||
|
||||
|
||||
选择 136 kHz RC 振荡器
|
||||
@@ -91,7 +91,7 @@
|
||||
|
||||
.. only:: esp32c3 or esp32s3
|
||||
|
||||
要使用 136 kHz 内部 RC 振荡器作为 BLE 内部时钟源,请配置以下选项:
|
||||
要使用 136 kHz 内部 RC 振荡器作为低功耗蓝牙内部时钟源,请配置以下选项:
|
||||
|
||||
**配置路径:**
|
||||
|
||||
@@ -101,15 +101,15 @@
|
||||
|
||||
- \ (X) Internal 136kHz RC oscillator
|
||||
|
||||
一般来说,136 kHz RC 振荡器难以满足 BLE 的精度要求,仅适用于对时钟精度要求不高的场景,如传统广播 (ADV) 或扫描 (SCAN)。它不支持以中心角色或外设角色建立连接。
|
||||
一般来说,136 kHz RC 振荡器难以满足低功耗蓝牙的精度要求,仅适用于对时钟精度要求不高的场景,如传统广播 (ADV) 或扫描 (SCAN)。它不支持以中心角色或外设角色建立连接。
|
||||
|
||||
.. only:: esp32
|
||||
|
||||
**注意:** ESP32 不支持 136 kHz RC 振荡器作为 BLE 时钟源。
|
||||
**注意:** ESP32 不支持 136 kHz RC 振荡器作为低功耗蓝牙时钟源。
|
||||
|
||||
.. only:: esp32c2 or esp32c6 or esp32h2 or esp32c5 or esp32c61
|
||||
|
||||
要使用 136 kHz 内部 RC 振荡器作为 BLE 内部时钟源,请配置以下选项:
|
||||
要使用 136 kHz 内部 RC 振荡器作为低功耗蓝牙内部时钟源,请配置以下选项:
|
||||
|
||||
**配置路径 1:**
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
|
||||
- \ (X) Internal 136 kHz RC oscillator
|
||||
|
||||
对于需要低功耗且没有 32kHz 外部晶振的场景下,可以选择 136 kHz R C振荡器。然而这个时钟无法满足 BLE 的 500PPM 的休眠时钟精度需求。不过如果对端设备使用的是 ESP 芯片,仍能支持 BLE 行为。但是如果对端设备并非使用 ESP 芯片,则使用下面 BLE 行为将无法支持:
|
||||
对于需要低功耗且没有 32kHz 外部晶振的场景下,可以选择 136 kHz R C振荡器。然而这个时钟无法满足低功耗蓝牙的 500PPM 的休眠时钟精度需求。不过如果对端设备使用的是 ESP 芯片,仍能支持低功耗蓝牙行为。但是如果对端设备并非使用 ESP 芯片,则使用下面低功耗蓝牙行为将无法支持:
|
||||
|
||||
1. 作为连接的 Central 方
|
||||
2. 作为 Periodic Advertising 的广播方
|
||||
@@ -146,12 +146,12 @@
|
||||
**注意:** 使用 136 kHz RC 振荡器可能偶发连接断开或连接失败。
|
||||
|
||||
|
||||
**如何确认当前 BLE 使用的时钟源**
|
||||
**如何确认当前低功耗蓝牙使用的时钟源**
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
可通过 BLE 初始化时的日志判断当前时钟源:
|
||||
可通过低功耗蓝牙初始化时的日志判断当前时钟源:
|
||||
|
||||
.. list-table:: BLE 初始化日志与时钟源对应关系
|
||||
.. list-table:: 低功耗蓝牙初始化日志与时钟源对应关系
|
||||
:widths: 50 50
|
||||
:header-rows: 1
|
||||
|
||||
@@ -170,10 +170,10 @@
|
||||
常见问题
|
||||
--------------------------------------
|
||||
|
||||
**1. BLE ACL 连接在低功耗模式下建立失败或断开**
|
||||
**1. 低功耗蓝牙 ACL 连接在低功耗模式下建立失败或断开**
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
如时钟源选择部分所述,ACL 连接建立失败或断开时,请首先检查当前时钟源是否满足 BLE 精度要求。
|
||||
如时钟源选择部分所述,ACL 连接建立失败或断开时,请首先检查当前时钟源是否满足低功耗蓝牙精度要求。
|
||||
|
||||
|
||||
**2. 实测 light-sleep 电流高于预期**
|
||||
@@ -181,11 +181,11 @@
|
||||
|
||||
如时钟源选择部分所述,若主晶振为时钟源,light-sleep 模式下主晶振持续供电,电流消耗高于其他时钟源。
|
||||
|
||||
平均电流可能会因具体应用而异,并取决于 BLE 的配置以及处于 light-sleep 模式的时间周期。某些应用的平均电流可能会更大,这是因为 BLE 在其中花费了更高比例的时间进行发射和接收。
|
||||
平均电流可能会因具体应用而异,并取决于低功耗蓝牙的配置以及处于 light-sleep 模式的时间周期。某些应用的平均电流可能会更大,这是因为低功耗蓝牙在其中花费了更高比例的时间进行发射和接收。
|
||||
|
||||
**3. 无法进入 light-sleep 模式**
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
启用 Auto light-sleep 后,若设备无法进入 light-sleep,通常是 IDLE 时间不足,未满足自动进入条件。
|
||||
|
||||
这可能由日志过多或 BLE 配置导致 IDLE 时间过短(如连续扫描)引起。
|
||||
这可能由日志过多或低功耗蓝牙配置导致 IDLE 时间过短(如连续扫描)引起。
|
||||
|
||||
@@ -6,9 +6,9 @@ GAP API
|
||||
应用示例
|
||||
-------------------
|
||||
|
||||
- :example:`bluetooth/bluedroid/ble/gatt_security_client` 演示使用 ESP BLE security API,{IDF_TARGET_NAME} 作为 GATT 客户端时如何建立安全连接并加密与对等设备的通信。
|
||||
- :example:`bluetooth/bluedroid/ble/gatt_security_client` 演示使用 ESP 低功耗蓝牙 security API,{IDF_TARGET_NAME} 作为 GATT 客户端时如何建立安全连接并加密与对等设备的通信。
|
||||
|
||||
- :example:`bluetooth/bluedroid/ble/gatt_security_server` 演示使用 ESP BLE security API,{IDF_TARGET_NAME} 作为 GATT 服务器时如何建立安全连接并加密与对等设备的通信。
|
||||
- :example:`bluetooth/bluedroid/ble/gatt_security_server` 演示使用 ESP 低功耗蓝牙 security API,{IDF_TARGET_NAME} 作为 GATT 服务器时如何建立安全连接并加密与对等设备的通信。
|
||||
|
||||
API 参考
|
||||
-------------
|
||||
|
||||
@@ -66,7 +66,7 @@ ESP-IDF 为 Mbed TLS 提供了基于预设的配置系统,用于简化设置
|
||||
• 基本的 X.509 解析
|
||||
* - **蓝牙 (BT)**
|
||||
- 蓝牙应用
|
||||
- • 针对 BLE 安全性需求进行优化
|
||||
- • 针对低功耗蓝牙安全性需求进行优化
|
||||
• 支持 ECC P-256 曲线
|
||||
• 最小的 TLS 开销
|
||||
• 蓝牙特定算法
|
||||
|
||||
Reference in New Issue
Block a user