Skip to content

Commit fe873ac

Browse files
committed
docs: Improve Bluetooth API homepage
1 parent 45f495c commit fe873ac

File tree

2 files changed

+141
-31
lines changed

2 files changed

+141
-31
lines changed
Lines changed: 69 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,91 @@
1-
Bluetooth® API
2-
**************
1+
Bluetooth\ :sup:`®` API
2+
*****************************
33

44
:link_to_translation:`zh_CN:[中文]`
55

6+
This section provides the API reference for Bluetooth components supported in ESP-IDF. ESP-IDF supports two host stacks: **Bluedroid** and **NimBLE**.
7+
8+
- **Bluedroid** (the default stack): Supports both Bluetooth Classic and Bluetooth LE. Recommended for applications that require both technologies.
9+
- **NimBLE**: A lightweight stack for Bluetooth LE only. Ideal for resource-constrained applications due to smaller code size and memory usage.
10+
11+
Use the navigation links below to explore API documentation and application examples.
12+
13+
----
14+
15+
**Controller Interface API**
16+
17+
The low-level interface between the Bluetooth host stack and the controller.
18+
19+
.. toctree::
20+
:maxdepth: 1
21+
22+
controller_vhci
23+
24+
25+
**Bluedroid Stack API**
26+
27+
The default host stack in ESP-IDF, supporting both Bluetooth Classic and Bluetooth LE.
28+
629
.. toctree::
7-
:maxdepth: 2
30+
:maxdepth: 1
831

932
bt_common
10-
bt_le
1133
:SOC_BT_CLASSIC_SUPPORTED: classic_bt
12-
controller_vhci
13-
:SOC_BLE_MESH_SUPPORTED: esp-ble-mesh
34+
bt_le
35+
36+
For architecture and feature overviews, refer to the following documents in API Guides:
37+
38+
.. only:: SOC_BT_CLASSIC_SUPPORTED
39+
40+
:doc:`../../api-guides/bt-architecture/index`, :doc:`../../api-guides/classic-bt/index`, :doc:`../../api-guides/ble/index`
41+
42+
.. only:: not SOC_BT_CLASSIC_SUPPORTED
43+
44+
:doc:`../../api-guides/bt-architecture/index`, :doc:`../../api-guides/ble/index`
45+
46+
**NimBLE Stack API**
47+
48+
A lightweight host stack for Bluetooth LE.
49+
50+
.. toctree::
51+
:maxdepth: 1
52+
1453
nimble/index
1554

16-
ESP-IDF currently supports two host stacks. The Bluedroid based stack (default) supports classic Bluetooth as well as Bluetooth Low Energy (Bluetooth LE). On the other hand, Apache NimBLE based stack is Bluetooth Low Energy only. For users to make a choice:
55+
For additional details and API reference from the upstream documentation, refer to `Apache Mynewt NimBLE User Guide <https://mynewt.apache.org/latest/network/index.html>`_.
56+
57+
.. only:: SOC_BLE_MESH_SUPPORTED
58+
59+
**ESP-BLE-MESH API**
1760

18-
* For usecases involving classic Bluetooth as well as Bluetooth Low Energy, Bluedroid should be used.
19-
* For Bluetooth Low Energy-only usecases, using NimBLE is recommended. It is less demanding in terms of code footprint and runtime memory, making it suitable for such scenarios.
61+
Implements Bluetooth LE Mesh networking.
2062

21-
.. only:: esp32
63+
.. toctree::
64+
:maxdepth: 1
2265

23-
For the overview of the ESP32 Bluetooth stack architecture, follow the links below:
66+
esp-ble-mesh
2467

25-
* `ESP32 Bluetooth Architecture (PDF) <https://espressif.com/sites/default/files/documentation/esp32_bluetooth_architecture_en.pdf>`_
68+
----
2669

27-
Code examples for this API section are provided in the :example:`bluetooth/bluedroid` directory of ESP-IDF examples.
70+
Examples and Tutorials
71+
---------------------------
2872

