Skip to content

Commit 1f0de18

Browse files
weeTikerlubos
authored andcommitted
Bluetooth: Controller: Enable Connection Subrating support in the SDC
This enables experimental support for Connection Subrating. Signed-off-by: Timothy Keys <[email protected]>
1 parent f2e5013 commit 1f0de18

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

subsys/bluetooth/controller/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ config BT_LL_SOFTDEVICE
3838
select BT_HAS_HCI_VS
3939
select BT_CTLR_DF_SUPPORT if HAS_HW_NRF_RADIO_DFE
4040
select BT_CTLR_LE_POWER_CONTROL_SUPPORT
41+
select BT_CTLR_SUBRATING_SUPPORT
4142
depends on (SOC_SERIES_BSIM_NRFXX || SOC_SERIES_NRF52X || SOC_COMPATIBLE_NRF5340_CPUNET ||\
4243
SOC_NRF54H20_CPURAD || SOC_SERIES_NRF54LX)
4344
help
@@ -563,5 +564,9 @@ config BT_CTLR_SDC_CIS_SUBEVENT_LENGTH_US
563564
If this parameter is set to zero, the subevent length
564565
is chosen by the controller.
565566

567+
config BT_CTLR_SUBRATING
568+
bool "LE Connection Subrating [EXPERIMENTAL]"
569+
select EXPERIMENTAL
570+
566571
endmenu
567572
endif # BT_LL_SOFTDEVICE

subsys/bluetooth/controller/hci_driver.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,21 @@ static int configure_supported_features(void)
860860
}
861861
#endif
862862

863+
if (IS_ENABLED(CONFIG_BT_CTLR_SUBRATING)) {
864+
if (IS_ENABLED(CONFIG_BT_CENTRAL)) {
865+
err = sdc_support_connection_subrating_central();
866+
if (err) {
867+
return -ENOTSUP;
868+
}
869+
}
870+
if (IS_ENABLED(CONFIG_BT_PERIPHERAL)) {
871+
err = sdc_support_connection_subrating_peripheral();
872+
if (err) {
873+
return -ENOTSUP;
874+
}
875+
}
876+
}
877+
863878
return 0;
864879
}
865880

subsys/bluetooth/controller/hci_internal.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ static bool command_generates_command_complete_event(uint16_t hci_opcode)
6565
case SDC_HCI_OPCODE_CMD_LE_CREATE_BIG:
6666
case SDC_HCI_OPCODE_CMD_LE_CREATE_BIG_TEST:
6767
case SDC_HCI_OPCODE_CMD_LE_TERMINATE_BIG:
68+
case SDC_HCI_OPCODE_CMD_LE_SUBRATE_REQUEST:
6869
return false;
6970
default:
7071
return true;
@@ -611,6 +612,13 @@ void hci_internal_supported_commands(sdc_hci_ip_supported_commands_t *cmds)
611612
#if defined(CONFIG_BT_CTLR_ISO_RX_BUFFERS)
612613
cmds->hci_le_iso_receive_test = 1;
613614
#endif
615+
616+
#if defined(CONFIG_BT_CTLR_SUBRATING)
617+
#if defined(CONFIG_BT_CENTRAL)
618+
cmds->hci_le_set_default_subrate_command = 1;
619+
#endif
620+
cmds->hci_le_subrate_request_command = 1;
621+
#endif /* CONFIG_BT_CTLR_SUBRATING */
614622
}
615623

616624
#if defined(CONFIG_BT_HCI_VS)
@@ -785,6 +793,10 @@ void hci_internal_le_supported_features(
785793
#if defined(CONFIG_BT_CTLR_SDC_PAWR_SYNC)
786794
features->params.periodic_advertising_with_responses_scanner = 1;
787795
#endif
796+
797+
#if defined(CONFIG_BT_CTLR_SUBRATING)
798+
features->params.connection_subrating = 1;
799+
#endif
788800
}
789801

790802
static void le_read_supported_states(uint8_t *buf)
@@ -1534,6 +1546,15 @@ static uint8_t le_controller_cmd_put(uint8_t const * const cmd,
15341546
(void *)event_out_params);
15351547
#endif
15361548

1549+
#if defined(CONFIG_BT_CTLR_SUBRATING)
1550+
#if defined(CONFIG_BT_CENTRAL)
1551+
case SDC_HCI_OPCODE_CMD_LE_SET_DEFAULT_SUBRATE:
1552+
return sdc_hci_cmd_le_set_default_subrate((void *)cmd_params);
1553+
#endif
1554+
case SDC_HCI_OPCODE_CMD_LE_SUBRATE_REQUEST:
1555+
return sdc_hci_cmd_le_subrate_request((void *)cmd_params);
1556+
#endif /* CONFIG_BT_CTLR_SUBRATING */
1557+
15371558
default:
15381559
return BT_HCI_ERR_UNKNOWN_CMD;
15391560
}

0 commit comments

Comments
 (0)