From 006a6b29f161818553bc7d9af827ae341da03903 Mon Sep 17 00:00:00 2001 From: Sumeet Singh Date: Thu, 18 Jul 2024 17:30:03 +0530 Subject: [PATCH] fix(nimble): Added option to enable code under Enhanced COC --- components/bt/host/nimble/Kconfig.in | 8 ++++++++ .../host/nimble/port/include/esp_nimble_cfg.h | 17 ++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/components/bt/host/nimble/Kconfig.in b/components/bt/host/nimble/Kconfig.in index 1f89d82728..04555dd726 100644 --- a/components/bt/host/nimble/Kconfig.in +++ b/components/bt/host/nimble/Kconfig.in @@ -99,6 +99,14 @@ config BT_NIMBLE_L2CAP_COC_MAX_NUM help Defines maximum number of BLE Connection Oriented Channels. When set to (0), BLE COC is not compiled in +config BT_NIMBLE_L2CAP_ENHANCED_COC + bool "L2CAP Enhanced Connection Oriented Channel" + depends on BT_NIMBLE_ENABLED && (BT_NIMBLE_L2CAP_COC_MAX_NUM >= 1) + default 0 + help + Enable Enhanced Credit Based Flow Control Mode + + choice BT_NIMBLE_PINNED_TO_CORE_CHOICE prompt "The CPU core on which NimBLE host will run" depends on BT_NIMBLE_ENABLED && !FREERTOS_UNICORE 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 d1ff729add..f5fcc5da3f 100644 --- a/components/bt/host/nimble/port/include/esp_nimble_cfg.h +++ b/components/bt/host/nimble/port/include/esp_nimble_cfg.h @@ -479,6 +479,18 @@ /*** @apache-mynewt-nimble/nimble/host */ +#if CONFIG_BT_NIMBLE_L2CAP_ENHANCED_COC +#ifndef MYNEWT_VAL_BLE_L2CAP_ENHANCED_COC +#define MYNEWT_VAL_BLE_L2CAP_ENHANCED_COC (CONFIG_BT_NIMBLE_L2CAP_ENHANCED_COC) +#else +#if CONFIG_BT_NIMBLE_EATT_CHAN_NUM +#define MYNEWT_VAL_BLE_L2CAP_ENHANCED_COC (1) +#else +#define MYNEWT_VAL_BLE_L2CAP_ENHANCED_COC (0) +#endif +#endif +#endif + #ifndef MYNEWT_VAL_BLE_DYNAMIC_SERVICE #define MYNEWT_VAL_BLE_DYNAMIC_SERVICE CONFIG_BT_NIMBLE_DYNAMIC_SERVICE #endif @@ -782,11 +794,6 @@ #define MYNEWT_VAL_BLE_L2CAP_COC_MPS (MYNEWT_VAL_MSYS_1_BLOCK_SIZE-8) #endif -#if CONFIG_BT_NIMBLE_EATT_CHAN_NUM -#define MYNEWT_VAL_BLE_L2CAP_ENHANCED_COC (1) -#else -#define MYNEWT_VAL_BLE_L2CAP_ENHANCED_COC (0) -#endif #ifndef MYNEWT_VAL_BLE_L2CAP_JOIN_RX_FRAGS #define MYNEWT_VAL_BLE_L2CAP_JOIN_RX_FRAGS (1)