29-
The following examples contain detailed walkthroughs:
73+
Explore examples and tutorials in the ESP-IDF examples directory:
74+
75+
- **Bluedroid**: :example:`bluetooth/bluedroid`
76+
- **NimBLE**: :example:`bluetooth/nimble`
77+
78+
Step-by-step tutorials for developing with the Bluedroid stack:
3079

3180
* :example_file:`GATT Client Example Walkthrough <bluetooth/bluedroid/ble/gatt_client/tutorial/Gatt_Client_Example_Walkthrough.md>`
3281
* :example_file:`GATT Server Service Table Example Walkthrough <bluetooth/bluedroid/ble/gatt_server_service_table/tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md>`
3382
* :example_file:`GATT Server Example Walkthrough <bluetooth/bluedroid/ble/gatt_server/tutorial/Gatt_Server_Example_Walkthrough.md>`
3483
* :example_file:`GATT Security Client Example Walkthrough <bluetooth/bluedroid/ble/gatt_security_client/tutorial/Gatt_Security_Client_Example_Walkthrough.md>`
3584
* :example_file:`GATT Security Server Example Walkthrough <bluetooth/bluedroid/ble/gatt_security_server/tutorial/Gatt_Security_Server_Example_Walkthrough.md>`
3685
* :example_file:`GATT Client Multi-connection Example Walkthrough <bluetooth/bluedroid/ble/gattc_multi_connect/tutorial/Gatt_Client_Multi_Connection_Example_Walkthrough.md>`
86+
87+
Step-by-step tutorials for developing with the NimBLE stack:
88+
89+
* :example_file:`Bluetooth LE Central Example Walkthrough <bluetooth/nimble/blecent/tutorial/blecent_walkthrough.md>`
90+
* :example_file:`Bluetooth LE Heart Rate Example Walkthrough <bluetooth/nimble/blehr/tutorial/blehr_walkthrough.md>`
91+
* :example_file:`Bluetooth LE Peripheral Example Walkthrough <bluetooth/nimble/bleprph/tutorial/bleprph_walkthrough.md>`
Lines changed: 72 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,91 @@
1-
蓝牙 API
2-
*************
1+
蓝牙\ :sup:`®` API
2+
***********************
33

44
:link_to_translation:`en:[English]`
55

6+
本章节提供 ESP-IDF 中蓝牙的 API 参考。ESP-IDF 支持两种主机协议栈:**Bluedroid** 和 **NimBLE**。
7+
8+
- **Bluedroid** (默认协议栈):支持经典蓝牙和低功耗蓝牙,适用于同时使用这两种技术的应用场景。
9+
- **NimBLE**:仅支持低功耗蓝牙,因代码体积小、内存占用低,适合资源受限的应用。
10+
11+
可通过下方链接查看相应的 API 文档和示例应用。
12+
13+
----
14+
15+
**控制器接口 API**
16+
17+
蓝牙主机协议栈与控制器之间的底层接口。
18+
19+
.. toctree::
20+
:maxdepth: 1
21+
22+
controller_vhci
23+
24+
25+
**Bluedroid 协议栈 API**
26+
27+
ESP-IDF 默认的主机协议栈,支持经典蓝牙和低功耗蓝牙。
28+
29+
.. toctree::
30+
:maxdepth: 1
31+
32+
bt_common
33+
:SOC_BT_CLASSIC_SUPPORTED: classic_bt
34+
bt_le
35+
36+
有关蓝牙架构和功能的详细信息,请参阅 API 指南中的以下文档:
37+
38+
.. only:: SOC_BT_CLASSIC_SUPPORTED
39+
40+
:doc:`../../api-guides/bt-architecture/index`、 :doc:`../../api-guides/classic-bt/index`、 :doc:`../../api-guides/ble/index`
41+
42+
.. only:: not SOC_BT_CLASSIC_SUPPORTED
43+
44+
:doc:`../../api-guides/bt-architecture/index`、 :doc:`../../api-guides/ble/index`
45+
46+
**NimBLE 协议栈 API**
47+
48+
专为低功耗蓝牙设计的轻量级主机协议栈。
49+
650
.. toctree::
7-
:maxdepth: 2
51+
:maxdepth: 1
52+
53+
nimble/index
54+
55+
更多详细信息和上游文档的 API 参考,请参阅 `Apache Mynewt NimBLE 用户指南 <https://mynewt.apache.org/latest/network/index.html>`_。
56+
57+
.. only:: SOC_BLE_MESH_SUPPORTED
858

