Merge branch 'bugfix/ble_adv_data_tx_power_v3.1' into 'release/v3.1'
fix TX power value in ble adv data is incorrect See merge request idf/esp-idf!3187
This commit is contained in:
commit
760772ec4b
|
@ -29,6 +29,7 @@
|
||||||
#include "btc/btc_dm.h"
|
#include "btc/btc_dm.h"
|
||||||
#include "btc/btc_util.h"
|
#include "btc/btc_util.h"
|
||||||
#include "osi/mutex.h"
|
#include "osi/mutex.h"
|
||||||
|
#include "esp_bt.h"
|
||||||
|
|
||||||
static tBTA_BLE_ADV_DATA gl_bta_adv_data;
|
static tBTA_BLE_ADV_DATA gl_bta_adv_data;
|
||||||
static tBTA_BLE_ADV_DATA gl_bta_scan_rsp_data;
|
static tBTA_BLE_ADV_DATA gl_bta_scan_rsp_data;
|
||||||
|
@ -142,6 +143,7 @@ static void btc_to_bta_adv_data(esp_ble_adv_data_t *p_adv_data, tBTA_BLE_ADV_DAT
|
||||||
|
|
||||||
if (p_adv_data->include_txpower) {
|
if (p_adv_data->include_txpower) {
|
||||||
mask |= BTM_BLE_AD_BIT_TX_PWR;
|
mask |= BTM_BLE_AD_BIT_TX_PWR;
|
||||||
|
bta_adv_data->tx_power = esp_ble_tx_power_get(ESP_BLE_PWR_TYPE_ADV);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_adv_data->min_interval > 0 && p_adv_data->max_interval > 0 &&
|
if (p_adv_data->min_interval > 0 && p_adv_data->max_interval > 0 &&
|
||||||
|
|
|
@ -991,7 +991,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef BTM_BLE_ADV_TX_POWER
|
#ifndef BTM_BLE_ADV_TX_POWER
|
||||||
#define BTM_BLE_ADV_TX_POWER {-21, -15, -7, 1, 9}
|
#define BTM_BLE_ADV_TX_POWER {-12, -9, -6, -3, 0, 3, 6, 9}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -222,10 +222,10 @@ tBTM_STATUS btm_ble_enable_multi_adv (BOOLEAN enable, UINT8 inst_id, UINT8 cb_ev
|
||||||
** Returns tx power in dBm
|
** Returns tx power in dBm
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
int btm_ble_tx_power[BTM_BLE_ADV_TX_POWER_MAX + 1] = BTM_BLE_ADV_TX_POWER;
|
static const int btm_ble_tx_power[BTM_BLE_ADV_TX_POWER_MAX + 1] = BTM_BLE_ADV_TX_POWER;
|
||||||
char btm_ble_map_adv_tx_power(int tx_power_index)
|
char btm_ble_map_adv_tx_power(int tx_power_index)
|
||||||
{
|
{
|
||||||
if (0 <= tx_power_index && tx_power_index < BTM_BLE_ADV_TX_POWER_MAX) {
|
if (0 <= tx_power_index && tx_power_index <= BTM_BLE_ADV_TX_POWER_MAX) {
|
||||||
return (char)btm_ble_tx_power[tx_power_index];
|
return (char)btm_ble_tx_power[tx_power_index];
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -375,10 +375,7 @@ typedef UINT8 tBTM_BLE_AD_TYPE;
|
||||||
|
|
||||||
/* adv tx power level */
|
/* adv tx power level */
|
||||||
#define BTM_BLE_ADV_TX_POWER_MIN 0 /* minimum tx power */
|
#define BTM_BLE_ADV_TX_POWER_MIN 0 /* minimum tx power */
|
||||||
#define BTM_BLE_ADV_TX_POWER_LOW 1 /* low tx power */
|
#define BTM_BLE_ADV_TX_POWER_MAX 7 /* maximum tx power */
|
||||||
#define BTM_BLE_ADV_TX_POWER_MID 2 /* middle tx power */
|
|
||||||
#define BTM_BLE_ADV_TX_POWER_UPPER 3 /* upper tx power */
|
|
||||||
#define BTM_BLE_ADV_TX_POWER_MAX 4 /* maximum tx power */
|
|
||||||
typedef UINT8 tBTM_BLE_ADV_TX_POWER;
|
typedef UINT8 tBTM_BLE_ADV_TX_POWER;
|
||||||
|
|
||||||
/* adv tx power in dBm */
|
/* adv tx power in dBm */
|
||||||
|
|
|
@ -2232,14 +2232,14 @@ test cases:
|
||||||
- ["R SSC1 C +BLEADV:SetAdv,OK"]
|
- ["R SSC1 C +BLEADV:SetAdv,OK"]
|
||||||
- *dut1_start_adv
|
- *dut1_start_adv
|
||||||
- - "SSC SSC2 blescan -D -z start -t 1 -e 1"
|
- - "SSC SSC2 blescan -D -z start -t 1 -e 1"
|
||||||
- - 'P SSC2 RE "\+BTSCANEXT:%%s,txp,0xEB"%%(<dut1_bt_mac>)'
|
- - 'P SSC2 RE "\+BTSCANEXT:%%s,txp,0x03"%%(<dut1_bt_mac>)'
|
||||||
- 'R SSC2 C Complete'
|
- 'R SSC2 C Complete'
|
||||||
- *dut1_stop_adv
|
- *dut1_stop_adv
|
||||||
- - "SSC SSC1 bleadv -L -c 0 -x 0 -t 3"
|
- - "SSC SSC1 bleadv -L -c 0 -x 0 -t 3"
|
||||||
- ["R SSC1 C +BLEADV:SetAdv,OK"]
|
- ["R SSC1 C +BLEADV:SetAdv,OK"]
|
||||||
- *dut1_start_adv
|
- *dut1_start_adv
|
||||||
- - "SSC SSC2 blescan -D -z start -t 1 -e 1"
|
- - "SSC SSC2 blescan -D -z start -t 1 -e 1"
|
||||||
- - 'R SSC2 NRE "\+BTSCANEXT:%%s,txp,0xEB"%%(<dut1_bt_mac>)'
|
- - 'R SSC2 NRE "\+BTSCANEXT:%%s,txp,0x03"%%(<dut1_bt_mac>)'
|
||||||
- 'R SSC2 C Complete'
|
- 'R SSC2 C Complete'
|
||||||
- ID: BTSTK_GAP_09007
|
- ID: BTSTK_GAP_09007
|
||||||
<<: *GAP_CASE
|
<<: *GAP_CASE
|
||||||
|
|
Loading…
Reference in a new issue