From fb72cbe6b9f26e9d31c83ede2c078db13e362e84 Mon Sep 17 00:00:00 2001 From: Rahul Tank Date: Fri, 24 Jul 2026 11:51:15 +0530 Subject: [PATCH] fix(nimble): Added change to stop adv before starting new adv --- components/bt/host/nimble/Kconfig.in | 9 +++++++++ components/bt/host/nimble/nimble | 2 +- components/bt/host/nimble/port/include/esp_nimble_cfg.h | 7 +++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/components/bt/host/nimble/Kconfig.in b/components/bt/host/nimble/Kconfig.in index e51b8ded2e1..93fa97a0065 100644 --- a/components/bt/host/nimble/Kconfig.in +++ b/components/bt/host/nimble/Kconfig.in @@ -1355,6 +1355,15 @@ menu "Extra Features" Disabling IRAM-optimized paths will place functions in FLASH (.irom.text) instead of DRAM (.iram.text/.text in internal RAM). Suitable for low-speed GAP/GATT operations to reduce RAM usage. + + config BT_NIMBLE_GAP_ALLOW_ADV_RESTART + bool "Allow restarting ongoing advertising" + default n + help + If enabled, stop ongoing advertising before starting it again with + new parameters,if any. If disabled, starting advertising while it is already + active returns BLE_HS_EALREADY. + endmenu menu "NimBLE Mesh" diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index 811681cd65a..c186c40278e 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit 811681cd65ada28af32b7877158b4b144ae12442 +Subproject commit c186c40278e8c84414d029cfd2cdb89745abc453 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 14f7d687152..e6b1e2d12c9 100644 --- a/components/bt/host/nimble/port/include/esp_nimble_cfg.h +++ b/components/bt/host/nimble/port/include/esp_nimble_cfg.h @@ -2410,5 +2410,12 @@ #endif #endif +#ifndef MYNEWT_VAL_BLE_GAP_ALLOW_ADV_RESTART +#ifdef CONFIG_BT_NIMBLE_GAP_ALLOW_ADV_RESTART +#define MYNEWT_VAL_BLE_GAP_ALLOW_ADV_RESTART CONFIG_BT_NIMBLE_GAP_ALLOW_ADV_RESTART +#else +#define MYNEWT_VAL_BLE_GAP_ALLOW_ADV_RESTART (0) +#endif +#endif #endif