Commit 587ad456 authored by Piotr Pryga's avatar Piotr Pryga Committed by Christopher Friedt
Browse files

Bluetooth: hci: Add handling of allowed CTE types for per sync create



Add missing code responsible for handling of allowed CTE types
in HCI_LE_Periodic_Advertising_Create_Sync command.

Signed-off-by: default avatarPiotr Pryga <piotr.pryga@nordicsemi.no>
parent 169b85c1
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -3287,10 +3287,12 @@ static void le_per_adv_create_sync(struct net_buf *buf, struct net_buf **evt)
	skip = sys_le16_to_cpu(cmd->skip);
	sync_timeout = sys_le16_to_cpu(cmd->sync_timeout);

	status = ll_sync_create(cmd->options, cmd->sid, cmd->addr.type,
				cmd->addr.a.val, skip, sync_timeout,
				cmd->cte_type);

	if ((cmd->cte_type & BT_HCI_LE_PER_ADV_CREATE_SYNC_CTE_TYPE_INVALID_VALUE) != 0) {
		status = BT_HCI_ERR_CMD_DISALLOWED;
	} else {
		status = ll_sync_create(cmd->options, cmd->sid, cmd->addr.type, cmd->addr.a.val,
					skip, sync_timeout, cmd->cte_type);
	}
	*evt = cmd_status(status);
}

@@ -5503,7 +5505,7 @@ static void le_per_adv_sync_established(struct pdu_data *pdu_data,
	sep->status = se->status;
	sep->handle = sys_cpu_to_le16(node_rx->hdr.handle);

	if (sep->status) {
	if (sep->status != BT_HCI_ERR_SUCCESS && sep->status != BT_HCI_ERR_UNSUPP_REMOTE_FEATURE) {
		return;
	}