From 2dfdea8b5022dae4a7f1139f4fa62ce77803ad49 Mon Sep 17 00:00:00 2001 From: zhiweijian Date: Mon, 24 Oct 2022 20:10:48 +0800 Subject: [PATCH] update ble tx power level mapping --- components/bt/controller/esp32c3/Kconfig.in | 36 +++++++++---------- .../bt/include/esp32c3/include/esp_bt.h | 32 ++++++++--------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/components/bt/controller/esp32c3/Kconfig.in b/components/bt/controller/esp32c3/Kconfig.in index 9d15c45359..6465e9236f 100644 --- a/components/bt/controller/esp32c3/Kconfig.in +++ b/components/bt/controller/esp32c3/Kconfig.in @@ -138,8 +138,6 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL help Specify default Tx power level - config BT_CTRL_DFT_TX_POWER_LEVEL_N27 - bool "-27dBm" config BT_CTRL_DFT_TX_POWER_LEVEL_N24 bool "-24dBm" config BT_CTRL_DFT_TX_POWER_LEVEL_N21 @@ -170,26 +168,28 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL bool "+15dBm" config BT_CTRL_DFT_TX_POWER_LEVEL_P18 bool "+18dBm" + config BT_CTRL_DFT_TX_POWER_LEVEL_P21 + bool "+21dBm" endchoice config BT_CTRL_DFT_TX_POWER_LEVEL_EFF int - default 0 if BT_CTRL_DFT_TX_POWER_LEVEL_N27 - default 1 if BT_CTRL_DFT_TX_POWER_LEVEL_N24 - default 2 if BT_CTRL_DFT_TX_POWER_LEVEL_N21 - default 3 if BT_CTRL_DFT_TX_POWER_LEVEL_N18 - default 4 if BT_CTRL_DFT_TX_POWER_LEVEL_N15 - default 5 if BT_CTRL_DFT_TX_POWER_LEVEL_N12 - default 6 if BT_CTRL_DFT_TX_POWER_LEVEL_N9 - default 7 if BT_CTRL_DFT_TX_POWER_LEVEL_N6 - default 8 if BT_CTRL_DFT_TX_POWER_LEVEL_N3 - default 9 if BT_CTRL_DFT_TX_POWER_LEVEL_N0 - default 10 if BT_CTRL_DFT_TX_POWER_LEVEL_P3 - default 11 if BT_CTRL_DFT_TX_POWER_LEVEL_P6 - default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P9 - default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P12 - default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P15 - default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P18 + default 0 if BT_CTRL_DFT_TX_POWER_LEVEL_N24 + default 1 if BT_CTRL_DFT_TX_POWER_LEVEL_N21 + default 2 if BT_CTRL_DFT_TX_POWER_LEVEL_N18 + default 3 if BT_CTRL_DFT_TX_POWER_LEVEL_N15 + default 4 if BT_CTRL_DFT_TX_POWER_LEVEL_N12 + default 5 if BT_CTRL_DFT_TX_POWER_LEVEL_N9 + default 6 if BT_CTRL_DFT_TX_POWER_LEVEL_N6 + default 7 if BT_CTRL_DFT_TX_POWER_LEVEL_N3 + default 8 if BT_CTRL_DFT_TX_POWER_LEVEL_N0 + default 9 if BT_CTRL_DFT_TX_POWER_LEVEL_P3 + default 10 if BT_CTRL_DFT_TX_POWER_LEVEL_P6 + default 11 if BT_CTRL_DFT_TX_POWER_LEVEL_P9 + default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P12 + default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P15 + default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P18 + default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P21 default 0 config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP diff --git a/components/bt/include/esp32c3/include/esp_bt.h b/components/bt/include/esp32c3/include/esp_bt.h index 6250979e94..0b73f0ba3d 100644 --- a/components/bt/include/esp32c3/include/esp_bt.h +++ b/components/bt/include/esp32c3/include/esp_bt.h @@ -290,22 +290,22 @@ typedef enum { * @brief Bluetooth TX power level(index), it's just a index corresponding to power(dbm). */ typedef enum { - ESP_PWR_LVL_N27 = 0, /*!< Corresponding to -27dbm */ - ESP_PWR_LVL_N24 = 1, /*!< Corresponding to -24dbm */ - ESP_PWR_LVL_N21 = 2, /*!< Corresponding to -21dbm */ - ESP_PWR_LVL_N18 = 3, /*!< Corresponding to -18dbm */ - ESP_PWR_LVL_N15 = 4, /*!< Corresponding to -15dbm */ - ESP_PWR_LVL_N12 = 5, /*!< Corresponding to -12dbm */ - ESP_PWR_LVL_N9 = 6, /*!< Corresponding to -9dbm */ - ESP_PWR_LVL_N6 = 7, /*!< Corresponding to -6dbm */ - ESP_PWR_LVL_N3 = 8, /*!< Corresponding to -3dbm */ - ESP_PWR_LVL_N0 = 9, /*!< Corresponding to 0dbm */ - ESP_PWR_LVL_P3 = 10, /*!< Corresponding to +3dbm */ - ESP_PWR_LVL_P6 = 11, /*!< Corresponding to +6dbm */ - ESP_PWR_LVL_P9 = 12, /*!< Corresponding to +9dbm */ - ESP_PWR_LVL_P12 = 13, /*!< Corresponding to +12dbm */ - ESP_PWR_LVL_P15 = 14, /*!< Corresponding to +15dbm */ - ESP_PWR_LVL_P18 = 15, /*!< Corresponding to +18dbm */ + ESP_PWR_LVL_N24 = 0, /*!< Corresponding to -24dbm */ + ESP_PWR_LVL_N21 = 1, /*!< Corresponding to -21dbm */ + ESP_PWR_LVL_N18 = 2, /*!< Corresponding to -18dbm */ + ESP_PWR_LVL_N15 = 3, /*!< Corresponding to -15dbm */ + ESP_PWR_LVL_N12 = 4, /*!< Corresponding to -12dbm */ + ESP_PWR_LVL_N9 = 5, /*!< Corresponding to -9dbm */ + ESP_PWR_LVL_N6 = 6, /*!< Corresponding to -6dbm */ + ESP_PWR_LVL_N3 = 7, /*!< Corresponding to -3dbm */ + ESP_PWR_LVL_N0 = 8, /*!< Corresponding to 0dbm */ + ESP_PWR_LVL_P3 = 9, /*!< Corresponding to +3dbm */ + ESP_PWR_LVL_P6 = 10, /*!< Corresponding to +6dbm */ + ESP_PWR_LVL_P9 = 11, /*!< Corresponding to +9dbm */ + ESP_PWR_LVL_P12 = 12, /*!< Corresponding to +12dbm */ + ESP_PWR_LVL_P15 = 13, /*!< Corresponding to +15dbm */ + ESP_PWR_LVL_P18 = 14, /*!< Corresponding to +18dbm */ + ESP_PWR_LVL_P21 = 15, /*!< Corresponding to +21dbm */ ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */ } esp_power_level_t;