From 8b7cb015450ddd1b168a744852d5d9b6f20d66f9 Mon Sep 17 00:00:00 2001 From: Sumeet Singh Date: Thu, 7 Nov 2024 17:06:08 +0530 Subject: [PATCH] fix(nimble): Added 1. Option to disable automatic discovery when receiving out-of-sync 2. Fixed bugs related to robust caching --- components/bt/host/nimble/Kconfig.in | 7 +++++++ components/bt/host/nimble/port/include/esp_nimble_cfg.h | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/components/bt/host/nimble/Kconfig.in b/components/bt/host/nimble/Kconfig.in index 5e29038f2e..83314e1453 100644 --- a/components/bt/host/nimble/Kconfig.in +++ b/components/bt/host/nimble/Kconfig.in @@ -714,6 +714,13 @@ if BT_NIMBLE_50_FEATURE_SUPPORT default 64 help Set this option to set the upper limit on number of descriptors per connection to be cached. + config BT_NIMBLE_GATT_CACHING_DISABLE_AUTO + bool "Do not start discovery procedure automatically upon receiving Out of Sync" + depends on BT_NIMBLE_GATT_CACHING + default n + help + When client receives ATT out-of-sync error message, it will not automatically start the discovery procedure + to correct the invalid cache. endif config BT_NIMBLE_WHITELIST_SIZE 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 08b35e09a6..0b0104c6bc 100644 --- a/components/bt/host/nimble/port/include/esp_nimble_cfg.h +++ b/components/bt/host/nimble/port/include/esp_nimble_cfg.h @@ -158,6 +158,12 @@ #define MYNEWT_VAL_BLE_GATT_CACHING_MAX_DSCS (0) #endif +#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_DISABLE_AUTO +#define MYNEWT_VAL_BLE_GATT_CACHING_DISABLE_AUTO (CONFIG_BT_NIMBLE_GATT_CACHING_DISABLE_AUTO) +#else +#define MYNEWT_VAL_BLE_GATT_CACHING_DISABLE_AUTO (0) +#endif + #endif #ifndef MYNEWT_VAL_BLE_GATT_CSFC_SIZE