Bluetooth: controller: Add handling for HCI set CTE Rx parameters

HCI_LE_Set_Connection_CTE_Receive_Parameters handling is required to
enable sampling of Constant Tone Extension in connected mode.

The commit adds handling for HCI_LE_Set_Connection_CTE_Receive_-
-Parameters command.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
This commit is contained in:
Piotr Pryga 2021-07-25 11:01:39 +02:00 committed by Christopher Friedt
commit 52ec547894
3 changed files with 84 additions and 1 deletions

View file

@ -2707,7 +2707,28 @@ static void le_df_set_conn_cte_tx_params(struct net_buf *buf,
status = ll_df_set_conn_cte_tx_params(handle, cmd->cte_types,
cmd->switch_pattern_len,
cmd->ant_id);
cmd->ant_ids);
rp = hci_cmd_complete(evt, sizeof(*rp));
rp->status = status;
rp->handle = handle_le16;
}
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RSP */
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_REQ)
static void le_df_set_conn_cte_rx_params(struct net_buf *buf, struct net_buf **evt)
{
struct bt_hci_cp_le_set_conn_cte_rx_params *cmd = (void *)buf->data;
struct bt_hci_rp_le_set_conn_cte_rx_params *rp;
uint16_t handle, handle_le16;
uint8_t status;
handle_le16 = cmd->handle;
handle = sys_le16_to_cpu(handle_le16);
status = ll_df_set_conn_cte_rx_params(handle, cmd->sampling_enable, cmd->slot_durations,
cmd->switch_pattern_len, cmd->ant_ids);
rp = hci_cmd_complete(evt, sizeof(*rp));
@ -3879,6 +3900,11 @@ static int controller_cmd_handle(uint16_t ocf, struct net_buf *cmd,
le_df_set_conn_cte_tx_params(cmd, evt);
break;
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RSP */
#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_REQ)
case BT_OCF(BT_HCI_OP_LE_SET_CONN_CTE_RX_PARAMS):
le_df_set_conn_cte_rx_params(cmd, evt);
break;
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_REQ */
#endif /* CONFIG_BT_CTLR_DF */
#if defined(CONFIG_BT_CTLR_DTM_HCI)