Skip to content

Commit 8ff4585

Browse files
Tronilcarlescufi
authored andcommitted
Bluetooth: Controller: Check for duplicate handles in le_set_ext_adv_enable
If there are duplicate handles the Controller shall return the error code Invalid HCI Command Parameters (0x12) Fixes a failure in the EBQ test LE/AdvExt/Req-01 (part of the Ellisys quality test suite) Signed-off-by: Troels Nilsson <[email protected]>
1 parent 5eaace1 commit 8ff4585

File tree

1 file changed

+12
-0
lines changed
  • subsys/bluetooth/controller/hci

1 file changed

+12
-0
lines changed

subsys/bluetooth/controller/hci/hci.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3529,6 +3529,18 @@ static void le_set_ext_adv_enable(struct net_buf *buf, struct net_buf **evt)
35293529
return;
35303530
}
35313531

3532+
/* Check for duplicate handles */
3533+
if (IS_ENABLED(CONFIG_BT_CTLR_PARAM_CHECK)) {
3534+
for (uint8_t i = 0U; i < set_num - 1; i++) {
3535+
for (uint8_t j = i + 1U; j < set_num; j++) {
3536+
if (cmd->s[i].handle == cmd->s[j].handle) {
3537+
*evt = cmd_complete_status(BT_HCI_ERR_INVALID_PARAM);
3538+
return;
3539+
}
3540+
}
3541+
}
3542+
}
3543+
35323544
s = (void *) cmd->s;
35333545
do {
35343546
status = ll_adv_set_by_hci_handle_get(s->handle, &handle);

0 commit comments

Comments
 (0)