Merge branch 'bugfix/fix_extend_adv_tx_pwr_signed_type_err_v5.0' into 'release/v5.0'

Fixed extend adv tx power range error (backport v5.0)

See merge request espressif/esp-idf!20226
This commit is contained in:
Jiang Jiang Jian
2022-09-20 16:07:26 +08:00
8 changed files with 17 additions and 8 deletions

View File

@@ -760,6 +760,9 @@ typedef uint8_t esp_ble_gap_sync_t;
typedef uint8_t esp_ble_gap_adv_type_t; typedef uint8_t esp_ble_gap_adv_type_t;
/// Extend advertising tx power, range: [-127, +126] dBm
#define EXT_ADV_TX_PWR_NO_PREFERENCE (127) /*!< host has no preference for tx power */
/** /**
* @brief ext adv parameters * @brief ext adv parameters
*/ */

View File

@@ -1469,7 +1469,7 @@ typedef struct {
tBLE_ADDR_TYPE peer_addr_type; tBLE_ADDR_TYPE peer_addr_type;
BD_ADDR peer_addr; BD_ADDR peer_addr;
tBTA_BLE_AFP filter_policy; tBTA_BLE_AFP filter_policy;
UINT8 tx_power; INT8 tx_power;
tBTA_DM_BLE_GAP_PHY primary_phy; tBTA_DM_BLE_GAP_PHY primary_phy;
UINT8 max_skip; UINT8 max_skip;
tBTA_DM_BLE_GAP_PHY secondary_phy; tBTA_DM_BLE_GAP_PHY secondary_phy;

View File

@@ -1214,7 +1214,7 @@ UINT8 btsnd_hcic_ble_set_extend_rand_address(UINT8 adv_handle, BD_ADDR rand_addr
UINT8 btsnd_hcic_ble_set_ext_adv_params(UINT8 adv_handle, UINT16 properties, UINT32 interval_min, UINT8 btsnd_hcic_ble_set_ext_adv_params(UINT8 adv_handle, UINT16 properties, UINT32 interval_min,
UINT32 interval_max, UINT8 channel_map, UINT8 own_addr_type, UINT32 interval_max, UINT8 channel_map, UINT8 own_addr_type,
UINT8 peer_addr_type, BD_ADDR peer_addr, UINT8 peer_addr_type, BD_ADDR peer_addr,
UINT8 adv_filter_policy, UINT8 adv_tx_power, UINT8 adv_filter_policy, INT8 adv_tx_power,
UINT8 primary_adv_phy, UINT8 secondary_adv_max_skip, UINT8 primary_adv_phy, UINT8 secondary_adv_max_skip,
UINT8 secondary_adv_phy, UINT8 secondary_adv_phy,
UINT8 adv_sid, UINT8 scan_req_ntf_enable) UINT8 adv_sid, UINT8 scan_req_ntf_enable)
@@ -1244,7 +1244,7 @@ UINT8 btsnd_hcic_ble_set_ext_adv_params(UINT8 adv_handle, UINT16 properties, UIN
UINT8_TO_STREAM(pp, peer_addr_type); UINT8_TO_STREAM(pp, peer_addr_type);
BDADDR_TO_STREAM (pp, peer_addr); BDADDR_TO_STREAM (pp, peer_addr);
UINT8_TO_STREAM(pp, adv_filter_policy); UINT8_TO_STREAM(pp, adv_filter_policy);
UINT8_TO_STREAM(pp, adv_tx_power); INT8_TO_STREAM(pp, adv_tx_power);
UINT8_TO_STREAM(pp, primary_adv_phy); UINT8_TO_STREAM(pp, primary_adv_phy);
UINT8_TO_STREAM(pp, secondary_adv_max_skip); UINT8_TO_STREAM(pp, secondary_adv_max_skip);
UINT8_TO_STREAM(pp, secondary_adv_phy); UINT8_TO_STREAM(pp, secondary_adv_phy);

View File

@@ -767,7 +767,7 @@ typedef struct {
tBLE_ADDR_TYPE peer_addr_type; tBLE_ADDR_TYPE peer_addr_type;
BD_ADDR peer_addr; BD_ADDR peer_addr;
tBTM_BLE_AFP filter_policy; tBTM_BLE_AFP filter_policy;
UINT8 tx_power; INT8 tx_power;
tBTM_BLE_GAP_PHY primary_phy; tBTM_BLE_GAP_PHY primary_phy;
UINT8 max_skip; UINT8 max_skip;
tBTM_BLE_GAP_PHY secondary_phy; tBTM_BLE_GAP_PHY secondary_phy;

View File

@@ -962,7 +962,7 @@ UINT8 btsnd_hcic_ble_set_extend_rand_address(UINT8 adv_handle, BD_ADDR rand_addr
UINT8 btsnd_hcic_ble_set_ext_adv_params(UINT8 adv_handle, UINT16 properties, UINT32 interval_min, UINT8 btsnd_hcic_ble_set_ext_adv_params(UINT8 adv_handle, UINT16 properties, UINT32 interval_min,
UINT32 interval_max, UINT8 channel_map, UINT8 own_addr_type, UINT32 interval_max, UINT8 channel_map, UINT8 own_addr_type,
UINT8 peer_addr_type, BD_ADDR peer_addr, UINT8 peer_addr_type, BD_ADDR peer_addr,
UINT8 adv_filter_policy, UINT8 adv_tx_power, UINT8 adv_filter_policy, INT8 adv_tx_power,
UINT8 primary_adv_phy, UINT8 secondary_adv_max_skip, UINT8 primary_adv_phy, UINT8 secondary_adv_max_skip,
UINT8 secondary_adv_phy, UINT8 secondary_adv_phy,
UINT8 adv_sid, UINT8 scan_req_ntf_enable); UINT8 adv_sid, UINT8 scan_req_ntf_enable);

View File

@@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Unlicense OR CC0-1.0 * SPDX-License-Identifier: Unlicense OR CC0-1.0
*/ */
@@ -55,6 +55,7 @@ esp_ble_gap_ext_adv_params_t ext_adv_params_2M = {
.sid = 0, .sid = 0,
.scan_req_notif = false, .scan_req_notif = false,
.own_addr_type = BLE_ADDR_TYPE_PUBLIC, .own_addr_type = BLE_ADDR_TYPE_PUBLIC,
.tx_power = EXT_ADV_TX_PWR_NO_PREFERENCE,
}; };
struct gatts_profile_inst { struct gatts_profile_inst {

View File

@@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Unlicense OR CC0-1.0 * SPDX-License-Identifier: Unlicense OR CC0-1.0
*/ */
@@ -64,6 +64,7 @@ esp_ble_gap_ext_adv_params_t ext_adv_params_1M = {
.sid = 0, .sid = 0,
.scan_req_notif = false, .scan_req_notif = false,
.own_addr_type = BLE_ADDR_TYPE_RANDOM, .own_addr_type = BLE_ADDR_TYPE_RANDOM,
.tx_power = EXT_ADV_TX_PWR_NO_PREFERENCE,
}; };
esp_ble_gap_ext_adv_params_t ext_adv_params_2M = { esp_ble_gap_ext_adv_params_t ext_adv_params_2M = {
@@ -78,6 +79,7 @@ esp_ble_gap_ext_adv_params_t ext_adv_params_2M = {
.sid = 1, .sid = 1,
.scan_req_notif = false, .scan_req_notif = false,
.own_addr_type = BLE_ADDR_TYPE_RANDOM, .own_addr_type = BLE_ADDR_TYPE_RANDOM,
.tx_power = EXT_ADV_TX_PWR_NO_PREFERENCE,
}; };
esp_ble_gap_ext_adv_params_t legacy_adv_params = { esp_ble_gap_ext_adv_params_t legacy_adv_params = {
@@ -92,6 +94,7 @@ esp_ble_gap_ext_adv_params_t legacy_adv_params = {
.sid = 2, .sid = 2,
.scan_req_notif = false, .scan_req_notif = false,
.own_addr_type = BLE_ADDR_TYPE_RANDOM, .own_addr_type = BLE_ADDR_TYPE_RANDOM,
.tx_power = EXT_ADV_TX_PWR_NO_PREFERENCE,
}; };
esp_ble_gap_ext_adv_params_t ext_adv_params_coded = { esp_ble_gap_ext_adv_params_t ext_adv_params_coded = {
@@ -106,6 +109,7 @@ esp_ble_gap_ext_adv_params_t ext_adv_params_coded = {
.sid = 3, .sid = 3,
.scan_req_notif = false, .scan_req_notif = false,
.own_addr_type = BLE_ADDR_TYPE_RANDOM, .own_addr_type = BLE_ADDR_TYPE_RANDOM,
.tx_power = EXT_ADV_TX_PWR_NO_PREFERENCE,
}; };
static uint8_t raw_adv_data_1m[] = { static uint8_t raw_adv_data_1m[] = {

View File

@@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Unlicense OR CC0-1.0 * SPDX-License-Identifier: Unlicense OR CC0-1.0
*/ */
@@ -65,6 +65,7 @@ esp_ble_gap_ext_adv_params_t ext_adv_params_2M = {
.sid = 0, .sid = 0,
.scan_req_notif = false, .scan_req_notif = false,
.own_addr_type = BLE_ADDR_TYPE_RANDOM, .own_addr_type = BLE_ADDR_TYPE_RANDOM,
.tx_power = EXT_ADV_TX_PWR_NO_PREFERENCE,
}; };
static esp_ble_gap_periodic_adv_params_t periodic_adv_params = { static esp_ble_gap_periodic_adv_params_t periodic_adv_params = {