From 4ddb8587d9f1458e09a153e3bf43c8ad6cbe60af Mon Sep 17 00:00:00 2001 From: chenjianhua Date: Tue, 19 Dec 2023 11:37:01 +0800 Subject: [PATCH] feat(bt/bluedroid): Make the max number of bond device to be configurable --- components/bt/host/bluedroid/Kconfig.in | 8 ++++++++ .../common/include/common/bluedroid_user_config.h | 6 ++++++ .../bt/host/bluedroid/common/include/common/bt_target.h | 8 ++------ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/components/bt/host/bluedroid/Kconfig.in b/components/bt/host/bluedroid/Kconfig.in index 2e7867e07d..af1055ed49 100644 --- a/components/bt/host/bluedroid/Kconfig.in +++ b/components/bt/host/bluedroid/Kconfig.in @@ -1073,6 +1073,14 @@ config BT_SMP_ENABLE depends on BT_BLUEDROID_ENABLED default BT_CLASSIC_ENABLED || BT_BLE_SMP_ENABLE +config BT_SMP_MAX_BONDS + int "BT/BLE maximum bond device count" + depends on BT_SMP_ENABLE + range 1 32 + default 15 + help + The number of security records for peer devices. + config BT_BLE_ACT_SCAN_REP_ADV_SCAN bool "Report adv data and scan response individually when BLE active scan" depends on BT_BLUEDROID_ENABLED && BT_BLE_ENABLED diff --git a/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h b/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h index fb4dd14b2d..4d4e2dfc9c 100644 --- a/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h +++ b/components/bt/host/bluedroid/common/include/common/bluedroid_user_config.h @@ -198,6 +198,12 @@ #define UC_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE FALSE #endif +#ifdef CONFIG_BT_SMP_MAX_BONDS +#define UC_BT_SMP_MAX_BONDS CONFIG_BT_SMP_MAX_BONDS +#else +#define UC_BT_SMP_MAX_BONDS 8 +#endif + //Device Nane Maximum Length #ifdef CONFIG_BT_MAX_DEVICE_NAME_LEN #define UC_MAX_LOC_BD_NAME_LEN CONFIG_BT_MAX_DEVICE_NAME_LEN diff --git a/components/bt/host/bluedroid/common/include/common/bt_target.h b/components/bt/host/bluedroid/common/include/common/bt_target.h index f84a3b66f7..2b84138bbd 100644 --- a/components/bt/host/bluedroid/common/include/common/bt_target.h +++ b/components/bt/host/bluedroid/common/include/common/bt_target.h @@ -866,13 +866,9 @@ #define BTM_DEFAULT_SCO_MODE 2 #endif -/* The number of security records for peer devices. 100 AS Default*/ +/* The number of security records for peer devices. 15 AS Default*/ #ifndef BTM_SEC_MAX_DEVICE_RECORDS -#if SMP_INCLUDED == TRUE -#define BTM_SEC_MAX_DEVICE_RECORDS 15 // 100 -#else -#define BTM_SEC_MAX_DEVICE_RECORDS 8 -#endif /* SMP_INCLUDED == TRUE */ +#define BTM_SEC_MAX_DEVICE_RECORDS UC_BT_SMP_MAX_BONDS #endif /* The number of security records for services. 32 AS Default*/