From 967a727e24ccf45f4bfa11167c02fa39ef7695b7 Mon Sep 17 00:00:00 2001 From: Abhinav Kudnar Date: Wed, 3 Jul 2024 16:13:33 +0530 Subject: [PATCH] fix(nimble): Save the gatt context in case of preemption --- components/bt/host/nimble/Kconfig.in | 9 +++++++++ components/bt/host/nimble/nimble | 2 +- .../bt/host/nimble/port/include/esp_nimble_cfg.h | 10 +++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/components/bt/host/nimble/Kconfig.in b/components/bt/host/nimble/Kconfig.in index 1147a7ceff..b67d5b9c6e 100644 --- a/components/bt/host/nimble/Kconfig.in +++ b/components/bt/host/nimble/Kconfig.in @@ -767,6 +767,15 @@ config BT_NIMBLE_VS_SUPPORT This option is used to enable support for sending Vendor Specific HCI commands and handling Vendor Specific HCI Events. +config BT_NIMBLE_GATTC_PROC_PREEMPTION_PROTECT + bool "Gatt-proc preemption protect check" + depends on BT_NIMBLE_ENABLED + default n + help + When BLE and Wireless protocol/IEEE 802.15.4 operate in coexistence, BLE preemption + can disrupt the GATT context,causing the service discovery callback to not be invoked. + A temporary list is maintained to preserve the GATT context and use it in case of preemption. + config BT_NIMBLE_ENC_ADV_DATA bool "Encrypted Advertising Data" depends on BT_NIMBLE_50_FEATURE_SUPPORT diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index 7ae98b1b57..14671bc3b0 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit 7ae98b1b5700cf3399cb72ba030ded36d82c194b +Subproject commit 14671bc3b070b87c97706b191e85bb2d647cb5ad 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 d2df99b4b5..9377c0b9d1 100644 --- a/components/bt/host/nimble/port/include/esp_nimble_cfg.h +++ b/components/bt/host/nimble/port/include/esp_nimble_cfg.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -1853,6 +1853,14 @@ #endif #endif +#ifndef MYNEWT_VAL_BLE_GATTC_PROC_PREEMPTION_PROTECT +#ifdef CONFIG_BT_NIMBLE_GATTC_PROC_PREEMPTION_PROTECT +#define MYNEWT_VAL_BLE_GATTC_PROC_PREEMPTION_PROTECT CONFIG_BT_NIMBLE_GATTC_PROC_PREEMPTION_PROTECT +#else +#define MYNEWT_VAL_BLE_GATTC_PROC_PREEMPTION_PROTECT (0) +#endif +#endif + #ifndef MYNEWT_VAL_BT_HCI_LOG_INCLUDED #ifdef CONFIG_BT_HCI_LOG_DEBUG_EN #define MYNEWT_VAL_BT_HCI_LOG_INCLUDED CONFIG_BT_HCI_LOG_DEBUG_EN