From 0e0ac035dd9e5f288d2e6e9d88662e29d761efdb Mon Sep 17 00:00:00 2001 From: Roshan Bangar Date: Tue, 12 Mar 2024 16:20:08 +0530 Subject: [PATCH 01/12] fix(nimble): Fixed compilation issues on disabling security --- components/bt/host/nimble/Kconfig.in | 3 +- components/bt/host/nimble/nimble | 2 +- .../host/nimble/port/include/esp_nimble_cfg.h | 29 +++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/components/bt/host/nimble/Kconfig.in b/components/bt/host/nimble/Kconfig.in index 442c485d53..06ec1dca11 100644 --- a/components/bt/host/nimble/Kconfig.in +++ b/components/bt/host/nimble/Kconfig.in @@ -632,8 +632,9 @@ config BT_NIMBLE_PERIODIC_ADV_ENH menuconfig BT_NIMBLE_GATT_CACHING bool "Enable GATT caching" depends on BT_NIMBLE_ENABLED && BT_NIMBLE_50_FEATURE_SUPPORT + select BT_NIMBLE_DYNAMIC_SERVICE help - Enable GATT caching + Enable GATT caching config BT_NIMBLE_GATT_CACHING_MAX_CONNS int "Maximum connections to be cached" depends on BT_NIMBLE_GATT_CACHING diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index 299279a467..c0dd77a835 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit 299279a46795a6de44c2683cae6f85e0c68cb551 +Subproject commit c0dd77a8355dd82d0bc1b501e6d118a91eb14df1 diff --git a/components/bt/host/nimble/port/include/esp_nimble_cfg.h b/components/bt/host/nimble/port/include/esp_nimble_cfg.h index 6d2a9cf8aa..6a47d90f1d 100644 --- a/components/bt/host/nimble/port/include/esp_nimble_cfg.h +++ b/components/bt/host/nimble/port/include/esp_nimble_cfg.h @@ -133,10 +133,31 @@ #define MYNEWT_VAL_BLE_GATT_CACHING (0) #else #define MYNEWT_VAL_BLE_GATT_CACHING (CONFIG_BT_NIMBLE_GATT_CACHING) + +#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CONNS #define MYNEWT_VAL_BLE_GATT_CACHING_MAX_CONNS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CONNS) +#else +#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_CONNS (0) +#endif + +#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_MAX_SVCS #define MYNEWT_VAL_BLE_GATT_CACHING_MAX_SVCS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_SVCS) +#else +#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_SVCS (0) +#endif + +#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CHRS #define MYNEWT_VAL_BLE_GATT_CACHING_MAX_CHRS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CHRS) +#else +#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_CHRS (0) +#endif + +#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_MAX_DSCS #define MYNEWT_VAL_BLE_GATT_CACHING_MAX_DSCS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_DSCS) +#else +#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_DSCS (0) +#endif + #endif #ifndef CONFIG_BT_NIMBLE_MAX_EXT_ADV_INSTANCES @@ -487,7 +508,11 @@ /*** @apache-mynewt-nimble/nimble/host */ #ifndef MYNEWT_VAL_BLE_DYNAMIC_SERVICE +#ifdef CONFIG_BT_NIMBLE_DYNAMIC_SERVICE #define MYNEWT_VAL_BLE_DYNAMIC_SERVICE CONFIG_BT_NIMBLE_DYNAMIC_SERVICE +#else +#define MYNEWT_VAL_BLE_DYNAMIC_SERVICE (0) +#endif #endif #ifndef MYNEWT_VAL_BLE_ATT_PREFERRED_MTU @@ -848,7 +873,11 @@ #ifndef MYNEWT_VAL_BLE_SM_SC_LVL +#ifdef CONFIG_BT_NIMBLE_SM_SC_LVL #define MYNEWT_VAL_BLE_SM_SC_LVL CONFIG_BT_NIMBLE_SM_SC_LVL +#else +#define MYNEWT_VAL_BLE_SM_SC_LVL (0) +#endif #endif #ifndef MYNEWT_VAL_BLE_SM_SC_ONLY From a51364c76f77a95fb1cad0c6cc4007e3f376788a Mon Sep 17 00:00:00 2001 From: Roshan Bangar Date: Thu, 14 Mar 2024 16:25:16 +0530 Subject: [PATCH 02/12] fix(nimble): Fix compilation issues and Minor enhancements to esp_hid --- components/bt/host/nimble/nimble | 2 +- examples/bluetooth/esp_hid_device/main/esp_hid_gap.c | 11 +++++++++-- examples/bluetooth/esp_hid_host/main/esp_hid_gap.c | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index c0dd77a835..28844aaa7f 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit c0dd77a8355dd82d0bc1b501e6d118a91eb14df1 +Subproject commit 28844aaa7fa5dd2587ea4fb297e0a71af8c5465c diff --git a/examples/bluetooth/esp_hid_device/main/esp_hid_gap.c b/examples/bluetooth/esp_hid_device/main/esp_hid_gap.c index af763f3b39..6b2c78b954 100644 --- a/examples/bluetooth/esp_hid_device/main/esp_hid_gap.c +++ b/examples/bluetooth/esp_hid_device/main/esp_hid_gap.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Unlicense OR CC0-1.0 */ @@ -22,6 +22,8 @@ #include "host/ble_hs_adv.h" #include "nimble/ble.h" #include "host/ble_sm.h" +#else +#include "esp_bt_device.h" #endif static const char *TAG = "ESP_HID_GAP"; @@ -697,9 +699,13 @@ esp_err_t esp_hid_ble_gap_adv_start(void) return esp_ble_gap_start_advertising(&hidd_adv_params); } #endif /* CONFIG_BT_BLE_ENABLED */ + #if CONFIG_BT_NIMBLE_ENABLED -static struct ble_hs_adv_fields fields; #define GATT_SVR_SVC_HID_UUID 0x1812 + +extern void ble_hid_task_start_up(void); +static struct ble_hs_adv_fields fields; + esp_err_t esp_hid_ble_gap_adv_init(uint16_t appearance, const char *device_name) { ble_uuid16_t *uuid16, *uuid16_1; @@ -806,6 +812,7 @@ nimble_hid_gap_event(struct ble_gap_event *event, void *arg) event->enc_change.status); rc = ble_gap_conn_find(event->enc_change.conn_handle, &desc); assert(rc == 0); + ble_hid_task_start_up(); return 0; case BLE_GAP_EVENT_NOTIFY_TX: diff --git a/examples/bluetooth/esp_hid_host/main/esp_hid_gap.c b/examples/bluetooth/esp_hid_host/main/esp_hid_gap.c index 249d1f0fda..94fab0775c 100644 --- a/examples/bluetooth/esp_hid_host/main/esp_hid_gap.c +++ b/examples/bluetooth/esp_hid_host/main/esp_hid_gap.c @@ -22,6 +22,8 @@ #include "nimble/ble.h" #include "host/ble_sm.h" #define BLE_HID_SVC_UUID 0x1812 /* HID Service*/ +#else +#include "esp_bt_device.h" #endif static const char *TAG = "ESP_HID_GAP"; From 26eb6248791faa413cef11754a14ec02d3f18509 Mon Sep 17 00:00:00 2001 From: Darshan Dobariya Date: Wed, 13 Mar 2024 16:30:49 +0530 Subject: [PATCH 03/12] fix(nimble): Added support for deleting the oldest bonded device across reboot --- components/bt/host/nimble/nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index 28844aaa7f..3705a21d49 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit 28844aaa7fa5dd2587ea4fb297e0a71af8c5465c +Subproject commit 3705a21d499cc9b8f584e8468ff7e82cc5452a4c From 7ff783db6ae718a98e440b5fea25c6770d87eda0 Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Mon, 18 Mar 2024 15:57:46 +0530 Subject: [PATCH 04/12] fix(nimble): Handle auto connection flag for extended connect --- components/bt/host/nimble/nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index 3705a21d49..2059a80852 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit 3705a21d499cc9b8f584e8468ff7e82cc5452a4c +Subproject commit 2059a808526b08660d089e31d7929646d8bdd33e From d8e072fd8ab3242c246d2e438703bba7014ad38c Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Fri, 29 Mar 2024 21:15:41 +0530 Subject: [PATCH 05/12] fix(nimble): Change reconnection scheme --- components/bt/host/nimble/nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index 2059a80852..e8b9e5610a 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit 2059a808526b08660d089e31d7929646d8bdd33e +Subproject commit e8b9e5610a1f9e11d4caf750d1964fe7ec3252c5 From 0bda7fb520b862633e5f09d412cbd2cb544b5ddd Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Fri, 5 Apr 2024 10:26:30 +0530 Subject: [PATCH 06/12] fix(nimble): Remove extra code in reattempt connection --- components/bt/host/nimble/nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index e8b9e5610a..aaefa56fe3 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit e8b9e5610a1f9e11d4caf750d1964fe7ec3252c5 +Subproject commit aaefa56fe3d7e4a1a95a78fdfbbd218430cb9f20 From 28f8c9d228ac6149e3424216a250f2b5d113041b Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Tue, 9 Apr 2024 18:54:19 +0530 Subject: [PATCH 07/12] fix(nimble): Fix the size of num_packets in dtm event --- components/bt/host/nimble/nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index aaefa56fe3..c4dc8f8292 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit aaefa56fe3d7e4a1a95a78fdfbbd218430cb9f20 +Subproject commit c4dc8f829214f3789b139821e8f25c4fd6ef4bad From fec0bb07f67b7381b364f371ee9446241e005825 Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Fri, 22 Mar 2024 10:58:16 +0530 Subject: [PATCH 08/12] fix(nimble): Add support for data length change evt --- components/bt/host/nimble/nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index c4dc8f8292..cfad217442 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit c4dc8f829214f3789b139821e8f25c4fd6ef4bad +Subproject commit cfad2174422b2e9a220ce2410d3fb5fc4fb249a4 From d7bfdee87b49ff650e988e24f30b36f7641d597e Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Mon, 8 Apr 2024 15:57:17 +0530 Subject: [PATCH 09/12] fix(nimble): Fix for Vulnerability CVE_2024_24746 --- components/bt/host/nimble/nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index cfad217442..32b7457f09 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit cfad2174422b2e9a220ce2410d3fb5fc4fb249a4 +Subproject commit 32b7457f0988abf9b10c5fadef831f43d30b5649 From e4083fd321d980e8713fd3e159cdf8f3ac0f2055 Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Sat, 6 Apr 2024 21:17:54 +0530 Subject: [PATCH 10/12] fix(nimble): Fix compilation issues when CCCD is set to 0 --- components/bt/host/nimble/nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index 32b7457f09..0a7f98cdf0 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit 32b7457f0988abf9b10c5fadef831f43d30b5649 +Subproject commit 0a7f98cdf001a1f5d9be185f57d099bd5c852f31 From bce9b7ad4b6db28b5e27b0e6766097ab3f15d484 Mon Sep 17 00:00:00 2001 From: Sumeet Singh Date: Fri, 29 Mar 2024 18:20:46 +0530 Subject: [PATCH 11/12] fix(nimble): Removed code for termination upon signed write operation failure --- components/bt/host/nimble/nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index 0a7f98cdf0..acbe4fe321 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit 0a7f98cdf001a1f5d9be185f57d099bd5c852f31 +Subproject commit acbe4fe3219cb7ce677be1aa2c4142f308ea4958 From 12fd2435ea194f744b29803ec56e005ff53cd47d Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Thu, 28 Mar 2024 14:40:44 +0530 Subject: [PATCH 12/12] fix(nimble): Expose API to set RPA Timeout --- components/bt/host/nimble/nimble | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index acbe4fe321..a2acac3e14 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit acbe4fe3219cb7ce677be1aa2c4142f308ea4958 +Subproject commit a2acac3e14bb7810783ac5089ccf8229a2dd2f70