Skip to content

Commit

Permalink
nimble/ll: Set handle in cmd_resp before return
Browse files Browse the repository at this point in the history
Minor fix. We should set conn_handle in the
command response buffer before returning.
  • Loading branch information
m-gorecki committed Oct 29, 2024
1 parent ae401ab commit b73cbab
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions nimble/controller/src/ble_ll_conn_hci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,8 @@ ble_ll_conn_hci_set_data_len(const uint8_t *cmdbuf, uint8_t len,
tx_time = le16toh(cmd->tx_time);

if (!ble_ll_hci_check_dle(tx_octets, tx_time)) {
return BLE_ERR_INV_HCI_CMD_PARMS;
rc = BLE_ERR_INV_HCI_CMD_PARMS;
goto done;
}

rc = ble_ll_conn_set_data_len(connsm, tx_octets, tx_time, 0, 0);
Expand Down Expand Up @@ -2071,18 +2072,21 @@ ble_ll_set_sync_transfer_params(const uint8_t *cmdbuf, uint8_t len,

if (MYNEWT_VAL(BLE_VERSION) >= 53) {
if (cmd->mode > 0x03) {
return BLE_ERR_INV_HCI_CMD_PARMS;
rc = BLE_ERR_INV_HCI_CMD_PARMS;
goto done;
}

if ((cmd->mode == 0x03) &&
!MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PERIODIC_ADV_ADI_SUPPORT)) {
/* We do not support ADI in periodic advertising thus cannot enable
* duplicate filtering.
*/
return BLE_ERR_UNSUPPORTED;
rc = BLE_ERR_UNSUPPORTED;
goto done;
}
} else if (cmd->mode > 0x02) {
return BLE_ERR_INV_HCI_CMD_PARMS;
rc = BLE_ERR_INV_HCI_CMD_PARMS;
goto done;
}

skip = le16toh(cmd->skip);
Expand Down

0 comments on commit b73cbab

Please sign in to comment.