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

commit 98feaf20adae91745d6e2d5db67a0716c79ba932
Author: Szymon Janc <[email protected]>
AuthorDate: Mon Sep 26 14:16:10 2022 +0200

    nimble/ll: Fix not resetting TX power on HCI reset
    
    Reset TX power to default on HCI reset. There is no standard way of
    setting (or reading) TX power so make sure things are at default when
    reseting controller.
---
 nimble/controller/src/ble_ll.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/nimble/controller/src/ble_ll.c b/nimble/controller/src/ble_ll.c
index bb44a278..2ce70765 100644
--- a/nimble/controller/src/ble_ll.c
+++ b/nimble/controller/src/ble_ll.c
@@ -1349,7 +1349,8 @@ ble_ll_task(void *arg)
     /* Init ble phy */
     ble_phy_init();
 
-    /* Set output power to 1mW (0 dBm) */
+    /* Set output power to default */
+    g_ble_ll_tx_power = ble_phy_txpower_round(MYNEWT_VAL(BLE_LL_TX_PWR_DBM));
     ble_phy_txpwr_set(g_ble_ll_tx_power);
 
     /* Tell the host that we are ready to receive packets */
@@ -1595,6 +1596,10 @@ ble_ll_reset(void)
     g_ble_ll_tx_power_compensation = 0;
     g_ble_ll_rx_power_compensation = 0;
 
+    /* Set output power to default */
+    g_ble_ll_tx_power = ble_phy_txpower_round(MYNEWT_VAL(BLE_LL_TX_PWR_DBM));
+    ble_phy_txpwr_set(g_ble_ll_tx_power);
+
     /* FLush all packets from Link layer queues */
     ble_ll_flush_pkt_queue(&g_ble_ll_data.ll_tx_pkt_q);
     ble_ll_flush_pkt_queue(&g_ble_ll_data.ll_rx_pkt_q);

Reply via email to