|
1 | | -Bluetooth® API |
2 | | -************** |
| 1 | +Bluetooth\ :sup:`®` API |
| 2 | +***************************** |
3 | 3 |
|
4 | 4 | :link_to_translation:`zh_CN:[中文]` |
5 | 5 |
|
| 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 | + |
6 | 29 | .. toctree:: |
7 | | - :maxdepth: 2 |
| 30 | + :maxdepth: 1 |
8 | 31 |
|
9 | 32 | bt_common |
10 | | - bt_le |
11 | 33 | :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 | + |
14 | 53 | nimble/index |
15 | 54 |
|
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** |
17 | 60 |
|
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. |
20 | 62 |
|
21 | | -.. only:: esp32 |
| 63 | + .. toctree:: |
| 64 | + :maxdepth: 1 |
22 | 65 |
|
23 | | - For the overview of the ESP32 Bluetooth stack architecture, follow the links below: |
| 66 | + esp-ble-mesh |
24 | 67 |
|
25 | | - * `ESP32 Bluetooth Architecture (PDF) <https://espressif.com/sites/default/files/documentation/esp32_bluetooth_architecture_en.pdf>`_ |
| 68 | +---- |
26 | 69 |
|
27 | | -Code examples for this API section are provided in the :example:`bluetooth/bluedroid` directory of ESP-IDF examples. |
| 70 | +Examples and Tutorials |
| 71 | +--------------------------- |
28 | 72 |
|
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: |
30 | 79 |
|
31 | 80 | * :example_file:`GATT Client Example Walkthrough <bluetooth/bluedroid/ble/gatt_client/tutorial/Gatt_Client_Example_Walkthrough.md>` |
32 | 81 | * :example_file:`GATT Server Service Table Example Walkthrough <bluetooth/bluedroid/ble/gatt_server_service_table/tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md>` |
33 | 82 | * :example_file:`GATT Server Example Walkthrough <bluetooth/bluedroid/ble/gatt_server/tutorial/Gatt_Server_Example_Walkthrough.md>` |
34 | 83 | * :example_file:`GATT Security Client Example Walkthrough <bluetooth/bluedroid/ble/gatt_security_client/tutorial/Gatt_Security_Client_Example_Walkthrough.md>` |
35 | 84 | * :example_file:`GATT Security Server Example Walkthrough <bluetooth/bluedroid/ble/gatt_security_server/tutorial/Gatt_Security_Server_Example_Walkthrough.md>` |
36 | 85 | * :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>` |
0 commit comments