docs: update application examples for bluedroid and blufi

This commit is contained in:
Linda 2024-07-17 18:42:39 +08:00
parent 9ca974c8b3
commit 1650681d64
16 changed files with 75 additions and 107 deletions

View File

@ -1,16 +1,22 @@
Controller && VHCI Controller && VHCI
================== ==================
Application Example .. only:: esp32 or esp32c3 or esp32s3
-------------------
Check :example:`bluetooth/hci` folder in ESP-IDF examples, which contains the following application: Application Examples
--------------------
* This is a Bluetooth® Low Energy (Bluetooth LE) advertising demo with virtual HCI interface. Send Reset/ADV_PARAM/ADV_DATA/ADV_ENABLE HCI command for Bluetooth Low Energy advertising - :example:`bluetooth/hci/controller_vhci_ble_adv`. .. only:: esp32
.. only:: esp32s3 - :example:`bluetooth/hci/ble_adv_scan_combined` demonstrates how to use Bluetooth capabilities for advertising and scanning with a virtual Host Controller Interface (HCI). This example shows how to implement some host functionalities without a host and displays scanned advertising reports from other devices.
Please note that ESP32-S3 shares the same :component_file:`bt/include/esp32c3/include/esp_bt.h` and :component_file:`bt/controller/esp32c3/bt.c` files with ESP32-C3. - :example:`bluetooth/hci/controller_hci_uart_esp32` demonstrates how to configure the Bluetooth LE Controller's HCI to communicate over UART on {IDF_TARGET_NAME}, enabling communication with an external Bluetooth host stack.
- :example:`bluetooth/hci/controller_vhci_ble_adv` demonstrates how to use the ESP-IDF VHCI ble_advertising app to perform advertising without a host and display received HCI events from the controller.
.. only:: esp32c3 or esp32s3
- :example:`bluetooth/hci/controller_hci_uart_esp32c3_and_esp32s3` demonstrates how to configure the Bluetooth LE Controller's HCI to communicate over UART on {IDF_TARGET_NAME}, enabling communication with an external Bluetooth host stack.
API Reference API Reference
------------- -------------

View File

@ -1,15 +1,16 @@
Bluetooth® A2DP API Bluetooth® A2DP API
=================== ===================
Application Example Application Examples
------------------- --------------------
Check :example:`bluetooth/bluedroid/classic_bt` folder in ESP-IDF examples, which contains the following application: - :example:`bluetooth/bluedroid/classic_bt/a2dp_sink` demonstrates how to implement an audio sink device using the Advanced Audio Distribution Profile (A2DP) to receive audio streams. This example also shows how to use AVRCP for media information notifications and I2S for audio stream output.
* This is a A2DP sink client demo. This demo can be discovered and connected by A2DP source device and receive the audio stream from remote device - :example:`bluetooth/bluedroid/classic_bt/a2dp_sink` - :example:`bluetooth/bluedroid/classic_bt/a2dp_source` demonstrates how to use A2DP APIs to transmit audio streams.
- :example:`bluetooth/bluedroid/coex/a2dp_gatts_coex` demonstrates how to use the ESP-IDF A2DP-GATTS_COEX demo to create a GATT service and A2DP profile.
API Reference API Reference
------------- -------------
.. include-build-file:: inc/esp_a2dp_api.inc .. include-build-file:: inc/esp_a2dp_api.inc

View File

@ -11,15 +11,12 @@ Use should concern these things:
1. The event sent from profile. Then you need to do something as the event indicate. 1. The event sent from profile. Then you need to do something as the event indicate.
2. Security reference. You can write your own Security functions such as symmetrical encryption/decryption and checksum functions. Even you can define the "Key Exchange/Negotiation" procedure. 2. Security reference. You can write your own Security functions such as symmetrical encryption/decryption and checksum functions. Even you can define the "Key Exchange/Negotiation" procedure.
Application Example Application Examples
------------------- --------------------
Check :example:`bluetooth` folder in ESP-IDF examples, which contains the following application: - :example:`bluetooth/blufi` how to use the Blufi function to configure the Wi-Fi connection to an AP via a Bluetooth channel on {IDF_TARGET_NAME}.
* This is the BluFi demo. This demo can set ESP32's Wi-Fi to softap/station/softap&station mode and config Wi-Fi connections - :example:`bluetooth/blufi`
API Reference API Reference
------------- -------------
.. include-build-file:: inc/esp_blufi_api.inc .. include-build-file:: inc/esp_blufi_api.inc

