You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2022/02/04 15:56:42 UTC
[mynewt-nimble] branch master updated: nimble/ll: Fix not using configured TX power for advertising
This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
The following commit(s) were added to refs/heads/master by this push:
new 1f2acea nimble/ll: Fix not using configured TX power for advertising
1f2acea is described below
commit 1f2acea2e92d3e49bc5b27a4f785741ffaf03947
Author: Szymon Janc <sz...@codecoup.pl>
AuthorDate: Fri Feb 4 15:41:41 2022 +0100
nimble/ll: Fix not using configured TX power for advertising
If TX power was tuned with HCI VS command, advertising was using
default value anyway.
---
nimble/controller/src/ble_ll_adv.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/nimble/controller/src/ble_ll_adv.c b/nimble/controller/src/ble_ll_adv.c
index caa817e..61f3059 100644
--- a/nimble/controller/src/ble_ll_adv.c
+++ b/nimble/controller/src/ble_ll_adv.c
@@ -1806,7 +1806,7 @@ ble_ll_adv_set_adv_params(const uint8_t *cmdbuf, uint8_t len)
return BLE_ERR_INV_HCI_CMD_PARMS;
}
- advsm->adv_txpwr = MYNEWT_VAL(BLE_LL_TX_PWR_DBM);
+ advsm->adv_txpwr = g_ble_ll_tx_power;
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY)
if (cmd->own_addr_type > BLE_HCI_ADV_OWN_ADDR_RANDOM) {
@@ -2783,7 +2783,7 @@ ble_ll_adv_read_txpwr(uint8_t *rspbuf, uint8_t *rsplen)
{
struct ble_hci_le_rd_adv_chan_txpwr_rp *rsp = (void *) rspbuf;
- rsp->power_level = MYNEWT_VAL(BLE_LL_TX_PWR_DBM);
+ rsp->power_level = g_ble_ll_tx_power;
*rsplen = sizeof(*rsp);
return BLE_ERR_SUCCESS;
@@ -3416,7 +3416,7 @@ ble_ll_adv_ext_set_param(const uint8_t *cmdbuf, uint8_t len,
if (cmd->tx_power == 127) {
/* no preference */
- advsm->adv_txpwr = MYNEWT_VAL(BLE_LL_TX_PWR_DBM);
+ advsm->adv_txpwr = g_ble_ll_tx_power;
} else {
advsm->adv_txpwr = ble_phy_txpower_round(cmd->tx_power);
}