Application Example
-------------------
-Check :example:`bluetooth` folder in ESP-IDF examples, which contains the following application:
+Check :example:`bluetooth/bluedroid/hci` folder in ESP-IDF examples, which contains the following application:
-* This is a BLE advertising demo with virtual HCI interface. Send Reset/ADV_PARAM/ADV_DATA/ADV_ENABLE HCI command for BLE advertising - :example:`bluetooth/ble_adv`.
+* This is a BLE advertising demo with virtual HCI interface. Send Reset/ADV_PARAM/ADV_DATA/ADV_ENABLE HCI command for BLE advertising - :example:`bluetooth/bluedroid/hci/controller_vhci_ble_adv`.
API Reference
-------------
Application Example
-------------------
-Check :example:`bluetooth` folder in ESP-IDF examples, which contains the following application:
+Check :example:`bluetooth/bluedroid/classic_bt` folder in ESP-IDF examples, which contains the following application:
-* 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/a2dp_sink`
+* 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`
API Reference
-------------
Application Example
-------------------
-Check :example:`bluetooth` folder in ESP-IDF examples, which contains the following application:
+Check :example:`bluetooth/bluedroid/ble` folder in ESP-IDF examples, which contains the following application:
-* This is a BLUFI demo. This demo can set ESP32's wifi to softap/station/softap&station mode and config wifi connections - :example:`bluetooth/blufi`
+* This is the BLUFI demo. This demo can set ESP32's wifi to softap/station/softap&station mode and config wifi connections - :example:`bluetooth/bluedroid/ble/blufi`
API Reference
-------------
Application Example
-------------------
-Check :example:`bluetooth` folder in ESP-IDF examples, which contains the following demos and their tutorials:
+Check :example:`bluetooth/bluedroid/ble` folder in ESP-IDF examples, which contains the following demos and their tutorials:
* This is a SMP security client demo and 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/gatt_security_client`
- - :example_file:`GATT Security Client Example Walkthrough <bluetooth/gatt_security_client/tutorial/Gatt_Security_Client_Example_Walkthrough.md>`
+ - :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>`
* This is a SMP security server demo and 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/gatt_security_server`
- - :example_file:`GATT Security Server Example Walkthrough <bluetooth/gatt_security_server/tutorial/Gatt_Security_Server_Example_Walkthrough.md>`
+ - :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
-------------
Application Example
-------------------
-Check :example:`bluetooth` folder in ESP-IDF examples, which contains the following demos and their tutorials:
+Check :example:`bluetooth/bluedroid/ble` folder in ESP-IDF examples, which contains the following demos and their tutorials:
* 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/gatt_client`
- - :example_file:`GATT Client Example Walkthrough <bluetooth/gatt_client/tutorial/Gatt_Client_Example_Walkthrough.md>`
+ - :example:`bluetooth/bluedroid/ble/gatt_client`
+ - :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/gattc_multi_connect`
- - :example_file:`GATT Client Multi-connection Example Walkthrough <bluetooth/gattc_multi_connect/tutorial/Gatt_Client_Multi_Connection_Example_Walkthrough.md>`
+ - :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 BLE SPP-Like demo. 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/ble_spp_client`
+ - :example:`bluetooth/bluedroid/ble/ble_spp_client`
API Reference
-------------
Application Example
-------------------
-Check :example:`bluetooth` folder in ESP-IDF examples, which contains the following demos and their tutorials:
+Check :example:`bluetooth/bluedroid/ble` folder in ESP-IDF examples, which contains the following demos and their tutorials:
* This is a GATT sever demo and its tutorial. This demo creates a GATT service with an attribute table, which releases the user from adding attributes one by one. This is the recommended method of adding attributes.
- - :example:`bluetooth/gatt_server_service_table`
- - :example_file:`GATT Server Service Table Example Walkthrough <bluetooth/gatt_server_service_table/tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md>`
+ - :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 example above.
- - :example:`bluetooth/gatt_server`
- - :example_file:`GATT Server Example Walkthrough <bluetooth/gatt_server/tutorial/Gatt_Server_Example_Walkthrough.md>`
+ - :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 BLE SPP-Like demo. This demo, which acts as a GATT server, can receive data from UART and then send the data to the peer device automatically.
- - :example:`bluetooth/ble_spp_server`
+ - :example:`bluetooth/bluedroid/ble/ble_spp_server`
API Reference
-------------
Application Example
-------------------
-Check :example:`bluetooth` folder in ESP-IDF examples, which contains the following application:
+Check :example:`bluetooth/bluedroid/classic_bt` folder in ESP-IDF examples, which contains the following application:
-* This is a SPP demo. This demo can discover the service, connect, send and recive SPP data :example:`bluetooth/bt_spp_acceptor`, :example:`bluetooth/bt_spp_initiator`
+* This is a SPP demo. This demo can discover the service, connect, send and recive SPP data :example:`bluetooth/bluedroid/classic_bt/bt_spp_acceptor`, :example:`bluetooth/bluedroid/classic_bt/bt_spp_initiator`
API Reference
-------------
* `ESP32 Bluetooth Architecture (PDF) [English] <http://espressif.com/sites/default/files/documentation/esp32_bluetooth_architecture_en.pdf>`_
* `ESP32 Bluetooth Architecture (PDF) [中文] <http://espressif.com/sites/default/files/documentation/esp32_bluetooth_architecture_cn.pdf>`_
-Code examples for this API section are provided in the :example:`bluetooth` directory of ESP-IDF examples.
+Code examples for this API section are provided in the :example:`bluetooth/bluedroid` directory of ESP-IDF examples.
The following examples contain detailed walkthroughs:
-* :example_file:`GATT Client Example Walkthrough <bluetooth/gatt_client/tutorial/Gatt_Client_Example_Walkthrough.md>`
-* :example_file:`GATT Server Service Table Example Walkthrough <bluetooth/gatt_server_service_table/tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md>`
-* :example_file:`GATT Server Example Walkthrough <bluetooth/gatt_server/tutorial/Gatt_Server_Example_Walkthrough.md>`
-* :example_file:`GATT Security Client Example Walkthrough <bluetooth/gatt_security_client/tutorial/Gatt_Security_Client_Example_Walkthrough.md>`
-* :example_file:`GATT Security Server Example Walkthrough <bluetooth/gatt_security_server/tutorial/Gatt_Security_Server_Example_Walkthrough.md>`
-* :example_file:`GATT Client Multi-connection Example Walkthrough <bluetooth/gattc_multi_connect/tutorial/Gatt_Client_Multi_Connection_Example_Walkthrough.md>`
+* :example_file:`GATT Client Example Walkthrough <bluetooth/bluedroid/ble/gatt_client/tutorial/Gatt_Client_Example_Walkthrough.md>`
+* :example_file:`GATT Server Service Table Example Walkthrough <bluetooth/bluedroid/ble/gatt_server_service_table/tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md>`
+* :example_file:`GATT Server Example Walkthrough <bluetooth/bluedroid/ble/gatt_server/tutorial/Gatt_Server_Example_Walkthrough.md>`
+* :example_file:`GATT Security Client Example Walkthrough <bluetooth/bluedroid/ble/gatt_security_client/tutorial/Gatt_Security_Client_Example_Walkthrough.md>`
+* :example_file:`GATT Security Server Example Walkthrough <bluetooth/bluedroid/ble/gatt_security_server/tutorial/Gatt_Security_Server_Example_Walkthrough.md>`
+* :example_file:`GATT Client Multi-connection Example Walkthrough <bluetooth/bluedroid/ble/gattc_multi_connect/tutorial/Gatt_Client_Multi_Connection_Example_Walkthrough.md>`
`ESP32 蓝牙架构 (PDF) <http://espressif.com/sites/default/files/documentation/esp32_bluetooth_architecture_cn.pdf>`_
-蓝牙 API 的示例代码存放于 ESP-IDF :example:`bluetooth` 示例目录下,请查看。
+蓝牙 API 的示例代码存放于 ESP-IDF :example:`bluetooth/bluedroid` 示例目录下,请查看。
下面的示例给出了详细介绍:
-* :example_file:`GATT 客户端示例 <bluetooth/gatt_client/tutorial/Gatt_Client_Example_Walkthrough.md>`
-* :example_file:`GATT 服务端服务表格示例 <bluetooth/gatt_server_service_table/tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md>`
-* :example_file:`GATT 服务端示例 <bluetooth/gatt_server/tutorial/Gatt_Server_Example_Walkthrough.md>`
-* :example_file:`GATT 客户端安全性示例 <bluetooth/gatt_security_client/tutorial/Gatt_Security_Client_Example_Walkthrough.md>`
-* :example_file:`GATT 服务端安全性示例 <bluetooth/gatt_security_server/tutorial/Gatt_Security_Server_Example_Walkthrough.md>`
-* :example_file:`GATT 客户端多连接示例 <bluetooth/gattc_multi_connect/tutorial/Gatt_Client_Multi_Connection_Example_Walkthrough.md>`
+* :example_file:`GATT 客户端示例 <bluetooth/bluedroid/ble/gatt_client/tutorial/Gatt_Client_Example_Walkthrough.md>`
+* :example_file:`GATT 服务端服务表格示例 <bluetooth/bluedroid/ble/gatt_server_service_table/tutorial/Gatt_Server_Service_Table_Example_Walkthrough.md>`
+* :example_file:`GATT 服务端示例 <bluetooth/bluedroid/ble/gatt_server/tutorial/Gatt_Server_Example_Walkthrough.md>`
+* :example_file:`GATT 客户端安全性示例 <bluetooth/bluedroid/ble/gatt_security_client/tutorial/Gatt_Security_Client_Example_Walkthrough.md>`
+* :example_file:`GATT 服务端安全性示例 <bluetooth/bluedroid/ble/gatt_security_server/tutorial/Gatt_Security_Server_Example_Walkthrough.md>`
+* :example_file:`GATT 客户端多连接示例 <bluetooth/bluedroid/ble/gattc_multi_connect/tutorial/Gatt_Client_Multi_Connection_Example_Walkthrough.md>`
The examples are grouped into subdirectories by category. Each category directory contains one or more example projects:
-* `bluetooth` contains Bluetooth (BLE & BT Classic) examples using default Bluedroid host stack.
-* `bleutooth/nimble` contains BLE examples using NimBLE host stack
+* `bluetooth/bluedroid` contains Classic BT, BLE and coex examples using default Bluedroid host stack.
+* `bluetooth/nimble` contains BLE examples using NimBLE host stack.
+* `bluetooth/esp_ble_mesh` contains ESP BLE Mesh examples.
* `ethernet` contains Ethernet examples.
* `get-started` contains some very simple examples with minimal functionality.
* `mesh` contains Wi-Fi Mesh examples.
+++ /dev/null
-# Bluetooth Examples
-
-Note: To use examples in this directory, you need to have Bluetooth enabled in configuration. Run `make menuconfig`, go to `Component config` and verify if you see `[*] Bluetooth`. If not - enable it and save.
-
-See the [README.md](../README.md) file in the upper level [examples](../) directory for more information about examples.
--- /dev/null
+# Bluetooth Examples for Bluedroid host
+
+Note: To use examples in this directory, you need to have Bluetooth enabled in configuration and Bluedroid selected as the host stack.
+
+# Example Layout
+
+The examples are grouped into subdirectories by category. Each category directory contains one or more example projects:
+* `classic_bt` contains Classic BT examples
+* `ble` contains BLE examples
+* `coex` contains Classic BT and BLE coex examples
+* `hci` contains HCI transport (VHCI and HCI UART) examples
+
+See the [README.md](../../README.md) file in the upper level [examples](../../) directory for more information about examples.
### What You Need
-* ESP device which needs to flash [this test program] (https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/ble_compatibility_test/main/ble_compatibility_test.c)
+* ESP device which needs to flash [this test program] (https://github.com/espressif/esp-idf/blob/master/examples/bluetooth/bluedroid/ble/ble_compatibility_test/main/ble_compatibility_test.c)
* Smartphone with LightBlue® Explorer app
### Initialization
</tr>
<tr>
<td>Test Demo:</td>
- <td colspan="13">https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/ble_compatibility_test</td>
+ <td colspan="13">https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/bluedroid/ble/ble_compatibility_test</td>
</tr>
<tr>
<td rowspan="2"><font size="1">Phone Brand</td>
# Includes
-This example is located in the examples folder of the ESP-IDF under the [bluetooth/gatt_client/main](../main). The [gattc_demo.c](../main/gattc_demo.c) file located in the main folder contains all the functionality that we are going to review. The header files contained in [gattc_demo.c](../main/gattc_demo.c) are:
+This example is located in the examples folder of the ESP-IDF under the [bluetooth/bluedroid/ble/gatt_client/main](../main). The [gattc_demo.c](../main/gattc_demo.c) file located in the main folder contains all the functionality that we are going to review. The header files contained in [gattc_demo.c](../main/gattc_demo.c) are:
```c
#include <stdint.h>
## Getting Characteristics
-This examples implements getting characteristic data from a predefined service. The service that we want the characteristics from has an UUID of 0x00FF, and the characteristic we are interested in has an UUID of 0xFF01:
+This example implements getting characteristic data from a predefined service. The service that we want the characteristics from has an UUID of 0x00FF, and the characteristic we are interested in has an UUID of 0xFF01:
```c
#define REMOTE_NOTIFY_CHAR_UUID 0xFF01
Four ESP32 devices are needed in order to demonstrate this example, among which:
* one would be employed as a GATT Client flashed with the [gattc_multi_connect](../../gattc_multi_connect) demo, and,
-* the rest run as GATT servers flashed with the [gatt_server](../../gatt_server) demo of the ESP-IDF Bluetooth examples folder.
+* the rest run as GATT servers flashed with the [gatt_server](../../gatt_server) demo of the ESP-IDF examples/bluetooth/bluedroid/ble folder.
<div align="center"><img src="image/Multi_Connection_GATT_Client_Flowchart.png" width = "800" alt="Multi-Connection GATT Client Flowchart" align=center/></div>
-ESP-IDF ble_advertising app
-====================
+ESP-IDF VHCI ble_advertising app
+================================
This is a BLE advertising demo with virtual HCI interface. Send Reset/ADV_PARAM/ADV_DATA/ADV_ENABLE HCI command for BLE advertising.
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
-set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/bluetooth/ble_mesh/ble_mesh_vendor_models/fast_prov_vendor_model/components)
+set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_models/fast_prov_vendor_model/components)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(ble_mesh_fast_prov_client)
COMPONENT_ADD_INCLUDEDIRS := components/include
-EXTRA_COMPONENT_DIRS := $(IDF_PATH)/examples/bluetooth/ble_mesh/ble_mesh_vendor_models/fast_prov_vendor_model/components
+EXTRA_COMPONENT_DIRS := $(IDF_PATH)/examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_models/fast_prov_vendor_model/components
include $(IDF_PATH)/make/project.mk
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
-set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/bluetooth/ble_mesh/ble_mesh_vendor_models/fast_prov_vendor_model/components)
+set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_models/fast_prov_vendor_model/components)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(ble_mesh_fast_prov_server)
COMPONENT_ADD_INCLUDEDIRS := components/include
-EXTRA_COMPONENT_DIRS := $(IDF_PATH)/examples/bluetooth/ble_mesh/ble_mesh_vendor_models/fast_prov_vendor_model/components
+EXTRA_COMPONENT_DIRS := $(IDF_PATH)/examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_models/fast_prov_vendor_model/components
include $(IDF_PATH)/make/project.mk
> Note:
>
-> 1. Please flash the [`ble_mesh_fast_prov_server`](https://glab.espressif.cn/ble_mesh/esp-ble-mesh-v0.6/tree/ble_mesh_release/esp-ble-mesh-v0.6/examples/bluetooth/ble_mesh/ble_mesh_fast_provision/ble_mesh_fast_prov_server) to your boards first;
+> 1. Please flash the [`ble_mesh_fast_prov_server`](https://glab.espressif.cn/ble_mesh/esp-ble-mesh-v0.6/tree/ble_mesh_release/esp-ble-mesh-v0.6/examples/bluetooth/esp_ble_mesh/ble_mesh_fast_provision/ble_mesh_fast_prov_server) to your boards first;
> 2. To have a better understanding of the performance of the BLE Mesh network, we recommend that at least 3 devices should be added in your network.
> 3. We recommend that you solder LED indicators if your development board does not come with lights.
> 4. Please check the type of board and LED pin definition enabled in `Example BLE Mesh Config` by running `make menuconfig`
# Flash and Monitor
1. Enter the directory:
-examples/bluetooth/ble_mesh/ble_mesh_fast_provision/ble_mesh_fast_prov_server
+examples/bluetooth/esp_ble_mesh/ble_mesh_fast_provision/ble_mesh_fast_prov_server
2. Make sure that the `IDF_PATH` environment variable was set in accordance with your current IDF path
3. Check the version of your toolchain. Version 4.1 or newer should be used.
The folder `ble_mesh_node` contains the following files and subfolders:
```
-$ tree examples/bluetooth/ble_mesh/ble_mesh/ble_mesh_node
+$ tree examples/bluetooth/esp_ble_mesh/ble_mesh/ble_mesh_node
├── Makefile /* Compiling parameters for the demo */
├── README.md /* Quick start guide */
├── build
- **Support for Light Lightness Client Model**: Indicates if the given model is supported.
- **Support for Light CTL Client Model**: Indicates if the given model is supported.
- **Support for Light HSL Client Model**: Indicates if the given model is supported.
-- **Enable Bluetooth Mesh shell**:
\ No newline at end of file
+- **Enable Bluetooth Mesh shell**:
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
-set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/bluetooth/ble_mesh/ble_mesh_vendor_models/fast_prov_vendor_model/components)
+set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_models/fast_prov_vendor_model/components)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(ble_mesh_wifi_coexist)
COMPONENT_ADD_INCLUDEDIRS := components/include
-EXTRA_COMPONENT_DIRS := $(IDF_PATH)/examples/bluetooth/ble_mesh/ble_mesh_vendor_models/fast_prov_vendor_model/components
+EXTRA_COMPONENT_DIRS := $(IDF_PATH)/examples/bluetooth/esp_ble_mesh/ble_mesh_vendor_models/fast_prov_vendor_model/components
include $(IDF_PATH)/make/project.mk
The `ble_mesh_wifi_coexist` demo contains the following files and subfolders:
```
-$ tree examples/bluetooth/ble_mesh/ble_mesh/ble_mesh_wifi_coexist
+$ tree examples/bluetooth/esp_ble_mesh/ble_mesh/ble_mesh_wifi_coexist
├── main /* Stores the `.c` and `.h` application code files for this demo */
├── components /* Stores the `.c` and `.h` iperf code files for this demo */
├── Makefile /* Compiling parameters for the demo */
-# NimBLE Examples
+# Bluetooth Examples for NimBLE host
+
+Note: To use examples in this directory, you need to have Bluetooth enabled in configuration and NimBLE selected as the host stack.
+
+# Example Layout
This directory includes examples to demonstrate BLE functionality using Apache MyNewt NimBLE (https://github.com/apache/mynewt-nimble) host stack.