View File

@ -6,6 +6,13 @@ Overview
Bluetooth device reference APIs. Bluetooth device reference APIs.
.. only:: esp32
Application Examples
--------------------
- :example:`bluetooth/bluedroid/classic_bt/bt_spp_vfs_acceptor` demonstrates how to use Serial Port Protocol (SPP) APIs to create an SPP acceptor that acts as a server and registers into the VFS. It also shows how to implement Secure Simple Pairing (SSP) in your own applications.
API Reference API Reference
------------- -------------

View File

@ -3,23 +3,14 @@ GAP API
:link_to_translation:`zh_CN:[中文]` :link_to_translation:`zh_CN:[中文]`
Application Example Application Examples
------------------- --------------------
Check the :example:`bluetooth/bluedroid/ble` folder in ESP-IDF examples, which contains the following demos and their tutorials: - :example:`bluetooth/bluedroid/ble/gatt_security_client` demonstrates how to use ESP BLE security APIs on {IDF_TARGET_NAME} to establish a secure connection and encrypt communication with peer devices while acting as a GATT client.
* The following shows an SMP security client demo with its tutorial. This demo initiates its security parameters and acts as a GATT client, which can send a security request to the peer device and then complete the encryption procedure. - :example:`bluetooth/bluedroid/ble/gatt_security_server` demonstrates how to use ESP BLE security APIs on {IDF_TARGET_NAME} to establish a secure connection and encrypt communication with peer devices while acting as a GATT server.
- :example:`bluetooth/bluedroid/ble/gatt_security_client`
- :example_file:`GATT Security Client Example Walkthrough <bluetooth/bluedroid/ble/gatt_security_client/tutorial/Gatt_Security_Client_Example_Walkthrough.md>`
* The following shows an SMP security server demo with its tutorial. This demo initiates its security parameters and acts as a GATT server, which can send a pair request to the peer device and then complete the encryption procedure.
- :example:`bluetooth/bluedroid/ble/gatt_security_server`
- :example_file:`GATT Security Server Example Walkthrough <bluetooth/bluedroid/ble/gatt_security_server/tutorial/Gatt_Security_Server_Example_Walkthrough.md>`
API Reference API Reference
------------- -------------
.. include-build-file:: inc/esp_gap_ble_api.inc .. include-build-file:: inc/esp_gap_ble_api.inc

View File

@ -1,8 +1,12 @@
Classic Bluetooth® GAP API Classic Bluetooth® GAP API
========================== ==========================
Application Examples
--------------------
- :example:`bluetooth/bluedroid/classic_bt/bt_discovery` demonstrates how to use APIs to search for a target device with a Major device type of "Phone" or "Audio/Video" in the Class of Device field, and then perform a service discovery via the Service Discovery Protocol.
API Reference API Reference
------------- -------------
.. include-build-file:: inc/esp_gap_bt_api.inc .. include-build-file:: inc/esp_gap_bt_api.inc

View File

