From 85b66801b15593febf17f3b7b43ba81affdd20dc Mon Sep 17 00:00:00 2001 From: Chinmay Chhajed Date: Wed, 13 Nov 2019 12:58:11 +0530 Subject: [PATCH 1/3] Moved HCI examples from bluetooth/bluedroid/hci to bluetooth/hci. --- .../{bluedroid => }/hci/controller_hci_uart/CMakeLists.txt | 0 .../bluetooth/{bluedroid => }/hci/controller_hci_uart/Makefile | 0 .../bluetooth/{bluedroid => }/hci/controller_hci_uart/README.md | 0 .../{bluedroid => }/hci/controller_hci_uart/main/CMakeLists.txt | 0 .../{bluedroid => }/hci/controller_hci_uart/main/component.mk | 0 .../hci/controller_hci_uart/main/controller_hci_uart_demo.c | 0 .../{bluedroid => }/hci/controller_hci_uart/sdkconfig.defaults | 0 .../{bluedroid => }/hci/controller_vhci_ble_adv/CMakeLists.txt | 0 .../{bluedroid => }/hci/controller_vhci_ble_adv/Makefile | 0 .../{bluedroid => }/hci/controller_vhci_ble_adv/README.md | 0 .../hci/controller_vhci_ble_adv/main/CMakeLists.txt | 0 .../{bluedroid => }/hci/controller_vhci_ble_adv/main/app_bt.c | 0 .../{bluedroid => }/hci/controller_vhci_ble_adv/main/component.mk | 0 .../hci/controller_vhci_ble_adv/sdkconfig.defaults | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename examples/bluetooth/{bluedroid => }/hci/controller_hci_uart/CMakeLists.txt (100%) rename examples/bluetooth/{bluedroid => }/hci/controller_hci_uart/Makefile (100%) rename examples/bluetooth/{bluedroid => }/hci/controller_hci_uart/README.md (100%) rename examples/bluetooth/{bluedroid => }/hci/controller_hci_uart/main/CMakeLists.txt (100%) rename examples/bluetooth/{bluedroid => }/hci/controller_hci_uart/main/component.mk (100%) rename examples/bluetooth/{bluedroid => }/hci/controller_hci_uart/main/controller_hci_uart_demo.c (100%) rename examples/bluetooth/{bluedroid => }/hci/controller_hci_uart/sdkconfig.defaults (100%) rename examples/bluetooth/{bluedroid => }/hci/controller_vhci_ble_adv/CMakeLists.txt (100%) rename examples/bluetooth/{bluedroid => }/hci/controller_vhci_ble_adv/Makefile (100%) rename examples/bluetooth/{bluedroid => }/hci/controller_vhci_ble_adv/README.md (100%) rename examples/bluetooth/{bluedroid => }/hci/controller_vhci_ble_adv/main/CMakeLists.txt (100%) rename examples/bluetooth/{bluedroid => }/hci/controller_vhci_ble_adv/main/app_bt.c (100%) rename examples/bluetooth/{bluedroid => }/hci/controller_vhci_ble_adv/main/component.mk (100%) rename examples/bluetooth/{bluedroid => }/hci/controller_vhci_ble_adv/sdkconfig.defaults (100%) diff --git a/examples/bluetooth/bluedroid/hci/controller_hci_uart/CMakeLists.txt b/examples/bluetooth/hci/controller_hci_uart/CMakeLists.txt similarity index 100% rename from examples/bluetooth/bluedroid/hci/controller_hci_uart/CMakeLists.txt rename to examples/bluetooth/hci/controller_hci_uart/CMakeLists.txt diff --git a/examples/bluetooth/bluedroid/hci/controller_hci_uart/Makefile b/examples/bluetooth/hci/controller_hci_uart/Makefile similarity index 100% rename from examples/bluetooth/bluedroid/hci/controller_hci_uart/Makefile rename to examples/bluetooth/hci/controller_hci_uart/Makefile diff --git a/examples/bluetooth/bluedroid/hci/controller_hci_uart/README.md b/examples/bluetooth/hci/controller_hci_uart/README.md similarity index 100% rename from examples/bluetooth/bluedroid/hci/controller_hci_uart/README.md rename to examples/bluetooth/hci/controller_hci_uart/README.md diff --git a/examples/bluetooth/bluedroid/hci/controller_hci_uart/main/CMakeLists.txt b/examples/bluetooth/hci/controller_hci_uart/main/CMakeLists.txt similarity index 100% rename from examples/bluetooth/bluedroid/hci/controller_hci_uart/main/CMakeLists.txt rename to examples/bluetooth/hci/controller_hci_uart/main/CMakeLists.txt diff --git a/examples/bluetooth/bluedroid/hci/controller_hci_uart/main/component.mk b/examples/bluetooth/hci/controller_hci_uart/main/component.mk similarity index 100% rename from examples/bluetooth/bluedroid/hci/controller_hci_uart/main/component.mk rename to examples/bluetooth/hci/controller_hci_uart/main/component.mk diff --git a/examples/bluetooth/bluedroid/hci/controller_hci_uart/main/controller_hci_uart_demo.c b/examples/bluetooth/hci/controller_hci_uart/main/controller_hci_uart_demo.c similarity index 100% rename from examples/bluetooth/bluedroid/hci/controller_hci_uart/main/controller_hci_uart_demo.c rename to examples/bluetooth/hci/controller_hci_uart/main/controller_hci_uart_demo.c diff --git a/examples/bluetooth/bluedroid/hci/controller_hci_uart/sdkconfig.defaults b/examples/bluetooth/hci/controller_hci_uart/sdkconfig.defaults similarity index 100% rename from examples/bluetooth/bluedroid/hci/controller_hci_uart/sdkconfig.defaults rename to examples/bluetooth/hci/controller_hci_uart/sdkconfig.defaults diff --git a/examples/bluetooth/bluedroid/hci/controller_vhci_ble_adv/CMakeLists.txt b/examples/bluetooth/hci/controller_vhci_ble_adv/CMakeLists.txt similarity index 100% rename from examples/bluetooth/bluedroid/hci/controller_vhci_ble_adv/CMakeLists.txt rename to examples/bluetooth/hci/controller_vhci_ble_adv/CMakeLists.txt diff --git a/examples/bluetooth/bluedroid/hci/controller_vhci_ble_adv/Makefile b/examples/bluetooth/hci/controller_vhci_ble_adv/Makefile similarity index 100% rename from examples/bluetooth/bluedroid/hci/controller_vhci_ble_adv/Makefile rename to examples/bluetooth/hci/controller_vhci_ble_adv/Makefile diff --git a/examples/bluetooth/bluedroid/hci/controller_vhci_ble_adv/README.md b/examples/bluetooth/hci/controller_vhci_ble_adv/README.md similarity index 100% rename from examples/bluetooth/bluedroid/hci/controller_vhci_ble_adv/README.md rename to examples/bluetooth/hci/controller_vhci_ble_adv/README.md diff --git a/examples/bluetooth/bluedroid/hci/controller_vhci_ble_adv/main/CMakeLists.txt b/examples/bluetooth/hci/controller_vhci_ble_adv/main/CMakeLists.txt similarity index 100% rename from examples/bluetooth/bluedroid/hci/controller_vhci_ble_adv/main/CMakeLists.txt rename to examples/bluetooth/hci/controller_vhci_ble_adv/main/CMakeLists.txt diff --git a/examples/bluetooth/bluedroid/hci/controller_vhci_ble_adv/main/app_bt.c b/examples/bluetooth/hci/controller_vhci_ble_adv/main/app_bt.c similarity index 100% rename from examples/bluetooth/bluedroid/hci/controller_vhci_ble_adv/main/app_bt.c rename to examples/bluetooth/hci/controller_vhci_ble_adv/main/app_bt.c diff --git a/examples/bluetooth/bluedroid/hci/controller_vhci_ble_adv/main/component.mk b/examples/bluetooth/hci/controller_vhci_ble_adv/main/component.mk similarity index 100% rename from examples/bluetooth/bluedroid/hci/controller_vhci_ble_adv/main/component.mk rename to examples/bluetooth/hci/controller_vhci_ble_adv/main/component.mk diff --git a/examples/bluetooth/bluedroid/hci/controller_vhci_ble_adv/sdkconfig.defaults b/examples/bluetooth/hci/controller_vhci_ble_adv/sdkconfig.defaults similarity index 100% rename from examples/bluetooth/bluedroid/hci/controller_vhci_ble_adv/sdkconfig.defaults rename to examples/bluetooth/hci/controller_vhci_ble_adv/sdkconfig.defaults From a104bc22ae8ac9bb6e5a06bba3edebb47506913f Mon Sep 17 00:00:00 2001 From: Chinmay Chhajed Date: Wed, 13 Nov 2019 15:18:14 +0530 Subject: [PATCH 2/3] README fixes --- examples/README.md | 1 + examples/bluetooth/bluedroid/README.md | 1 - examples/bluetooth/hci/README.md | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 examples/bluetooth/hci/README.md diff --git a/examples/README.md b/examples/README.md index 9728c32166..240e270384 100644 --- a/examples/README.md +++ b/examples/README.md @@ -9,6 +9,7 @@ The examples are grouped into subdirectories by category. Each category director * `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. +* `bluetooth/hci` contains HCI transport (VHCI and HCI UART) examples * `ethernet` contains Ethernet examples. * `get-started` contains some very simple examples with minimal functionality. * `mesh` contains Wi-Fi Mesh examples. diff --git a/examples/bluetooth/bluedroid/README.md b/examples/bluetooth/bluedroid/README.md index f7173737ba..9a8aa7f176 100644 --- a/examples/bluetooth/bluedroid/README.md +++ b/examples/bluetooth/bluedroid/README.md @@ -8,6 +8,5 @@ The examples are grouped into subdirectories by category. Each category director * `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. diff --git a/examples/bluetooth/hci/README.md b/examples/bluetooth/hci/README.md new file mode 100644 index 0000000000..fd263246dc --- /dev/null +++ b/examples/bluetooth/hci/README.md @@ -0,0 +1,19 @@ +# Bluetooth Examples for Bluedroid host + +Note: To use examples in this directory, you need to have Bluetooth enabled in configuration. + +# Example Layout + +This directory includes examples to demonstrate controller interactions by virtual HCI layer and UART. + +## controller_hci_uart + +Demonstrates interaction with controller through HCI over UART. + +See the [README.md](./controller_hci_uart/README.md) file in the example [controller_hci_uart](./controller_hci_uart). + +## controller_vhci_ble_adv + +Demonstrates interaction with controller though virtual HCI layer. In this example, simple BLE advertising is done. + +See the [README.md](./controller_vhci_ble_adv/README.md) file in the example [controller_vhci_ble_adv](./controller_vhci_ble_adv). From 6a91c8d440074cbf3b22d14044ecf9134eb12758 Mon Sep 17 00:00:00 2001 From: Chinmay Chhajed Date: Wed, 13 Nov 2019 16:56:23 +0530 Subject: [PATCH 3/3] Changes in `menuconfig` options to not compile any host when using hci examples as no host is required there. --- components/bt/Kconfig | 7 +++++++ examples/bluetooth/hci/README.md | 2 +- .../bluetooth/hci/controller_hci_uart/sdkconfig.defaults | 1 + .../hci/controller_vhci_ble_adv/sdkconfig.defaults | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/components/bt/Kconfig b/components/bt/Kconfig index dfde444c7a..62223fe12b 100644 --- a/components/bt/Kconfig +++ b/components/bt/Kconfig @@ -394,6 +394,13 @@ menu "Bluetooth" help This option is recommended for BLE only usecases to save on memory + config BT_CONTROLLER_ONLY + bool "Controller Only" + help + This option is recommended when you want to communicate directly with the + controller (without any host) or when you are using any other host stack + not supported by Espressif (not mentioned here). + endchoice menu "Bluedroid Options" diff --git a/examples/bluetooth/hci/README.md b/examples/bluetooth/hci/README.md index fd263246dc..41be804912 100644 --- a/examples/bluetooth/hci/README.md +++ b/examples/bluetooth/hci/README.md @@ -1,4 +1,4 @@ -# Bluetooth Examples for Bluedroid host +# Bluetooth Examples for Host Controller Interface Note: To use examples in this directory, you need to have Bluetooth enabled in configuration. diff --git a/examples/bluetooth/hci/controller_hci_uart/sdkconfig.defaults b/examples/bluetooth/hci/controller_hci_uart/sdkconfig.defaults index f4ece755b7..798c444b50 100644 --- a/examples/bluetooth/hci/controller_hci_uart/sdkconfig.defaults +++ b/examples/bluetooth/hci/controller_hci_uart/sdkconfig.defaults @@ -12,6 +12,7 @@ CONFIG_BTDM_CTRL_BLE_MAX_CONN=9 CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN=7 CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN=3 CONFIG_BT_BLUEDROID_ENABLED=n +CONFIG_BT_CONTROLLER_ONLY=y CONFIG_BT_HCI_UART=y CONFIG_BT_HCI_UART_NO_DEFAULT=1 CONFIG_BT_HCI_UART_BAUDRATE_DEFAULT=921600 diff --git a/examples/bluetooth/hci/controller_vhci_ble_adv/sdkconfig.defaults b/examples/bluetooth/hci/controller_vhci_ble_adv/sdkconfig.defaults index 3bad2fdeed..3b0474335e 100644 --- a/examples/bluetooth/hci/controller_vhci_ble_adv/sdkconfig.defaults +++ b/examples/bluetooth/hci/controller_vhci_ble_adv/sdkconfig.defaults @@ -8,3 +8,5 @@ CONFIG_BT_ENABLED=y CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n CONFIG_BTDM_CTRL_MODE_BTDM=n +CONFIG_BT_BLUEDROID_ENABLED=n +CONFIG_BT_CONTROLLER_ONLY=y