HI
I am currently using the nRF54L15 chip with NCS 3.2.1, carrying out secondary development based on the periodic_sync_conn sample project. I intend to adjust the transmit (TX) power before the response data is reported. I have found that the function below can be called to modify TX power; however, this function only works for adjusting the TX power of the advertising broadcaster and has no effect on the TX power used for response transmissions. Which function should I invoke to configure the TX power specifically for response packets?
static void set_tx_power(uint8_t handle_type, uint16_t handle, int8_t tx_pwr_lvl)
{
struct bt_hci_cp_vs_write_tx_power_level *cp;
struct bt_hci_rp_vs_write_tx_power_level *rp;
struct net_buf *buf, *rsp = NULL;
int err;
buf = bt_hci_cmd_alloc(K_FOREVER);
if (!buf) {
printk("Unable to allocate command buffer\n");
return;
}
cp = net_buf_add(buf, sizeof(*cp));
cp->handle = sys_cpu_to_le16(handle);
cp->handle_type = handle_type;
cp->tx_power_level = tx_pwr_lvl;
err = bt_hci_cmd_send_sync(BT_HCI_OP_VS_WRITE_TX_POWER_LEVEL,
buf, &rsp);
if (err) {
printk("Set Tx power err: %d\n", err);
return;
}
rp = (void *)rsp->data;
printk("Actual Tx Power: %d\n", rp->selected_tx_power);
net_buf_unref(rsp);
}
Thanks!