Skip to content

Commit 93020e5

Browse files
thomas-m-johansenrlubos
authored andcommitted
bluetooth: hci: add kconfigs and handling for new vs command
a new VS command was added for CS that allows the setting of multiple different CS parameters. added a KConfig to use the set T_PM functionality of the new vs command. Signed-off-by: Thomas Johansen <[email protected]>
1 parent a83b6d2 commit 93020e5

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

subsys/bluetooth/controller/Kconfig

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,50 @@ config BT_CTLR_SDC_CS_EVENT_LEN_DEFAULT
635635
help
636636
The time set aside for channel sounding events in microseconds.
637637

638+
choice BT_CTLR_SDC_CS_T_PM_LEN_DEFAULT_SELECTION
639+
prompt "Default channel sounding t_pm length"
640+
depends on BT_CTLR_CHANNEL_SOUNDING
641+
default BT_CTLR_SDC_CS_T_PM_LEN_10_US
642+
help
643+
Set the preferred tone length (T_PM) of CS tones
644+
645+
In Channel Sounding, tones in step mode-2 and -3 have a length of t_pm microseconds.
646+
T_PM can be 10, 20 or 40 microseconds.
647+
648+
Since the T_PM can affect the quality of tone measurements, it is important for
649+
certain use-cases to be able to set a preferred T_PM. The controller will then use
650+
this value when the LE CS Create Config command is issued.
651+
652+
If the local or peer device does not support the suggested preferred T_PM, it cannot
653+
be used. The controller will then select a T_PM value supported by both local and
654+
peer devices when the LE CS Create Config command is issued.
655+
656+
config BT_CTLR_SDC_CS_T_PM_LEN_10_US
657+
bool "10 us"
658+
depends on BT_CTLR_CHANNEL_SOUNDING
659+
help
660+
Set controller default channel sounding tones to 10 microseconds.
661+
662+
config BT_CTLR_SDC_CS_T_PM_LEN_20_US
663+
bool "20 us"
664+
depends on BT_CTLR_CHANNEL_SOUNDING
665+
help
666+
Set controller default channel sounding tones to 20 microseconds.
667+
668+
config BT_CTLR_SDC_CS_T_PM_LEN_40_US
669+
bool "40 us"
670+
depends on BT_CTLR_CHANNEL_SOUNDING
671+
help
672+
Set controller default channel sounding tones to 40 microseconds.
673+
endchoice
674+
675+
config BT_CTLR_SDC_CS_T_PM_LEN_DEFAULT
676+
int
677+
depends on BT_CTLR_CHANNEL_SOUNDING
678+
default 10 if BT_CTLR_SDC_CS_T_PM_LEN_10_US
679+
default 20 if BT_CTLR_SDC_CS_T_PM_LEN_20_US
680+
default 40 if BT_CTLR_SDC_CS_T_PM_LEN_40_US
681+
638682
config BT_CTLR_SDC_LE_POWER_CLASS_1
639683
bool "Device supports transmitting at LE Power Class 1 level"
640684
default y if BT_CTLR_TX_PWR_ANTENNA >= 10

subsys/bluetooth/controller/hci_driver.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,19 @@ static int hci_driver_open(const struct device *dev, bt_hci_recv_t recv_func)
14591459
}
14601460
#endif /* CONFIG_BT_CTLR_CHANNEL_SOUNDING */
14611461

1462+
#if defined(CONFIG_BT_CTLR_CHANNEL_SOUNDING)
1463+
sdc_hci_cmd_vs_cs_params_set_t cs_params_set_t_pm_length = {
1464+
.cs_param_type = SDC_HCI_VS_CS_PARAM_TYPE_CS_T_PM_SET,
1465+
.cs_param_data.cs_t_pm_params.cs_t_pm_length_us =
1466+
CONFIG_BT_CTLR_SDC_CS_T_PM_LEN_DEFAULT
1467+
};
1468+
err = sdc_hci_cmd_vs_cs_params_set(&cs_params_set_t_pm_length);
1469+
if (err) {
1470+
MULTITHREADING_LOCK_RELEASE();
1471+
return -ENOTSUP;
1472+
}
1473+
#endif /* CONFIG_BT_CTLR_CHANNEL_SOUNDING */
1474+
14621475
#if defined(CONFIG_BT_CTLR_SDC_BIG_RESERVED_TIME_US)
14631476
sdc_hci_cmd_vs_big_reserved_time_set_t big_reserved_time_params = {
14641477
.reserved_time_us = CONFIG_BT_CTLR_SDC_BIG_RESERVED_TIME_US

0 commit comments

Comments
 (0)