Bluetooth: controller: add functions to enable CTE req LLCP

Add functions that handle enable CTE request control procedure
request from host.
Implementation of ll_df_set_conn_cte_req_enable in ULL is partial.
It will be integrated with refactored implementation of control
procedures.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
This commit is contained in:
Piotr Pryga 2021-08-12 23:08:37 +02:00 committed by Christopher Friedt
commit 0b07a7812e
3 changed files with 113 additions and 3 deletions

View file

@ -2735,6 +2735,24 @@ static void le_df_set_conn_cte_rx_params(struct net_buf *buf, struct net_buf **e
rp->status = status;
rp->handle = handle_le16;
}
static void le_df_set_conn_cte_req_enable(struct net_buf *buf, struct net_buf **evt)
{
struct bt_hci_cp_le_conn_cte_req_enable *cmd = (void *)buf->data;
struct bt_hci_rp_le_conn_cte_req_enable *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_req_enable(handle, cmd->enable, cmd->cte_request_interval,
cmd->requested_cte_length, cmd->requested_cte_type);
rp = hci_cmd_complete(evt, sizeof(*rp));
rp->status = status;
rp->handle = handle_le16;
}
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_RSP */
static void le_df_read_ant_inf(struct net_buf *buf, struct net_buf **evt)
@ -3904,6 +3922,9 @@ static int controller_cmd_handle(uint16_t ocf, struct net_buf *cmd,
case BT_OCF(BT_HCI_OP_LE_SET_CONN_CTE_RX_PARAMS):
le_df_set_conn_cte_rx_params(cmd, evt);
break;
case BT_OCF(BT_HCI_OP_LE_CONN_CTE_REQ_ENABLE):
le_df_set_conn_cte_req_enable(cmd, evt);
break;
#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_REQ */
#endif /* CONFIG_BT_CTLR_DF */