From 7f8290e91129c79d1476c7e143cbf23201e45046 Mon Sep 17 00:00:00 2001 From: Zhang Hai Peng Date: Wed, 4 Jun 2025 17:13:47 +0800 Subject: [PATCH] feat(ble/bluedroid): Include SMP state in BLE status reporting (cherry picked from commit de9a367f130366c1d924332f1ac5a51c01013080) Co-authored-by: zhanghaipeng --- components/bt/host/bluedroid/btc/core/btc_main.c | 7 +++++++ components/bt/host/bluedroid/btc/include/btc/btc_main.h | 1 + 2 files changed, 8 insertions(+) diff --git a/components/bt/host/bluedroid/btc/core/btc_main.c b/components/bt/host/bluedroid/btc/core/btc_main.c index 76166fb619..0773840048 100644 --- a/components/bt/host/bluedroid/btc/core/btc_main.c +++ b/components/bt/host/bluedroid/btc/core/btc_main.c @@ -216,5 +216,12 @@ uint32_t btc_get_ble_status(void) } #endif + #if SMP_INCLUDED == TRUE + extern uint8_t smp_get_state(void); + if (smp_get_state()) { + status |= BIT(BTC_BLE_STATUS_SMP_STATE); + } + #endif + return status; } diff --git a/components/bt/host/bluedroid/btc/include/btc/btc_main.h b/components/bt/host/bluedroid/btc/include/btc/btc_main.h index e9b6f5ba2a..0e19b35a91 100644 --- a/components/bt/host/bluedroid/btc/include/btc/btc_main.h +++ b/components/bt/host/bluedroid/btc/include/btc/btc_main.h @@ -41,6 +41,7 @@ typedef enum { BTC_BLE_STATUS_GATTS_SRVC, // GATTS service exist BTC_BLE_STATUS_PRIVACY, // Privacy enabled BTC_BLE_STATUS_ADDR_RESOLVE_DISABLE,// Address resolution disable status + BTC_BLE_STATUS_SMP_STATE, // SMP state machine } tBTC_BLE_STATUS; future_t **btc_main_get_future_p(btc_main_future_type_t type);