Skip to content

Commit

Permalink
Bluetooth: Controller: Enable Connection Subrating support in the SDC
Browse files Browse the repository at this point in the history
This enables experimental support for Connection Subrating.

Signed-off-by: Timothy Keys <[email protected]>
  • Loading branch information
weeTike committed May 24, 2024
1 parent de6a369 commit 0e42d05
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
15 changes: 15 additions & 0 deletions subsys/bluetooth/controller/hci_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,21 @@ static int configure_supported_features(void)
}
#endif

if (IS_ENABLED(CONFIG_BT_CTLR_SUBRATING)) {
if (IS_ENABLED(CONFIG_BT_CENTRAL)) {
err = sdc_support_connection_subrating_central();
if (err) {
return -ENOTSUP;
}
}
if (IS_ENABLED(CONFIG_BT_PERIPHERAL)) {
err = sdc_support_connection_subrating_peripheral();
if (err) {
return -ENOTSUP;
}
}
}

return 0;
}

Expand Down
16 changes: 16 additions & 0 deletions subsys/bluetooth/controller/hci_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,11 @@ void hci_internal_supported_commands(sdc_hci_ip_supported_commands_t *cmds)
#if defined(CONFIG_BT_CTLR_ISO_RX_BUFFERS)
cmds->hci_le_iso_receive_test = 1;
#endif

#if defined(CONFIG_BT_CTLR_SUBRATING)
cmds->hci_le_set_default_subrate_command = 1;
cmds->hci_le_subrate_request_command = 1;
#endif
}

#if defined(CONFIG_BT_HCI_VS)
Expand Down Expand Up @@ -781,6 +786,10 @@ void hci_internal_le_supported_features(
#if defined(CONFIG_BT_CTLR_SDC_PAWR_SYNC)
features->params.periodic_advertising_with_responses_scanner = 1;
#endif

#if defined(CONFIG_BT_CTLR_SUBRATING)
features->params.connection_subrating = 1;
#endif
}

static void le_read_supported_states(uint8_t *buf)
Expand Down Expand Up @@ -1528,6 +1537,13 @@ static uint8_t le_controller_cmd_put(uint8_t const * const cmd,
(void *)event_out_params);
#endif

#if defined(CONFIG_BT_CTLR_SUBRATING)
case SDC_HCI_OPCODE_CMD_LE_SET_DEFAULT_SUBRATE:
return sdc_hci_cmd_le_set_default_subrate((void *)cmd_params);
case SDC_HCI_OPCODE_CMD_LE_SUBRATE_REQUEST:
return sdc_hci_cmd_le_subrate_request((void *)cmd_params);
#endif

default:
return BT_HCI_ERR_UNKNOWN_CMD;
}
Expand Down

0 comments on commit 0e42d05

Please sign in to comment.