From 3f3ca8bf603b8e5d6788e922275d735771cbd416 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 35a9104ea1..e86e1380d2 100644 --- a/components/bt/host/bluedroid/common/include/common/bt_target.h +++ b/components/bt/host/bluedroid/common/include/common/bt_target.h @@ -1197,15 +1197,27 @@ #endif #ifndef BTM_BLE_ADV_TX_POWER +#ifdef CONFIG_IDF_TARGET_ESP32 #define BTM_BLE_ADV_TX_POWER {-12, -9, -6, -3, 0, 3, 6, 9} +#else +#define BTM_BLE_ADV_TX_POWER {-24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 21} +#endif #endif #ifndef BTM_TX_POWER +#ifdef CONFIG_IDF_TARGET_ESP32 #define BTM_TX_POWER {-12, -9, -6, -3, 0, 3, 6, 9} +#else +#define BTM_TX_POWER {-24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 21} +#endif #endif #ifndef BTM_TX_POWER_LEVEL_MAX +#ifdef CONFIG_IDF_TARGET_ESP32 #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 */