Skip to content

Commit

Permalink
Bluetooth: Controller: Make it possible to set CIS subevent length
Browse files Browse the repository at this point in the history
Add Kconfig entry and VS HCI command to make it possible to
set subevent length. The default configuration makes
the controller select the minimum possible subevent length.

Signed-off-by: Rubin Gerritsen <[email protected]>
  • Loading branch information
rugeGerritsen authored and cvinayak committed Feb 26, 2024
1 parent 46d86aa commit 7419244
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions subsys/bluetooth/controller/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -540,5 +540,15 @@ config BT_CTLR_SDC_CIG_RESERVED_TIME_US
help
The time reserved for other roles in each ISO interval, used when selecting CIG parameters.

config BT_CTLR_SDC_CIS_SUBEVENT_LENGTH_US
int "CIS subevent length [us]"
default 0
help
Sets the subevent length to be used for CISes in microseconds.
If the configured subevent length is too small, the
HCI command used to configure the CIG will fail.
If this parameter is set to zero, the subevent length
is chosen by the controller.

endmenu
endif # BT_LL_SOFTDEVICE
11 changes: 11 additions & 0 deletions subsys/bluetooth/controller/hci_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,17 @@ static int hci_driver_open(void)
}
}

if (IS_ENABLED(CONFIG_BT_CTLR_CONN_ISO)) {
sdc_hci_cmd_vs_cis_subevent_length_set_t params = {
.cis_subevent_length_us = CONFIG_BT_CTLR_SDC_CIS_SUBEVENT_LENGTH_US
};
err = sdc_hci_cmd_vs_cis_subevent_length_set(&params);
if (err) {
MULTITHREADING_LOCK_RELEASE();
return -ENOTSUP;
}
}

if (IS_ENABLED(CONFIG_BT_CONN)) {
sdc_hci_cmd_vs_event_length_set_t params = {
.event_length_us = CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT
Expand Down
4 changes: 4 additions & 0 deletions subsys/bluetooth/controller/hci_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ static void vs_supported_commands(sdc_hci_vs_supported_vs_commands_t *cmds)
#endif
#if defined(CONFIG_BT_CTLR_CONN_ISO)
cmds->cig_reserved_time_set = 1;
cmds->cis_subevent_length_set = 1;
#endif
}
#endif /* CONFIG_BT_HCI_VS */
Expand Down Expand Up @@ -1631,6 +1632,9 @@ static uint8_t vs_cmd_put(uint8_t const *const cmd, uint8_t *const raw_event_out
case SDC_HCI_OPCODE_CMD_VS_CIG_RESERVED_TIME_SET:
return sdc_hci_cmd_vs_cig_reserved_time_set(
(sdc_hci_cmd_vs_cig_reserved_time_set_t const *)cmd_params);
case SDC_HCI_OPCODE_CMD_VS_CIS_SUBEVENT_LENGTH_SET:
return sdc_hci_cmd_vs_cis_subevent_length_set(
(sdc_hci_cmd_vs_cis_subevent_length_set_t const *)cmd_params);
#endif
default:
return BT_HCI_ERR_UNKNOWN_CMD;
Expand Down

0 comments on commit 7419244

Please sign in to comment.