Skip to content

Commit 587ad45

Browse files
ppryga-nordiccfriedt
authored andcommitted
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: Piotr Pryga <[email protected]>
1 parent 169b85c commit 587ad45

File tree

1 file changed

+7
-5
lines changed
  • subsys/bluetooth/controller/hci

1 file changed

+7
-5
lines changed

subsys/bluetooth/controller/hci/hci.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3287,10 +3287,12 @@ static void le_per_adv_create_sync(struct net_buf *buf, struct net_buf **evt)
32873287
skip = sys_le16_to_cpu(cmd->skip);
32883288
sync_timeout = sys_le16_to_cpu(cmd->sync_timeout);
32893289

3290-
status = ll_sync_create(cmd->options, cmd->sid, cmd->addr.type,
3291-
cmd->addr.a.val, skip, sync_timeout,
3292-
cmd->cte_type);
3293-
3290+
if ((cmd->cte_type & BT_HCI_LE_PER_ADV_CREATE_SYNC_CTE_TYPE_INVALID_VALUE) != 0) {
3291+
status = BT_HCI_ERR_CMD_DISALLOWED;
3292+
} else {
3293+
status = ll_sync_create(cmd->options, cmd->sid, cmd->addr.type, cmd->addr.a.val,
3294+
skip, sync_timeout, cmd->cte_type);
3295+
}
32943296
*evt = cmd_status(status);
32953297
}
32963298

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

5506-
if (sep->status) {
5508+
if (sep->status != BT_HCI_ERR_SUCCESS && sep->status != BT_HCI_ERR_UNSUPP_REMOTE_FEATURE) {
55075509
return;
55085510
}
55095511

0 commit comments

Comments
 (0)