[nRF Connect SDK](Urgent) How to fix Tx power?

Target nRF52832(nrf52dk_nrf52832)
SDK NCS v2.0.0
My project base: \nrf\samples\bluetooth\peripheral_hids_keyboard

Hello.
I want to increase Tx power for test. I already review sample(zephyr/samples/bluetooth/hci_pwr_ctrl) and I found it looks working in log.
I try to put changes into my project; however, it works at first time only.
I disconnect and connect again; I lose my pairing. I could connect again until BLE power off and on.
Can I fix my Tx power using CONFIX_XXX? Or how can fix it?

// main.c
static void set_tx_power(uint8_t handle_type, uint16_t handle, int8_t tx_pwr_lvl)
{
...
}

static void connected(struct bt_conn *conn, uint8_t err)
{
...
set_tx_power(BT_HCI_VS_LL_HANDLE_TYPE_CONN, default_conn_handle, 4);
}


Prj.conf
#Tx
CONFIG_BT_CTLR_ADVANCED_FEATURES=y
CONFIG_BT_CTLR_CONN_RSSI=y
CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y


Parents Reply
  • Tim Hwang said:
    1. CONFIG_XXX for Tx 
    Do you have any idea?

    You can change the default Tx power using CONFIG_BT_CTLR_TX_PWR_*, for instance CONFIG_BT_CTLR_TX_PWR_PLUS_4 to set +4 dBm. Note that this does not work with early versions of the SoftDevice controller, though.

    Tim Hwang said:
    2.. Handle

    This code looks a bit odd, and while I did not fully understand the failure you described it is clear an error occurred). You should essentially do as you can see in the implementation of set_tx_power() in zephyr/samples/bluetooth/hci_pwr_ctrl/src/main.c. Note also that this is called with a parameter that distinguishes between roles).

Children
No Data
Related