@ -1,24 +1,14 @@
GATT Client API GATT Client API
=============== ===============
Application Example Application Examples
------------------- --------------------
Check :example:`bluetooth/bluedroid/ble` folder in ESP-IDF examples, which contains the following demos and their tutorials: - :example:`bluetooth/bluedroid/ble/gatt_client` demonstrates how to create a GATT Client that connects to a GATT server, enabling the server's notification function to discover its service.
* This is a GATT client demo and its tutorial. This demo can scan for devices, connect to the GATT server and discover its services. - :example:`bluetooth/bluedroid/ble/gattc_multi_connect` demonstrates how to create a GATT Client that connects to multiple GATT servers, enabling their notification functions to discover their services.
- :example:`bluetooth/bluedroid/ble/gatt_client` - :example:`bluetooth/bluedroid/coex/gattc_gatts_coex` demonstrates the coexistence of GATT client and GATT server by creating a GATT service, starting ADV, and exchanging data between a GATT client and device.
- :example_file:`GATT Client Example Walkthrough <bluetooth/bluedroid/ble/gatt_client/tutorial/Gatt_Client_Example_Walkthrough.md>`
* This is a multiple connection demo and its tutorial. This demo can connect to multiple GATT server devices and discover their services.
- :example:`bluetooth/bluedroid/ble/gattc_multi_connect`
- :example_file:`GATT Client Multi-connection Example Walkthrough <bluetooth/bluedroid/ble/gattc_multi_connect/tutorial/Gatt_Client_Multi_Connection_Example_Walkthrough.md>`
* This is a demo similar to Bluetooth® Low Energy (Bluetooth LE) SPP. This demo, which acts as a GATT client, can receive data from UART and then send the data to the peer device automatically.
- :example:`bluetooth/bluedroid/ble/ble_spp_client`
API Reference API Reference
------------- -------------

View File

@ -6,24 +6,11 @@ GATT Server API
Application Examples Application Examples
-------------------- --------------------
Check :example:`bluetooth/bluedroid/ble` folder in ESP-IDF examples, which contains the following demos and their tutorials: - :example:`bluetooth/bluedroid/ble/gatt_server_service_table` demonstrates how to create a GATT service using an attribute table, releasing the user from adding attributes individually.
* This is a GATT server demo and its tutorial. This demo creates a GATT service with an attribute table, which releases the user from the operation of adding attributes one by one. This is the recommended method of adding attributes (officially recommended). - :example:`bluetooth/bluedroid/ble/gatt_server` demonstrates how to create a GATT service by adding attributes individually and then starts advertising so that a GATT client can connect and exchange data.
- :example:`bluetooth/bluedroid/ble/gatt_server_service_table`
- :example_file:`GATT Server Service Table Example Walkthrough <bluetooth/bluedroid/ble/gatt_server_service_table/tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md>`
* This is a GATT server demo and its tutorial. This demo creates a GATT service by adding attributes one by one as defined by Bluedroid. The recommended method of adding attributes is presented in the example below.
- :example:`bluetooth/bluedroid/ble/gatt_server`
- :example_file:`GATT Server Example Walkthrough <bluetooth/bluedroid/ble/gatt_server/tutorial/Gatt_Server_Example_Walkthrough.md>`
* This is a demo similar to Bluetooth® Low Energy (Bluetooth LE) SPP. In this demo, GATT server can receive data from UART and then send the data to the peer device automatically.
- :example:`bluetooth/bluedroid/ble/ble_spp_server`
API Reference API Reference
------------- -------------
.. include-build-file:: inc/esp_gatts_api.inc .. include-build-file:: inc/esp_gatts_api.inc

View File

@ -1,6 +1,11 @@
HFP AG API HFP AG API
============== ==============
Application Examples
--------------------
- :example:`bluetooth/bluedroid/classic_bt/hfp_ag` demonstrates how to use the Hands-Free Audio Gateway (HF-AG) component to communicate with a device that implements Hands-Free Client Role, such as a headphone set. It provides commands for configuring the project, establishing connections, controlling volume, and answering or rejecting calls.
API Reference API Reference
------------- -------------

View File

@ -1,6 +1,11 @@
HFP Client API HFP Client API
============== ==============
Application Examples
--------------------
- :example:`bluetooth/bluedroid/classic_bt/hfp_hf` demonstrates how to use the Hands-Free Client Component to communicate with a device that implements Hands-Free Audio Gateway (HF-AG), such as a smartphone.
API Reference API Reference
------------- -------------

View File

