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.
@@ -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);
