From b904278330b8bc8eba0fecb6ffc0dff0e8daf162 Mon Sep 17 00:00:00 2001 From: chenjianhua Date: Mon, 19 Sep 2022 11:23:05 +0800 Subject: [PATCH] fix ble adv tx power map --- .../host/bluedroid/common/include/common/bt_target.h | 12 ++++++++++++ .../host/bluedroid/stack/include/stack/btm_ble_api.h | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) 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 39a41ca0eb..1209266ef8 100644 --- a/components/bt/host/bluedroid/common/include/common/bt_target.h +++ b/components/bt/host/bluedroid/common/include/common/bt_target.h @@ -1165,15 +1165,27 @@ #endif #ifndef BTM_BLE_ADV_TX_POWER +#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S3) #define BTM_BLE_ADV_TX_POWER {-12, -9, -6, -3, 0, 3, 6, 9} +#else +#define BTM_BLE_ADV_TX_POWER {-27, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18} +#endif #endif #ifndef BTM_TX_POWER +#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S3) #define BTM_TX_POWER {-12, -9, -6, -3, 0, 3, 6, 9} +#else +#define BTM_TX_POWER {-27, -24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18} +#endif #endif #ifndef BTM_TX_POWER_LEVEL_MAX +#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S3) #define BTM_TX_POWER_LEVEL_MAX 7 +#else +#define BTM_TX_POWER_LEVEL_MAX 15 +#endif #endif 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 b20b861a28..5e4504dd88 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 @@ -385,7 +385,7 @@ typedef UINT8 tBTM_BLE_AD_TYPE; /* adv tx power level */ #define BTM_BLE_ADV_TX_POWER_MIN 0 /* minimum tx power */ -#define BTM_BLE_ADV_TX_POWER_MAX 7 /* maximum tx power */ +#define BTM_BLE_ADV_TX_POWER_MAX BTM_TX_POWER_LEVEL_MAX /* maximum tx power */ typedef UINT8 tBTM_BLE_ADV_TX_POWER; /* adv tx power in dBm */