From 1c195041d2f98f2f3bb5fdf34c4bda998cef53a0 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 +- components/bt/host/nimble/port/include/esp_nimble_cfg.h | 8 ++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/components/bt/host/nimble/Kconfig.in b/components/bt/host/nimble/Kconfig.in index 2038af5668..5ca00e8ceb 100644 --- a/components/bt/host/nimble/Kconfig.in +++ b/components/bt/host/nimble/Kconfig.in @@ -1071,6 +1071,15 @@ config BT_NIMBLE_HOST_QUEUE_CONG_CHECK or application layer handling adv packets is slow, it will cause the controller memory to run out. if enabled, adv packets will be lost when host queue is congested. +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. + menu "Host-controller Transport" config BT_NIMBLE_TRANSPORT_UART bool "Enable Uart Transport" diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index ff017e5b74..4cf7d046d3 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit ff017e5b749b666e5cade6f69acd930cb95a06a9 +Subproject commit 4cf7d046d3b8e3a572224abe25b8d93a40658ca2 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 6db93500be..d1c2649294 100644 --- a/components/bt/host/nimble/port/include/esp_nimble_cfg.h +++ b/components/bt/host/nimble/port/include/esp_nimble_cfg.h @@ -1953,6 +1953,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_BLE_HOST_ALLOW_CONNECT_WITH_SCAN #ifdef CONFIG_BT_NIMBLE_HOST_ALLOW_CONNECT_WITH_SCAN #define MYNEWT_VAL_BLE_HOST_ALLOW_CONNECT_WITH_SCAN CONFIG_BT_NIMBLE_HOST_ALLOW_CONNECT_WITH_SCAN