@ -6,12 +6,12 @@ Overview
A Bluetooth HID device is a device providing the service of human or other data input and output to and from a Bluetooth HID Host. Users can use the Bluetooth HID Device APIs to make devices like keyboards, mice, joysticks and so on. A Bluetooth HID device is a device providing the service of human or other data input and output to and from a Bluetooth HID Host. Users can use the Bluetooth HID Device APIs to make devices like keyboards, mice, joysticks and so on.
Application Example Application Examples
------------------- --------------------
Check :example:`bluetooth/bluedroid/classic_bt` folder in ESP-IDF examples, which contains the following application: - :example:`bluetooth/bluedroid/classic_bt/bt_hid_mouse_device` demonstrates how to implement a Bluetooth HID device by simulating a Bluetooth HID mouse device that periodically sends reports to a remote Bluetooth HID host.
* This is an example of Bluetooth HID mouse device. The device running this example can be discovered and connected by a Bluetooth HID Host device such as a PC, and the pointer will move left and right after HID connection is established - :example:`bluetooth/bluedroid/classic_bt/bt_hid_mouse_device` - :example:`bluetooth/esp_hid_device` demonstrates how to create a Bluetooth Classic or Bluetooth LE HID device, which can function as a mouse or a remote control, depending on the mode set by the user.
API Reference API Reference
------------- -------------

View File

@ -6,13 +6,10 @@ Overview
A Bluetooth HID host is a device or software that is capable of connecting and communicating with Bluetooth HID devices, such as keyboards, mice. Users can use the Bluetooth HID Host APIs to send output data or control commands to the HID devices, enabling them to control the behavior or settings of the devices. A Bluetooth HID host is a device or software that is capable of connecting and communicating with Bluetooth HID devices, such as keyboards, mice. Users can use the Bluetooth HID Host APIs to send output data or control commands to the HID devices, enabling them to control the behavior or settings of the devices.
Application Example Application Examples
------------------- --------------------
Check :example:`bluetooth` folder in ESP-IDF examples, which contains the following application:
* Example :example:`bluetooth/esp_hid_host` is implemented using the generic esp_hid APIs. esp_hid APIs are build upon the Bluetooth HID APIs and can be a reference.
- :example:`bluetooth/esp_hid_host` demonstrates how to use the ESP-IDF Bluetooth HID Host APIs to create a Bluetooth Classic, Bluetooth LE, or Bluetooth dual-mode HID host that scans and connects to the most recently discovered Bluetooth HID device, dumps the HID device information, and receives data sent by the HID device.
API Reference API Reference
------------- -------------

View File

@ -1,15 +1,14 @@
Classic Bluetooth® L2CAP API Classic Bluetooth® L2CAP API
============================ ============================
Application Example Application Examples
------------------- --------------------
Check :example:`bluetooth/bluedroid/classic_bt` folder in ESP-IDF examples, which contains the following application: - :example:`bluetooth/bluedroid/classic_bt/bt_l2cap_server` demonstrates how to use Logical Link Control and Adaptation Layer Protocol (L2CAP) APIs to create an L2CAP server, and wait to be discovered and connected by a remote device L2CAP client.
* This is a BT_L2CAP demo. This demo can connect, send and receive L2CAP data :example:`bluetooth/bluedroid/classic_bt/bt_l2cap_client`, :example:`bluetooth/bluedroid/classic_bt/bt_l2cap_server` - :example:`bluetooth/bluedroid/classic_bt/bt_l2cap_client` demonstrates how to use L2CAP APIs to create an L2CAP client.
API Reference API Reference
------------- -------------
.. include-build-file:: inc/esp_l2cap_bt_api.inc .. include-build-file:: inc/esp_l2cap_bt_api.inc

View File

@ -1,15 +1,16 @@
SPP API SPP API
======= =======
Application Example Application Examples
------------------- --------------------
Check :example:`bluetooth/bluedroid/classic_bt` folder in ESP-IDF examples, which contains the following application: - :example:`bluetooth/bluedroid/classic_bt/bt_spp_acceptor` demonstrates how to use Bluetooth capabilities to create a Serial Port Protocol (SPP) acceptor that acts as a server and integrate Secure Simple Pairing (SSP). This example also includes a demo for communicating with an SPP initiator that acts as a client.
* This is a SPP demo. This demo can discover the service, connect, send and receive SPP data :example:`bluetooth/bluedroid/classic_bt/bt_spp_acceptor`, :example:`bluetooth/bluedroid/classic_bt/bt_spp_initiator` - :example:`bluetooth/bluedroid/classic_bt/bt_spp_initiator` demonstrates how to use Bluetooth capabilities to create an SPP initiator that performs as a client and integrate SSP. This example also includes a demo for communicating with an SPP acceptor that acts as a server.
- :example:`bluetooth/bluedroid/classic_bt/bt_spp_vfs_initiator` demonstrates how to use SPP APIs to create an SPP initiator that acts as a client and communicates with an SPP acceptor, using Virtual File System (VFS) interface to send and receive data.
API Reference API Reference
------------- -------------
.. include-build-file:: inc/esp_spp_api.inc .. include-build-file:: inc/esp_spp_api.inc

