From 0b3ea0fcde1f9ba4627908a75af2e4c2a33912c9 Mon Sep 17 00:00:00 2001 From: chenjianhua Date: Tue, 1 Aug 2023 11:56:39 +0800 Subject: [PATCH] feat(bt/bluedroid): Support high duty adv interval setting --- components/bt/host/bluedroid/Kconfig.in | 7 +++++++ .../common/include/common/bluedroid_user_config.h | 6 ++++++ .../bt/host/bluedroid/common/include/common/bt_target.h | 6 ++++++ .../bt/host/bluedroid/stack/include/stack/btm_ble_api.h | 8 ++++++-- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/components/bt/host/bluedroid/Kconfig.in b/components/bt/host/bluedroid/Kconfig.in index ee826bf595..6001187513 100644 --- a/components/bt/host/bluedroid/Kconfig.in +++ b/components/bt/host/bluedroid/Kconfig.in @@ -1098,3 +1098,10 @@ config BT_BLE_42_FEATURES_SUPPORTED default n help This enables BLE 4.2 features. + +config BT_BLE_HIGH_DUTY_ADV_INTERVAL + bool "Enable BLE high duty advertising interval feature" + depends on BT_BLUEDROID_ENABLED + default n + help + This enable BLE high duty advertising interval feature 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 263500e380..4c718f175b 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 @@ -125,6 +125,12 @@ #define UC_BT_BLE_42_FEATURES_SUPPORTED FALSE #endif +#ifdef CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL +#define UC_BT_BLE_HIGH_DUTY_ADV_INTERVAL CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL +#else +#define UC_BT_BLE_HIGH_DUTY_ADV_INTERVAL FALSE +#endif + //GATTS #ifdef CONFIG_BT_GATTS_ENABLE #define UC_BT_GATTS_ENABLE CONFIG_BT_GATTS_ENABLE 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 b76ffcbce5..88586df414 100644 --- a/components/bt/host/bluedroid/common/include/common/bt_target.h +++ b/components/bt/host/bluedroid/common/include/common/bt_target.h @@ -183,6 +183,12 @@ #define BLE_42_FEATURE_SUPPORT FALSE #endif +#if (UC_BT_BLE_HIGH_DUTY_ADV_INTERVAL == TRUE) +#define BLE_HIGH_DUTY_ADV_INTERVAL TRUE +#else +#define BLE_HIGH_DUTY_ADV_INTERVAL FALSE +#endif + #if (UC_BT_BLE_RPA_SUPPORTED == TRUE) #define CONTROLLER_RPA_LIST_ENABLE TRUE #else diff --git a/components/bt/host/bluedroid/stack/include/stack/btm_ble_api.h b/components/bt/host/bluedroid/stack/include/stack/btm_ble_api.h index e84e2e6dea..74640777ea 100644 --- a/components/bt/host/bluedroid/stack/include/stack/btm_ble_api.h +++ b/components/bt/host/bluedroid/stack/include/stack/btm_ble_api.h @@ -105,8 +105,12 @@ typedef UINT8 tBTM_BLE_SFP; #endif /* adv parameter boundary values */ -#define BTM_BLE_ADV_INT_MIN 0x0020 -#define BTM_BLE_ADV_INT_MAX 0x4000 +#if BLE_HIGH_DUTY_ADV_INTERVAL +#define BTM_BLE_ADV_INT_MIN 0x0008 /* 5ms */ +#else +#define BTM_BLE_ADV_INT_MIN 0x0020 /* 20ms */ +#endif +#define BTM_BLE_ADV_INT_MAX 0x4000 /* 10240ms */ /* Full scan boundary values */ #define BTM_BLE_ADV_SCAN_FULL_MIN 0x00