9-
bt_common
10-
bt_le
11-
:SOC_BT_CLASSIC_SUPPORTED: classic_bt
12-
controller_vhci
13-
:SOC_BLE_MESH_SUPPORTED: esp-ble-mesh
14-
nimble/index
59+
**ESP-BLE-MESH API**
1560

16-
ESP-IDF 目前支持两个主机堆栈。基于 Bluedroid 的堆栈(默认)支持传统蓝牙和低功耗蓝牙 (Bluetooth® LE),而基于 Apache NimBLE 的堆栈仅支持低功耗蓝牙。用户可参考如下信息进行选择:
61+
实现低功耗蓝牙 Mesh 网络功能。
1762

18-
* 对于同时涉及传统蓝牙和低功耗蓝牙的用例,应该选用 Bluedroid。
19-
* 对于仅涉及低功耗蓝牙的用例,建议选用 NimBLE。在代码占用和运行时,NimBLE 对内存的要求较低,因此适用于此类场景。
63+
.. toctree::
64+
:maxdepth: 1
2065

21-
.. only:: esp32
66+
esp-ble-mesh
2267

23-
请点击下方链接,查看 ESP32 蓝牙架构:
68+
----
2469

25-
* `ESP32 蓝牙架构 (PDF) <https://espressif.com/sites/default/files/documentation/esp32_bluetooth_architecture_cn.pdf>`_
70+
示例与教程
71+
------------
2672

27-
蓝牙 API 的示例代码存放于 ESP-IDF 示例项目的 :example:`bluetooth/bluedroid` 目录下。
73+
ESP-IDF 提供了丰富的示例代码和实践教程,路径见 examples 目录:
2874

29-
下面的示例给出了详细介绍:
75+
- **Bluedroid**: :example:`bluetooth/bluedroid`
76+
- **NimBLE**: :example:`bluetooth/nimble`
77+
78+
使用 Bluedroid 协议栈进行开发的分步示例教程:
3079

3180
* :example_file:`GATT 客户端示例 <bluetooth/bluedroid/ble/gatt_client/tutorial/Gatt_Client_Example_Walkthrough.md>`
3281
* :example_file:`GATT 服务端服务表格示例 <bluetooth/bluedroid/ble/gatt_server_service_table/tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md>`
3382
* :example_file:`GATT 服务端示例 <bluetooth/bluedroid/ble/gatt_server/tutorial/Gatt_Server_Example_Walkthrough.md>`
3483
* :example_file:`GATT 客户端安全性示例 <bluetooth/bluedroid/ble/gatt_security_client/tutorial/Gatt_Security_Client_Example_Walkthrough.md>`
3584
* :example_file:`GATT 服务端安全性示例 <bluetooth/bluedroid/ble/gatt_security_server/tutorial/Gatt_Security_Server_Example_Walkthrough.md>`
3685
* :example_file:`GATT 客户端多连接示例 <bluetooth/bluedroid/ble/gattc_multi_connect/tutorial/Gatt_Client_Multi_Connection_Example_Walkthrough.md>`
86+
87+
使用 NimBLE 协议栈进行开发的分步示例教程:
88+
89+
* :example_file:`低功耗蓝牙中心设备示例 <bluetooth/nimble/blecent/tutorial/blecent_walkthrough.md>`
90+
* :example_file:`低功耗蓝牙心率示例 <bluetooth/nimble/blehr/tutorial/blehr_walkthrough.md>`
91+
* :example_file:`低功耗蓝牙外围设备示例 <bluetooth/nimble/bleprph/tutorial/bleprph_walkthrough.md>`

0 commit comments

Comments
 (0)