View File

@ -6,20 +6,11 @@ GAP API
应用示例 应用示例
------------------- -------------------
以下示例及其教程存放在 ESP-IDF 项目示例的 :example:`bluetooth/bluedroid/ble` 目录下 - :example:`bluetooth/bluedroid/ble/gatt_security_client` 演示使用 ESP BLE security API{IDF_TARGET_NAME} 作为 GATT 客户端时如何建立安全连接并加密与对等设备的通信
* 以下为 SMP安全管理协议安全客户端示例及教程。该示例程序会初始化其安全参数并充当 GATT 客户端,可向对端设备发送安全请求,完成加密过程。 - :example:`bluetooth/bluedroid/ble/gatt_security_server` 演示使用 ESP BLE security API{IDF_TARGET_NAME} 作为 GATT 服务器时如何建立安全连接并加密与对等设备的通信。
- :example:`bluetooth/bluedroid/ble/gatt_security_client`
- :example_file:`GATT 安全客户端示例演示 <bluetooth/bluedroid/ble/gatt_security_client/tutorial/Gatt_Security_Client_Example_Walkthrough.md>`
* 以下为 SMP 安全服务器示例及其教程。该示例程序会初始化其安全参数,并充当 GATT 客户端,可向对端设备发送配对请求,完成加密过程。
- :example:`bluetooth/bluedroid/ble/gatt_security_server`
- :example_file:`GATT 安全服务器示例演示 <bluetooth/bluedroid/ble/gatt_security_server/tutorial/Gatt_Security_Server_Example_Walkthrough.md>`
API 参考 API 参考
------------- -------------
.. include-build-file:: inc/esp_gap_ble_api.inc .. include-build-file:: inc/esp_gap_ble_api.inc

View File

@ -6,24 +6,11 @@ GATT 服务器 API
应用示例 应用示例
------------------- -------------------
以下示例及其教程存放在 ESP-IDF 示例的 :example:`bluetooth/bluedroid/ble` 目录下: - :example:`bluetooth/bluedroid/ble/gatt_server_service_table` 演示如何使用属性表创建 GATT Service从而无需逐个添加属性。
* 以下为 GATT 服务器示例及其教程,该示例创建了一个带有属性表的 GATT 服务器,无需逐个添加属性。建议通过以下方式添加属性(官方推荐)。 - :example:`bluetooth/bluedroid/ble/gatt_server` 演示如何逐个添加属性来创建 GATT Service并开始广播以便 GATT Client 进行连接并交换数据。
- :example:`bluetooth/bluedroid/ble/gatt_server_service_table`
- :example_file:`GATT 服务器服务表示例 <bluetooth/bluedroid/ble/gatt_server_service_table/tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md>`
* 以下为 GATT 服务器示例及其教程,该示例逐个添加 Bluedroid 定义的属性,创建 GATT 服务。建议通过以下方式添加属性。
- :example:`bluetooth/bluedroid/ble/gatt_server`
- :example_file:`GATT 服务器示例 <bluetooth/bluedroid/ble/gatt_server/tutorial/Gatt_Server_Example_Walkthrough.md>`
* 以下示例与低功耗蓝牙 (Bluetooth® LE) SPP 类似。在该示例中GATT 服务器可以接收来自 UART 的数据,并将数据自动发送到对端设备。
- :example:`bluetooth/bluedroid/ble/ble_spp_server`
API 参考 API 参考
------------- -------------
.. include-build-file:: inc/esp_gatts_api.inc .. include-build-file:: inc/esp_gatts_api.inc