From 7ad9e885e4c379d1cb2ea69f2df478f2bae90161 Mon Sep 17 00:00:00 2001 From: zhiweijian Date: Fri, 10 Mar 2023 12:24:50 +0800 Subject: [PATCH] If it is not 32 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/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32/include/soc/soc_caps.h | 1 + components/soc/esp32c2/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32c2/include/soc/soc_caps.h | 1 + components/soc/esp32c3/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32c3/include/soc/soc_caps.h | 1 + components/soc/esp32c6/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32c6/include/soc/soc_caps.h | 1 + components/soc/esp32h2/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32h2/include/soc/soc_caps.h | 1 + components/soc/esp32h4/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32h4/include/soc/soc_caps.h | 1 + components/soc/esp32s3/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32s3/include/soc/soc_caps.h | 1 + 16 files changed, 43 insertions(+), 4 deletions(-) diff --git a/components/bt/host/bluedroid/Kconfig.in b/components/bt/host/bluedroid/Kconfig.in index 3ee5bddc0d..e84f5a6064 100644 --- a/components/bt/host/bluedroid/Kconfig.in +++ b/components/bt/host/bluedroid/Kconfig.in @@ -1100,9 +1100,8 @@ config BT_MAX_DEVICE_NAME_LEN config BT_BLE_RPA_SUPPORTED bool "Update RPA to Controller" - depends on BT_BLUEDROID_ENABLED - default n if IDF_TARGET_ESP32 - default y + depends on BT_BLUEDROID_ENABLED && !SOC_BLE_DEVICE_PRIVACY_SUPPORTED + 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 @@ -1112,7 +1111,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, ESP32S3, ESP32H4 and ESP32C2, devices support network privacy mode and device privacy mode, + For other BLE 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_RPA_TIMEOUT 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 30b65cb7de..20ac5f88a5 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 @@ -10,6 +10,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 @@ -104,8 +105,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/Kconfig.soc_caps.in b/components/soc/esp32/include/soc/Kconfig.soc_caps.in index 86f8a72257..7f67f83b1b 100644 --- a/components/soc/esp32/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32/include/soc/Kconfig.soc_caps.in @@ -838,3 +838,7 @@ config SOC_BLE_MESH_SUPPORTED config SOC_BT_CLASSIC_SUPPORTED bool default y + +config SOC_BLE_DEVICE_PRIVACY_SUPPORTED + bool + default n diff --git a/components/soc/esp32/include/soc/soc_caps.h b/components/soc/esp32/include/soc/soc_caps.h index a43ecf424e..61bfb4c17e 100644 --- a/components/soc/esp32/include/soc/soc_caps.h +++ b/components/soc/esp32/include/soc/soc_caps.h @@ -412,3 +412,4 @@ #define SOC_BLE_SUPPORTED (1) /*!< Support Bluetooth Low Energy hardware */ #define SOC_BLE_MESH_SUPPORTED (1) /*!< Support BLE MESH */ #define SOC_BT_CLASSIC_SUPPORTED (1) /*!< Support Bluetooth Classic hardware */ +#define SOC_BLE_DEVICE_PRIVACY_SUPPORTED (0) /*!< Support BLE device privacy mode */ diff --git a/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in index 2fc26e3f4f..820d20e751 100644 --- a/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c2/include/soc/Kconfig.soc_caps.in @@ -650,3 +650,7 @@ config SOC_ESP_NIMBLE_CONTROLLER config SOC_BLE_50_SUPPORTED bool default y + +config SOC_BLE_DEVICE_PRIVACY_SUPPORTED + bool + default y diff --git a/components/soc/esp32c2/include/soc/soc_caps.h b/components/soc/esp32c2/include/soc/soc_caps.h index 0d40db3c97..ac54e2afee 100644 --- a/components/soc/esp32c2/include/soc/soc_caps.h +++ b/components/soc/esp32c2/include/soc/soc_caps.h @@ -305,3 +305,4 @@ #define SOC_BLE_MESH_SUPPORTED (0) /*!< Support BLE MESH */ #define SOC_ESP_NIMBLE_CONTROLLER (1) /*!< Support BLE EMBEDDED controller V1 */ #define SOC_BLE_50_SUPPORTED (1) /*!< Support Bluetooth 5.0 */ +#define SOC_BLE_DEVICE_PRIVACY_SUPPORTED (1) /*!< Support BLE device privacy mode */ diff --git a/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in index 697d080b69..35064b9d3e 100644 --- a/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c3/include/soc/Kconfig.soc_caps.in @@ -958,3 +958,7 @@ config SOC_BLE_MESH_SUPPORTED config SOC_BLE_50_SUPPORTED bool default y + +config SOC_BLE_DEVICE_PRIVACY_SUPPORTED + bool + default y diff --git a/components/soc/esp32c3/include/soc/soc_caps.h b/components/soc/esp32c3/include/soc/soc_caps.h index c7abe37fad..5ef1674249 100644 --- a/components/soc/esp32c3/include/soc/soc_caps.h +++ b/components/soc/esp32c3/include/soc/soc_caps.h @@ -417,3 +417,4 @@ #define SOC_BLE_SUPPORTED (1) /*!< Support Bluetooth Low Energy hardware */ #define SOC_BLE_MESH_SUPPORTED (1) /*!< Support BLE MESH */ #define SOC_BLE_50_SUPPORTED (1) /*!< Support Bluetooth 5.0 */ +#define SOC_BLE_DEVICE_PRIVACY_SUPPORTED (1) /*!< Support BLE device privacy mode */ diff --git a/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in b/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in index 2373c9452d..da871dff60 100644 --- a/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32c6/include/soc/Kconfig.soc_caps.in @@ -1198,3 +1198,7 @@ config SOC_ESP_NIMBLE_CONTROLLER config SOC_BLE_50_SUPPORTED bool default y + +config SOC_BLE_DEVICE_PRIVACY_SUPPORTED + bool + default y diff --git a/components/soc/esp32c6/include/soc/soc_caps.h b/components/soc/esp32c6/include/soc/soc_caps.h index ef0d583a8c..b96537d564 100644 --- a/components/soc/esp32c6/include/soc/soc_caps.h +++ b/components/soc/esp32c6/include/soc/soc_caps.h @@ -497,3 +497,4 @@ #define SOC_BLE_MESH_SUPPORTED (1) /*!< Support BLE MESH */ #define SOC_ESP_NIMBLE_CONTROLLER (1) /*!< Support BLE EMBEDDED controller V1 */ #define SOC_BLE_50_SUPPORTED (1) /*!< Support Bluetooth 5.0 */ +#define SOC_BLE_DEVICE_PRIVACY_SUPPORTED (1) /*!< Support BLE device privacy mode */ diff --git a/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in index eea30cc633..ef714fe48c 100644 --- a/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h2/include/soc/Kconfig.soc_caps.in @@ -1098,3 +1098,7 @@ config SOC_ESP_NIMBLE_CONTROLLER config SOC_BLE_50_SUPPORTED bool default y + +config SOC_BLE_DEVICE_PRIVACY_SUPPORTED + bool + default y diff --git a/components/soc/esp32h2/include/soc/soc_caps.h b/components/soc/esp32h2/include/soc/soc_caps.h index d24600c4ca..3d2a1bd480 100644 --- a/components/soc/esp32h2/include/soc/soc_caps.h +++ b/components/soc/esp32h2/include/soc/soc_caps.h @@ -475,3 +475,4 @@ #define SOC_BLE_MESH_SUPPORTED (1) /*!< Support BLE MESH */ #define SOC_ESP_NIMBLE_CONTROLLER (1) /*!< Support BLE EMBEDDED controller V1 */ #define SOC_BLE_50_SUPPORTED (1) /*!< Support Bluetooth 5.0 */ +#define SOC_BLE_DEVICE_PRIVACY_SUPPORTED (1) /*!< Support BLE device privacy mode */ diff --git a/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in b/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in index 1efb5ef96d..5e1adc12a5 100644 --- a/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32h4/include/soc/Kconfig.soc_caps.in @@ -858,3 +858,7 @@ config SOC_ESP_NIMBLE_CONTROLLER config SOC_BLE_50_SUPPORTED bool default y + +config SOC_BLE_DEVICE_PRIVACY_SUPPORTED + bool + default y diff --git a/components/soc/esp32h4/include/soc/soc_caps.h b/components/soc/esp32h4/include/soc/soc_caps.h index 759114e918..6b3ff4868e 100644 --- a/components/soc/esp32h4/include/soc/soc_caps.h +++ b/components/soc/esp32h4/include/soc/soc_caps.h @@ -402,3 +402,4 @@ #define SOC_BLE_MESH_SUPPORTED (1) /*!< Support BLE MESH */ #define SOC_ESP_NIMBLE_CONTROLLER (1) /*!< Support BLE EMBEDDED controller V1 */ #define SOC_BLE_50_SUPPORTED (1) /*!< Support Bluetooth 5.0 */ +#define SOC_BLE_DEVICE_PRIVACY_SUPPORTED (1) /*!< Support BLE device privacy mode */ diff --git a/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in b/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in index e067050659..d80d395b2a 100644 --- a/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s3/include/soc/Kconfig.soc_caps.in @@ -1238,3 +1238,7 @@ config SOC_BLE_MESH_SUPPORTED config SOC_BLE_50_SUPPORTED bool default y + +config SOC_BLE_DEVICE_PRIVACY_SUPPORTED + bool + default y diff --git a/components/soc/esp32s3/include/soc/soc_caps.h b/components/soc/esp32s3/include/soc/soc_caps.h index 5d69e0eae4..41d885f403 100644 --- a/components/soc/esp32s3/include/soc/soc_caps.h +++ b/components/soc/esp32s3/include/soc/soc_caps.h @@ -503,3 +503,4 @@ #define SOC_BLE_SUPPORTED (1) /*!< Support Bluetooth Low Energy hardware */ #define SOC_BLE_MESH_SUPPORTED (1) /*!< Support BLE MESH */ #define SOC_BLE_50_SUPPORTED (1) /*!< Support Bluetooth 5.0 */ +#define SOC_BLE_DEVICE_PRIVACY_SUPPORTED (1) /*!< Support BLE device privacy mode */