From aa2f136e161097880001513ff889a792911fc734 Mon Sep 17 00:00:00 2001 From: zhanghaipeng Date: Fri, 3 Jan 2025 14:23:10 +0800 Subject: [PATCH 1/2] fix(ble/bluedroid): Optimize CI configuration for Bluedroid example --- examples/bluetooth/bluedroid/ble/gatt_client/main/gattc_demo.c | 2 +- .../bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.cfg_test | 1 + .../bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_cfg_test | 1 + .../bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_init_deinit | 1 + .../bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_xtal26m | 1 + .../bluedroid/ble/gatt_client/sdkconfig.ci.init_deinit | 1 + examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.name | 1 + .../ble/gatt_security_client/sdkconfig.ci.esp32c2_xtal26m | 1 + .../bluedroid/ble/gatt_security_client/sdkconfig.ci.name | 1 + .../ble_50/ble50_security_client/sdkconfig.ci.cfg_test | 1 + .../ble_50/ble50_security_client/sdkconfig.ci.esp32c2_cfg_test | 1 + .../ble_50/ble50_security_client/sdkconfig.ci.esp32c2_xtal26m | 1 + .../bluedroid/ble_50/ble50_security_client/sdkconfig.ci.name | 1 + tools/bt/README.md | 2 +- 14 files changed, 14 insertions(+), 2 deletions(-) diff --git a/examples/bluetooth/bluedroid/ble/gatt_client/main/gattc_demo.c b/examples/bluetooth/bluedroid/ble/gatt_client/main/gattc_demo.c index 274d3df2f818..643d75d96e36 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_client/main/gattc_demo.c +++ b/examples/bluetooth/bluedroid/ble/gatt_client/main/gattc_demo.c @@ -549,7 +549,7 @@ void app_main(void) extern void bt_hci_log_hci_adv_show(void); bt_hci_log_hci_data_show(); bt_hci_log_hci_adv_show(); - vTaskDelay(1000 / portNUM_PROCESSORS); + vTaskDelay(1000 / portTICK_PERIOD_MS); } */ diff --git a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.cfg_test b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.cfg_test index 12a643ff7493..7432d2902a4f 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.cfg_test +++ b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.cfg_test @@ -1,2 +1,3 @@ CONFIG_EXAMPLE_CI_ID=4 CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} +CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=20 diff --git a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_cfg_test b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_cfg_test index ec098198ecac..17565e75c9f5 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_cfg_test +++ b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_cfg_test @@ -2,3 +2,4 @@ CONFIG_EXAMPLE_CI_ID=4 CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} +CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=20 diff --git a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_init_deinit b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_init_deinit index b160178a7f92..a2617e3e276c 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_init_deinit +++ b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_init_deinit @@ -6,3 +6,4 @@ CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y CONFIG_EXAMPLE_INIT_DEINIT_LOOP=y +CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=20 diff --git a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_xtal26m b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_xtal26m index e21eac3c2210..6dc203d0234d 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_xtal26m +++ b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.esp32c2_xtal26m @@ -2,3 +2,4 @@ CONFIG_EXAMPLE_CI_ID=3 CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} +CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=20 diff --git a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.init_deinit b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.init_deinit index 6131c64c07f7..0e2519449d6c 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.init_deinit +++ b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.init_deinit @@ -4,3 +4,4 @@ # CONFIG_BT_BLE_42_FEATURES_SUPPORTED is not set # CONFIG_BT_BLE_50_FEATURES_SUPPORTED is not set CONFIG_EXAMPLE_INIT_DEINIT_LOOP=y +CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=20 diff --git a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.name b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.name index 6d167f440e43..4e2c283ba134 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.name +++ b/examples/bluetooth/bluedroid/ble/gatt_client/sdkconfig.ci.name @@ -1,2 +1,3 @@ CONFIG_EXAMPLE_CI_ID=3 CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} +CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=20 diff --git a/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.ci.esp32c2_xtal26m b/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.ci.esp32c2_xtal26m index 18b93a65583a..2c4ef8a81026 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.ci.esp32c2_xtal26m +++ b/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.ci.esp32c2_xtal26m @@ -2,3 +2,4 @@ CONFIG_EXAMPLE_CI_ID=5 CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} +CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=20 diff --git a/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.ci.name b/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.ci.name index be962fcb8db3..41910369bfdf 100644 --- a/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.ci.name +++ b/examples/bluetooth/bluedroid/ble/gatt_security_client/sdkconfig.ci.name @@ -1,2 +1,3 @@ CONFIG_EXAMPLE_CI_ID=5 CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} +CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=20 diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.cfg_test b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.cfg_test index 63791867a24d..f39284f56031 100644 --- a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.cfg_test +++ b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.cfg_test @@ -1,2 +1,3 @@ CONFIG_EXAMPLE_CI_ID=7 CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} +CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=20 diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.esp32c2_cfg_test b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.esp32c2_cfg_test index a31340300d48..fe7be7e05081 100644 --- a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.esp32c2_cfg_test +++ b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.esp32c2_cfg_test @@ -2,3 +2,4 @@ CONFIG_EXAMPLE_CI_ID=7 CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} +CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=20 diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.esp32c2_xtal26m b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.esp32c2_xtal26m index 4f8d8a6bc038..64bdb34e61af 100644 --- a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.esp32c2_xtal26m +++ b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.esp32c2_xtal26m @@ -2,3 +2,4 @@ CONFIG_EXAMPLE_CI_ID=6 CONFIG_IDF_TARGET="esp32c2" CONFIG_XTAL_FREQ_26=y CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} +CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=20 diff --git a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.name b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.name index ea659fe46a16..52bf8c74d5c5 100644 --- a/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.name +++ b/examples/bluetooth/bluedroid/ble_50/ble50_security_client/sdkconfig.ci.name @@ -1,2 +1,3 @@ CONFIG_EXAMPLE_CI_ID=6 CONFIG_EXAMPLE_CI_PIPELINE_ID=${CI_PIPELINE_ID} +CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=20 diff --git a/tools/bt/README.md b/tools/bt/README.md index c71a7ded1bb6..1cef81710f05 100644 --- a/tools/bt/README.md +++ b/tools/bt/README.md @@ -25,7 +25,7 @@ while (1) extern void bt_hci_log_hci_adv_show(void); bt_hci_log_hci_data_show(); // Display HCI data logs bt_hci_log_hci_adv_show(); // Display HCI advertisement logs - vTaskDelay(1000 / portNUM_PROCESSORS); + vTaskDelay(1000 / portTICK_PERIOD_MS); } ``` From 0e25572b4b2d626ec871faf0c214ccc72bdf5673 Mon Sep 17 00:00:00 2001 From: zhanghaipeng Date: Fri, 3 Jan 2025 15:41:41 +0800 Subject: [PATCH 2/2] feat(ble): Add CI testing for NimBLE host in Blufi and HID examples --- .gitlab/CODEOWNERS | 1 + components/esp_hid/src/nimble_hidd.c | 2 +- examples/bluetooth/blufi/sdkconfig.ci.nimble | 3 +++ examples/bluetooth/esp_hid_device/sdkconfig.ci.nimble | 2 ++ examples/bluetooth/esp_hid_host/sdkconfig.ci.nimble | 2 ++ 5 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 examples/bluetooth/blufi/sdkconfig.ci.nimble create mode 100644 examples/bluetooth/esp_hid_device/sdkconfig.ci.nimble create mode 100644 examples/bluetooth/esp_hid_host/sdkconfig.ci.nimble diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS index 1d8ec1189c64..bbb82d4104b2 100644 --- a/.gitlab/CODEOWNERS +++ b/.gitlab/CODEOWNERS @@ -206,6 +206,7 @@ /tools/ @esp-idf-codeowners/tools /tools/ble/ @esp-idf-codeowners/app-utilities +/tools/bt/ @esp-idf-codeowners/bluetooth /tools/catch/ @esp-idf-codeowners/ci /tools/ci/ @esp-idf-codeowners/ci /tools/cmake/ @esp-idf-codeowners/build-config diff --git a/components/esp_hid/src/nimble_hidd.c b/components/esp_hid/src/nimble_hidd.c index dc37302e05f2..26bb6ea178c2 100644 --- a/components/esp_hid/src/nimble_hidd.c +++ b/components/esp_hid/src/nimble_hidd.c @@ -132,7 +132,7 @@ static int create_hid_db(int device_index) return rc; } -static int ble_hid_create_info_db() +static int ble_hid_create_info_db(void) { int rc; diff --git a/examples/bluetooth/blufi/sdkconfig.ci.nimble b/examples/bluetooth/blufi/sdkconfig.ci.nimble new file mode 100644 index 000000000000..424fa66ff656 --- /dev/null +++ b/examples/bluetooth/blufi/sdkconfig.ci.nimble @@ -0,0 +1,3 @@ +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y +CONFIG_BT_NIMBLE_BLUFI_ENABLE=y diff --git a/examples/bluetooth/esp_hid_device/sdkconfig.ci.nimble b/examples/bluetooth/esp_hid_device/sdkconfig.ci.nimble new file mode 100644 index 000000000000..a22d8109d7d5 --- /dev/null +++ b/examples/bluetooth/esp_hid_device/sdkconfig.ci.nimble @@ -0,0 +1,2 @@ +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y diff --git a/examples/bluetooth/esp_hid_host/sdkconfig.ci.nimble b/examples/bluetooth/esp_hid_host/sdkconfig.ci.nimble new file mode 100644 index 000000000000..a22d8109d7d5 --- /dev/null +++ b/examples/bluetooth/esp_hid_host/sdkconfig.ci.nimble @@ -0,0 +1,2 @@ +CONFIG_BT_ENABLED=y +CONFIG_BT_NIMBLE_ENABLED=y