From 3ef7e529b4b2f58692d9ed87e486482fc885b76c Mon Sep 17 00:00:00 2001 From: zwj Date: Thu, 30 Mar 2023 19:28:38 +0800 Subject: [PATCH] If it is not esp32 chips, hide the configuration item: BT_BLE_RPA_SUPPORTED --- components/bt/host/bluedroid/Kconfig.in | 7 +++---- .../common/include/common/bluedroid_user_config.h | 5 +++++ components/soc/esp32/include/soc/soc_caps.h | 3 +++ components/soc/esp32c3/include/soc/soc_caps.h | 3 +++ components/soc/esp32s3/include/soc/soc_caps.h | 3 +++ 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/components/bt/host/bluedroid/Kconfig.in b/components/bt/host/bluedroid/Kconfig.in index 6f9137e72b..63e6167806 100644 --- a/components/bt/host/bluedroid/Kconfig.in +++ b/components/bt/host/bluedroid/Kconfig.in @@ -1057,9 +1057,8 @@ config BT_MAX_DEVICE_NAME_LEN config BT_BLE_RPA_SUPPORTED bool "Update RPA to Controller" - depends on BT_BLUEDROID_ENABLED - default y if (IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3) - default n if IDF_TARGET_ESP32 + depends on BT_BLUEDROID_ENABLED && IDF_TARGET_ESP32 + default n help This enables controller RPA list function. For ESP32, ESP32 only support network privacy mode. If this option is enabled, ESP32 will only accept @@ -1069,7 +1068,7 @@ config BT_BLE_RPA_SUPPORTED cannot be used. This option is disabled by default on ESP32, please enable or disable this option according to your own needs. - For ESP32C3 and esp32s3, devices support network privacy mode and device privacy mode, users can switch the + For BLE other chips, devices support network privacy mode and device privacy mode, users can switch the two modes according to their own needs. So this option is enabled by default. config BT_BLE_50_FEATURES_SUPPORTED 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 42389a39c7..0c02f10c6c 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 @@ -18,6 +18,7 @@ /* All the configuration from SDK defined here */ #include "bt_common.h" #include "bt_user_config.h" +#include "soc/soc_caps.h" /********************************************************** * Thread/Task reference @@ -91,8 +92,12 @@ #ifdef CONFIG_BT_BLE_RPA_SUPPORTED #define UC_BT_BLE_RPA_SUPPORTED CONFIG_BT_BLE_RPA_SUPPORTED #else +#if SOC_BLE_DEVICE_PRIVACY_SUPPORTED +#define UC_BT_BLE_RPA_SUPPORTED TRUE +#else #define UC_BT_BLE_RPA_SUPPORTED FALSE #endif +#endif #ifdef CONFIG_BT_BLE_50_FEATURES_SUPPORTED #define UC_BT_BLE_50_FEATURES_SUPPORTED CONFIG_BT_BLE_50_FEATURES_SUPPORTED diff --git a/components/soc/esp32/include/soc/soc_caps.h b/components/soc/esp32/include/soc/soc_caps.h index ef80572c63..c6e0a0ff70 100644 --- a/components/soc/esp32/include/soc/soc_caps.h +++ b/components/soc/esp32/include/soc/soc_caps.h @@ -278,3 +278,6 @@ # define CAN_BRP_DIV_SUPPORTED SOC_TWAI_BRP_DIV_SUPPORTED # define CAN_BRP_DIV_THRESH SOC_TWAI_BRP_DIV_THRESH #endif + +/* ---------------------------- Bluetooth ------------------------------- */ +#define SOC_BLE_DEVICE_PRIVACY_SUPPORTED (0) diff --git a/components/soc/esp32c3/include/soc/soc_caps.h b/components/soc/esp32c3/include/soc/soc_caps.h index 5bad7354e4..dd7065889b 100644 --- a/components/soc/esp32c3/include/soc/soc_caps.h +++ b/components/soc/esp32c3/include/soc/soc_caps.h @@ -271,3 +271,6 @@ #define SOC_PM_SUPPORT_WIFI_PD (1) #define SOC_PM_SUPPORT_BT_PD (1) + +/* ---------------------------- Bluetooth ------------------------------- */ +#define SOC_BLE_DEVICE_PRIVACY_SUPPORTED (1) diff --git a/components/soc/esp32s3/include/soc/soc_caps.h b/components/soc/esp32s3/include/soc/soc_caps.h index eb6ee1ca38..17e38fa49c 100644 --- a/components/soc/esp32s3/include/soc/soc_caps.h +++ b/components/soc/esp32s3/include/soc/soc_caps.h @@ -184,3 +184,6 @@ #define SOC_SPI_MEM_SUPPORT_SW_SUSPEND (1) /*-------------------------- COEXISTENCE HARDWARE PTI CAPS -------------------------------*/ #define SOC_COEX_HW_PTI (1) + +/* ---------------------------- Bluetooth ------------------------------- */ +#define SOC_BLE_DEVICE_PRIVACY_SUPPORTED (1)