Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Channel Sounding (CS)

LE Channel Sounding (CS) . More...

Data Structures

struct  bt_le_cs_set_default_settings_param
 Default CS settings in the local Controller. More...
 
struct  bt_le_cs_test_param
 CS Test parameters. More...
 
struct  bt_le_cs_create_config_params
 CS Create Config params. More...
 
struct  bt_le_cs_test_cb
 Callbacks for CS Test. More...
 
struct  bt_le_cs_subevent_step
 Subevent result step. More...
 
struct  bt_le_cs_iq_sample
 Sign-extended IQ value extracted from step data. More...
 
struct  bt_le_cs_procedure_enable_param
 
struct  bt_le_cs_set_procedure_parameters_param
 

Macros

#define BT_LE_CS_CHANNEL_BIT_GET(chmap, bit)
 Macro for getting a specific channel bit in CS channel map.
 
#define BT_LE_CS_CHANNEL_BIT_SET_VAL(chmap, bit, val)
 Macro for setting a specific channel bit value in CS channel map.
 
#define BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_1   BIT(0)
 
#define BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_2   BIT(1)
 
#define BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_3   BIT(2)
 
#define BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_4   BIT(3)
 

Enumerations

enum  bt_le_cs_sync_antenna_selection_opt {
  BT_LE_CS_ANTENNA_SELECTION_OPT_ONE = BT_HCI_OP_LE_CS_ANTENNA_SEL_ONE , BT_LE_CS_ANTENNA_SELECTION_OPT_TWO = BT_HCI_OP_LE_CS_ANTENNA_SEL_TWO , BT_LE_CS_ANTENNA_SELECTION_OPT_THREE = BT_HCI_OP_LE_CS_ANTENNA_SEL_THREE , BT_LE_CS_ANTENNA_SELECTION_OPT_FOUR = BT_HCI_OP_LE_CS_ANTENNA_SEL_FOUR ,
  BT_LE_CS_ANTENNA_SELECTION_OPT_REPETITIVE = BT_HCI_OP_LE_CS_ANTENNA_SEL_REP , BT_LE_CS_ANTENNA_SELECTION_OPT_NO_RECOMMENDATION = BT_HCI_OP_LE_CS_ANTENNA_SEL_NONE
}
 
enum  bt_le_cs_test_cs_sync_antenna_selection { BT_LE_CS_TEST_CS_SYNC_ANTENNA_SELECTION_ONE = BT_HCI_OP_LE_CS_ANTENNA_SEL_ONE , BT_LE_CS_TEST_CS_SYNC_ANTENNA_SELECTION_TWO = BT_HCI_OP_LE_CS_ANTENNA_SEL_TWO , BT_LE_CS_TEST_CS_SYNC_ANTENNA_SELECTION_THREE = BT_HCI_OP_LE_CS_ANTENNA_SEL_THREE , BT_LE_CS_TEST_CS_SYNC_ANTENNA_SELECTION_FOUR = BT_HCI_OP_LE_CS_ANTENNA_SEL_FOUR }
 CS Test CS_SYNC Antenna Identifier. More...
 
enum  bt_le_cs_snr_control {
  BT_LE_CS_SNR_CONTROL_18dB = BT_HCI_OP_LE_CS_SNR_18 , BT_LE_CS_SNR_CONTROL_21dB = BT_HCI_OP_LE_CS_SNR_21 , BT_LE_CS_SNR_CONTROL_24dB = BT_HCI_OP_LE_CS_SNR_24 , BT_LE_CS_SNR_CONTROL_27dB = BT_HCI_OP_LE_CS_SNR_27 ,
  BT_LE_CS_SNR_CONTROL_30dB = BT_HCI_OP_LE_CS_SNR_30 , BT_LE_CS_SNR_CONTROL_NOT_USED = BT_HCI_OP_LE_CS_SNR_NOT_USED
}
 CS SNR control options. More...
 
enum  bt_le_cs_test_override_3_pm_tone_ext {
  BT_LE_CS_TEST_OVERRIDE_3_NO_TONE_EXT = BT_HCI_OP_LE_CS_TEST_TONE_EXT_NONE , BT_LE_CS_TEST_OVERRIDE_3_INITIATOR_TONE_EXT_ONLY = BT_HCI_OP_LE_CS_TEST_TONE_EXT_INIT , BT_LE_CS_TEST_OVERRIDE_3_REFLECTOR_TONE_EXT_ONLY = BT_HCI_OP_LE_CS_TEST_TONE_EXT_REFL , BT_LE_CS_TEST_OVERRIDE_3_INITIATOR_AND_REFLECTOR_TONE_EXT ,
  BT_LE_CS_TEST_OVERRIDE_3_REPETITIVE_TONE_EXT = BT_HCI_OP_LE_CS_TEST_TONE_EXT_REPEAT
}
 CS Test Override 3 T_PM Tone Extension. More...
 
enum  bt_le_cs_test_override_4_tone_antenna_permutation {
  BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_00 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_00 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_01 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_01 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_02 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_02 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_03 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_03 ,
  BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_04 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_04 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_05 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_05 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_06 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_06 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_07 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_07 ,
  BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_08 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_08 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_09 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_09 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_10 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_10 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_11 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_11 ,
  BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_12 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_12 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_13 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_13 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_14 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_14 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_15 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_15 ,
  BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_16 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_16 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_17 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_17 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_18 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_18 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_19 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_19 ,
  BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_20 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_20 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_21 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_21 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_22 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_22 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_23 = BT_HCI_OP_LE_CS_TEST_AP_INDEX_23 ,
  BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_LOOP
}
 CS Test Override 4 Tone Antenna Permutation. More...
 
enum  bt_le_cs_test_override_7_ss_marker_value { BT_LE_CS_TEST_OVERRIDE_7_SS_MARKER_VAL_0011 = BT_HCI_OP_LE_CS_TEST_SS_MARKER_VAL_0011 , BT_LE_CS_TEST_OVERRIDE_7_SS_MARKER_VAL_1100 = BT_HCI_OP_LE_CS_TEST_SS_MARKER_VAL_1100 , BT_LE_CS_TEST_OVERRIDE_7_SS_MARKER_VAL_LOOP = BT_HCI_OP_LE_CS_TEST_SS_MARKER_VAL_LOOP }
 CS Test Override 7 Sounding Sequence Marker Value. More...
 
enum  bt_le_cs_test_override_8_cs_sync_payload_pattern {
  BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_PRBS9 = BT_HCI_OP_LE_CS_TEST_PAYLOAD_PRBS9 , BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_11110000 = BT_HCI_OP_LE_CS_TEST_PAYLOAD_11110000 , BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_10101010 = BT_HCI_OP_LE_CS_TEST_PAYLOAD_10101010 , BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_PRBS15 = BT_HCI_OP_LE_CS_TEST_PAYLOAD_PRBS15 ,
  BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_11111111 = BT_HCI_OP_LE_CS_TEST_PAYLOAD_11111111 , BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_00000000 = BT_HCI_OP_LE_CS_TEST_PAYLOAD_00000000 , BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_00001111 = BT_HCI_OP_LE_CS_TEST_PAYLOAD_00001111 , BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_01010101 = BT_HCI_OP_LE_CS_TEST_PAYLOAD_01010101 ,
  BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_USER = BT_HCI_OP_LE_CS_TEST_PAYLOAD_USER
}
 CS Test Override 8 CS_SYNC Payload Pattern. More...
 
enum  bt_le_cs_create_config_context { BT_LE_CS_CREATE_CONFIG_CONTEXT_LOCAL_ONLY , BT_LE_CS_CREATE_CONFIG_CONTEXT_LOCAL_AND_REMOTE }
 CS config creation context. More...
 
enum  bt_le_cs_procedure_phy { BT_LE_CS_PROCEDURE_PHY_1M = BT_HCI_OP_LE_CS_PROCEDURE_PHY_1M , BT_LE_CS_PROCEDURE_PHY_2M = BT_HCI_OP_LE_CS_PROCEDURE_PHY_2M , BT_LE_CS_PROCEDURE_PHY_CODED_S8 = BT_HCI_OP_LE_CS_PROCEDURE_PHY_CODED_S8 , BT_LE_CS_PROCEDURE_PHY_CODED_S2 = BT_HCI_OP_LE_CS_PROCEDURE_PHY_CODED_S2 }
 

Functions

struct bt_le_cs_iq_sample bt_le_cs_parse_pct (const uint8_t pct[3])
 Extract in-phase and quadrature terms from HCI-formatted PCT.
 
void bt_le_cs_set_valid_chmap_bits (uint8_t channel_map[10])
 Set all valid channel map bits.
 
int bt_le_cs_read_remote_supported_capabilities (struct bt_conn *conn)
 Read Remote Supported Capabilities.
 
int bt_le_cs_set_default_settings (struct bt_conn *conn, const struct bt_le_cs_set_default_settings_param *params)
 Set Channel Sounding default settings.
 
int bt_le_cs_read_remote_fae_table (struct bt_conn *conn)
 Read Remote FAE Table.
 
int bt_le_cs_test_cb_register (struct bt_le_cs_test_cb cs_test_cb)
 Register callbacks for the CS Test mode.
 
int bt_le_cs_start_test (const struct bt_le_cs_test_param *params)
 Start a CS test.
 
int bt_le_cs_create_config (struct bt_conn *conn, struct bt_le_cs_create_config_params *params, enum bt_le_cs_create_config_context context)
 Create CS configuration.
 
int bt_le_cs_remove_config (struct bt_conn *conn, uint8_t config_id)
 Create CS configuration.
 
int bt_le_cs_stop_test (void)
 Stop ongoing CS Test.
 
void bt_le_cs_step_data_parse (struct net_buf_simple *step_data_buf, bool(*func)(struct bt_le_cs_subevent_step *step, void *user_data), void *user_data)
 Parse CS Subevent Step Data.
 
int bt_le_cs_security_enable (struct bt_conn *conn)
 CS Security Enable.
 
int bt_le_cs_procedure_enable (struct bt_conn *conn, const struct bt_le_cs_procedure_enable_param *params)
 CS Procedure Enable.
 
int bt_le_cs_set_procedure_parameters (struct bt_conn *conn, const struct bt_le_cs_set_procedure_parameters_param *params)
 CS Set Procedure Parameters.
 
int bt_le_cs_set_channel_classification (uint8_t channel_classification[10])
 CS Set Channel Classification.
 
int bt_le_cs_read_local_supported_capabilities (struct bt_conn_le_cs_capabilities *ret)
 CS Read Local Supported Capabilities.
 
int bt_le_cs_write_cached_remote_supported_capabilities (struct bt_conn *conn, const struct bt_conn_le_cs_capabilities *params)
 CS Write Cached Remote Supported Capabilities.
 
int bt_le_cs_write_cached_remote_fae_table (struct bt_conn *conn, int8_t remote_fae_table[72])
 CS Write Cached Remote FAE Table.
 

Detailed Description

LE Channel Sounding (CS) .

Macro Definition Documentation

◆ BT_LE_CS_CHANNEL_BIT_GET

#define BT_LE_CS_CHANNEL_BIT_GET ( chmap,
bit )

#include <zephyr/bluetooth/cs.h>

Value:
(((chmap)[(bit) / 8] >> ((bit) % 8)) & 1)

Macro for getting a specific channel bit in CS channel map.

Parameters
[in]chmapChannel map array
[in]bitBit number to be accessed
Returns
Bit value, either 1 or 0

◆ BT_LE_CS_CHANNEL_BIT_SET_VAL

#define BT_LE_CS_CHANNEL_BIT_SET_VAL ( chmap,
bit,
val )

#include <zephyr/bluetooth/cs.h>

Value:
((chmap)[(bit) / 8] = ((chmap)[(bit) / 8] & ~BIT((bit) % 8)) | ((val) << ((bit) % 8)))

Macro for setting a specific channel bit value in CS channel map.

Parameters
[in]chmapChannel map array
[in]bitBit number to be accessed
[in]valBit value to be set, either 1 or 0

◆ BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_1

#define BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_1   BIT(0)

◆ BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_2

#define BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_2   BIT(1)

◆ BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_3

#define BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_3   BIT(2)

◆ BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_4

#define BT_LE_CS_PROCEDURE_PREFERRED_PEER_ANTENNA_4   BIT(3)

Enumeration Type Documentation

◆ bt_le_cs_create_config_context

#include <zephyr/bluetooth/cs.h>

CS config creation context.

Enumerator
BT_LE_CS_CREATE_CONFIG_CONTEXT_LOCAL_ONLY 

Write CS configuration in local Controller only

BT_LE_CS_CREATE_CONFIG_CONTEXT_LOCAL_AND_REMOTE 

Write CS configuration in both local and remote Controller using Channel Sounding Configuration procedure.

◆ bt_le_cs_procedure_phy

#include <zephyr/bluetooth/cs.h>

Enumerator
BT_LE_CS_PROCEDURE_PHY_1M 
BT_LE_CS_PROCEDURE_PHY_2M 
BT_LE_CS_PROCEDURE_PHY_CODED_S8 
BT_LE_CS_PROCEDURE_PHY_CODED_S2 

◆ bt_le_cs_snr_control

#include <zephyr/bluetooth/cs.h>

CS SNR control options.

Enumerator
BT_LE_CS_SNR_CONTROL_18dB 
BT_LE_CS_SNR_CONTROL_21dB 
BT_LE_CS_SNR_CONTROL_24dB 
BT_LE_CS_SNR_CONTROL_27dB 
BT_LE_CS_SNR_CONTROL_30dB 
BT_LE_CS_SNR_CONTROL_NOT_USED 

◆ bt_le_cs_sync_antenna_selection_opt

#include <zephyr/bluetooth/cs.h>

Enumerator
BT_LE_CS_ANTENNA_SELECTION_OPT_ONE 

Use antenna identifier 1 for CS_SYNC packets.

BT_LE_CS_ANTENNA_SELECTION_OPT_TWO 

Use antenna identifier 2 for CS_SYNC packets.

BT_LE_CS_ANTENNA_SELECTION_OPT_THREE 

Use antenna identifier 3 for CS_SYNC packets.

BT_LE_CS_ANTENNA_SELECTION_OPT_FOUR 

Use antenna identifier 4 for CS_SYNC packets.

BT_LE_CS_ANTENNA_SELECTION_OPT_REPETITIVE 

Use antennas in repetitive order from 1 to 4 for CS_SYNC packets.

BT_LE_CS_ANTENNA_SELECTION_OPT_NO_RECOMMENDATION 

No recommendation for local controller antenna selection.

◆ bt_le_cs_test_cs_sync_antenna_selection

#include <zephyr/bluetooth/cs.h>

CS Test CS_SYNC Antenna Identifier.

Enumerator
BT_LE_CS_TEST_CS_SYNC_ANTENNA_SELECTION_ONE 
BT_LE_CS_TEST_CS_SYNC_ANTENNA_SELECTION_TWO 
BT_LE_CS_TEST_CS_SYNC_ANTENNA_SELECTION_THREE 
BT_LE_CS_TEST_CS_SYNC_ANTENNA_SELECTION_FOUR 

◆ bt_le_cs_test_override_3_pm_tone_ext

#include <zephyr/bluetooth/cs.h>

CS Test Override 3 T_PM Tone Extension.

Enumerator
BT_LE_CS_TEST_OVERRIDE_3_NO_TONE_EXT 

Initiator and reflector tones sent without tone extension.

BT_LE_CS_TEST_OVERRIDE_3_INITIATOR_TONE_EXT_ONLY 

Initiator tone sent with extension, reflector tone sent without tone extension.

BT_LE_CS_TEST_OVERRIDE_3_REFLECTOR_TONE_EXT_ONLY 

Initiator tone sent without extension, reflector tone sent with tone extension.

BT_LE_CS_TEST_OVERRIDE_3_INITIATOR_AND_REFLECTOR_TONE_EXT 

Initiator and reflector tones sent with tone extension.

BT_LE_CS_TEST_OVERRIDE_3_REPETITIVE_TONE_EXT 

Applicable for mode-2 and mode-3 only:

Loop through:

◆ bt_le_cs_test_override_4_tone_antenna_permutation

#include <zephyr/bluetooth/cs.h>

CS Test Override 4 Tone Antenna Permutation.

These values represent indices in an antenna path permutation table.

Which table is applicable (and which indices are valid) depends on the maximum number of antenna paths (N_AP).

If N_AP = 2, the permutation table is:

+-----------------------------—+---------------------------------------—+ | Antenna Path Permutation Index | Antenna Path Positions After Permutation | +-----------------------------—+---------------------------------------—+ | 0 | A1 A2 | | 1 | A2 A1 | +-----------------------------—+---------------------------------------—+

If N_AP = 3, the permutation table is:

+-----------------------------—+---------------------------------------—+ | Antenna Path Permutation Index | Antenna Path Positions After Permutation | +-----------------------------—+---------------------------------------—+ | 0 | A1 A2 A3 | | 1 | A2 A1 A3 | | 2 | A1 A3 A2 | | 3 | A3 A1 A2 | | 4 | A3 A2 A1 | | 5 | A2 A3 A1 | +-----------------------------—+---------------------------------------—+

If N_AP = 4, the permutation table is:

+-----------------------------—+---------------------------------------—+ | Antenna Path Permutation Index | Antenna Path Positions After Permutation | +-----------------------------—+---------------------------------------—+ | 0 | A1 A2 A3 A4 | | 1 | A2 A1 A3 A4 | | 2 | A1 A3 A2 A4 | | 3 | A3 A1 A2 A4 | | 4 | A3 A2 A1 A4 | | 5 | A2 A3 A1 A4 | | 6 | A1 A2 A4 A3 | | 7 | A2 A1 A4 A3 | | 8 | A1 A4 A2 A3 | | 9 | A4 A1 A2 A3 | | 10 | A4 A2 A1 A3 | | 11 | A2 A4 A1 A3 | | 12 | A1 A4 A3 A2 | | 13 | A4 A1 A3 A2 | | 14 | A1 A3 A4 A2 | | 15 | A3 A1 A4 A2 | | 16 | A3 A4 A1 A2 | | 17 | A4 A3 A1 A2 | | 18 | A4 A2 A3 A1 | | 19 | A2 A4 A3 A1 | | 20 | A4 A3 A2 A1 | | 21 | A3 A4 A2 A1 | | 22 | A3 A2 A4 A1 | | 23 | A2 A3 A4 A1 | +-----------------------------—+---------------------------------------—+

Enumerator
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_00 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_01 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_02 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_03 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_04 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_05 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_06 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_07 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_08 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_09 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_10 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_11 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_12 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_13 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_14 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_15 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_16 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_17 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_18 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_19 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_20 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_21 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_22 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_23 
BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_LOOP 

Loop through all valid Antenna Permutation Indices starting from the lowest index.

◆ bt_le_cs_test_override_7_ss_marker_value

#include <zephyr/bluetooth/cs.h>

CS Test Override 7 Sounding Sequence Marker Value.

Enumerator
BT_LE_CS_TEST_OVERRIDE_7_SS_MARKER_VAL_0011 
BT_LE_CS_TEST_OVERRIDE_7_SS_MARKER_VAL_1100 
BT_LE_CS_TEST_OVERRIDE_7_SS_MARKER_VAL_LOOP 

Loop through pattern '0011' and '1100' (in transmission order)

◆ bt_le_cs_test_override_8_cs_sync_payload_pattern

#include <zephyr/bluetooth/cs.h>

CS Test Override 8 CS_SYNC Payload Pattern.

Enumerator
BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_PRBS9 

PRBS9 payload sequence.

BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_11110000 

Repeated '11110000' payload sequence.

BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_10101010 

Repeated '10101010' payload sequence.

BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_PRBS15 

PRBS15 payload sequence.

BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_11111111 

Repeated '11111111' payload sequence.

BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_00000000 

Repeated '00000000' payload sequence.

BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_00001111 

Repeated '00001111' payload sequence.

BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_01010101 

Repeated '01010101' payload sequence.

BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_USER 

Custom payload provided by the user.

Function Documentation

◆ bt_le_cs_create_config()

int bt_le_cs_create_config ( struct bt_conn * conn,
struct bt_le_cs_create_config_params * params,
enum bt_le_cs_create_config_context context )

#include <zephyr/bluetooth/cs.h>

Create CS configuration.

This command is used to create a new CS configuration or update an existing one with the config id specified.

Note
To use this API CONFIG_BT_CHANNEL_SOUNDING must be set.
Parameters
connConnection Object.
paramsCS Create Config parameters
contextControls whether the configuration is written to the local controller or both the local and the remote controller
Returns
Zero on success or (negative) error code on failure.

◆ bt_le_cs_parse_pct()

struct bt_le_cs_iq_sample bt_le_cs_parse_pct ( const uint8_t pct[3])

#include <zephyr/bluetooth/cs.h>

Extract in-phase and quadrature terms from HCI-formatted PCT.

Convenience function for processing 24-bit phase correction terms found in CS step data. The 12-bit signed real and imaginary components are converted to host endianness and sign-extended.

Parameters
pct24-bit little-endian phase correction term.
Returns
struct bt_le_cs_iq_sample containing real and imaginary terms as int16_t

◆ bt_le_cs_procedure_enable()

int bt_le_cs_procedure_enable ( struct bt_conn * conn,
const struct bt_le_cs_procedure_enable_param * params )

#include <zephyr/bluetooth/cs.h>

CS Procedure Enable.

This command is used to enable or disable the scheduling of CS procedures by the local Controller, with the remote device identified in the conn parameter.

Note
To use this API CONFIG_BT_CHANNEL_SOUNDING must be set.
Parameters
connConnection Object.
paramsParameters for the CS Procedure Enable command.
Returns
Zero on success or (negative) error code on failure.

◆ bt_le_cs_read_local_supported_capabilities()

int bt_le_cs_read_local_supported_capabilities ( struct bt_conn_le_cs_capabilities * ret)

#include <zephyr/bluetooth/cs.h>

CS Read Local Supported Capabilities.

This command is used to read the CS capabilities that are supported by the local Controller.

Note
To use this API CONFIG_BT_CHANNEL_SOUNDING must be set.
Parameters
retReturn values for the CS Procedure Enable command.
Returns
Zero on success or (negative) error code on failure.

◆ bt_le_cs_read_remote_fae_table()

int bt_le_cs_read_remote_fae_table ( struct bt_conn * conn)

#include <zephyr/bluetooth/cs.h>

Read Remote FAE Table.

This command is used to read the per-channel mode-0 Frequency Actuation Error table of the remote Controller.

Note
To use this API CONFIG_BT_CHANNEL_SOUNDING must be set.
Parameters
connConnection Object.
Returns
Zero on success or (negative) error code on failure.

◆ bt_le_cs_read_remote_supported_capabilities()

int bt_le_cs_read_remote_supported_capabilities ( struct bt_conn * conn)

#include <zephyr/bluetooth/cs.h>

Read Remote Supported Capabilities.

This command is used to query the CS capabilities that are supported by the remote controller.

Note
To use this API CONFIG_BT_CHANNEL_SOUNDING must be set.
Parameters
connConnection Object.
Returns
Zero on success or (negative) error code on failure.

◆ bt_le_cs_remove_config()

int bt_le_cs_remove_config ( struct bt_conn * conn,
uint8_t config_id )

#include <zephyr/bluetooth/cs.h>

Create CS configuration.

This command is used to remove a CS configuration from the local controller identified by the config_id

Note
To use this API CONFIG_BT_CHANNEL_SOUNDING must be set.
Parameters
connConnection Object.
config_idCS Config ID
Returns
Zero on success or (negative) error code on failure.

◆ bt_le_cs_security_enable()

int bt_le_cs_security_enable ( struct bt_conn * conn)

#include <zephyr/bluetooth/cs.h>

CS Security Enable.

This command is used to start or restart the Channel Sounding Security Start procedure in the local Controller for the ACL connection identified in the conn parameter.

Note
To use this API CONFIG_BT_CHANNEL_SOUNDING must be set.
Parameters
connConnection Object.
Returns
Zero on success or (negative) error code on failure.

◆ bt_le_cs_set_channel_classification()

int bt_le_cs_set_channel_classification ( uint8_t channel_classification[10])

#include <zephyr/bluetooth/cs.h>

CS Set Channel Classification.

This command is used to update the channel classification based on its local information.

The nth bitfield (in the range 0 to 78) contains the value for the CS channel index n. Channel Enabled = 1; Channel Disabled = 0.

Channels n = 0, 1, 23, 24, 25, 77, and 78 shall be reserved for future use and shall be set to zero. At least 15 channels shall be enabled.

The most significant bit (bit 79) is reserved for future use.

Note
To use this API, CONFIG_BT_CHANNEL_SOUNDING must be set.
Parameters
channel_classificationBit fields
Returns
Zero on success or (negative) error code on failure.

◆ bt_le_cs_set_default_settings()

int bt_le_cs_set_default_settings ( struct bt_conn * conn,
const struct bt_le_cs_set_default_settings_param * params )

#include <zephyr/bluetooth/cs.h>

Set Channel Sounding default settings.

This command is used to set default Channel Sounding settings for this connection.

Note
To use this API CONFIG_BT_CHANNEL_SOUNDING must be set.
Parameters
connConnection Object.
paramsChannel sounding default settings parameters.
Returns
Zero on success or (negative) error code on failure.

◆ bt_le_cs_set_procedure_parameters()

int bt_le_cs_set_procedure_parameters ( struct bt_conn * conn,
const struct bt_le_cs_set_procedure_parameters_param * params )

#include <zephyr/bluetooth/cs.h>

CS Set Procedure Parameters.

This command is used to set the parameters for the scheduling of one or more CS procedures by the local controller.

Note
To use this API CONFIG_BT_CHANNEL_SOUNDING must be set.
Parameters
connConnection Object.
paramsParameters for the CS Set Procedure Parameters command.
Returns
Zero on success or (negative) error code on failure.

◆ bt_le_cs_set_valid_chmap_bits()

void bt_le_cs_set_valid_chmap_bits ( uint8_t channel_map[10])

#include <zephyr/bluetooth/cs.h>

Set all valid channel map bits.

This command is used to enable all valid channels in a given CS channel map

Parameters
channel_mapChanel map

◆ bt_le_cs_start_test()

int bt_le_cs_start_test ( const struct bt_le_cs_test_param * params)

#include <zephyr/bluetooth/cs.h>

Start a CS test.

This command is used to start a CS test where the IUT is placed in the role of either the initiator or reflector.

The first mode-0 channel in the list is used as the starting channel for the test. At the beginning of any test, the IUT in the reflector role shall listen on the first mode-0 channel until it receives the first transmission from the initiator. Similarly, with the IUT in the initiator role, the tester will start by listening on the first mode-0 channel and the IUT shall transmit on that channel for the first half of the first CS step. Thereafter, the parameters of this command describe the required transmit and receive behavior for the CS test.

Note
To use this API CONFIG_BT_CHANNEL_SOUNDING_TEST must be set.
Parameters
paramsCS Test parameters
Returns
Zero on success or (negative) error code on failure.

◆ bt_le_cs_step_data_parse()

void bt_le_cs_step_data_parse ( struct net_buf_simple * step_data_buf,
bool(* func )(struct bt_le_cs_subevent_step *step, void *user_data),
void * user_data )

#include <zephyr/bluetooth/cs.h>

Parse CS Subevent Step Data.

A helper for parsing HCI-formatted step data found in channel sounding subevent results.

A typical use-case is filtering out data which does not meet certain packet quality or NADM requirements.

Warning
This function will consume the data when parsing.
Parameters
step_data_bufPointer to a buffer containing the step data.
funcCallback function which will be called for each step data found. The callback should return true to continue parsing, or false to stop.
user_dataUser data to be passed to the callback.

◆ bt_le_cs_stop_test()

int bt_le_cs_stop_test ( void )

#include <zephyr/bluetooth/cs.h>

Stop ongoing CS Test.

This command is used to stop any CS test that is in progress.

The controller is expected to finish reporting any subevent results before completing this termination.

Note
To use this API CONFIG_BT_CHANNEL_SOUNDING_TEST must be set.
Returns
Zero on success or (negative) error code on failure.

◆ bt_le_cs_test_cb_register()

int bt_le_cs_test_cb_register ( struct bt_le_cs_test_cb cs_test_cb)

#include <zephyr/bluetooth/cs.h>

Register callbacks for the CS Test mode.

Existing callbacks can be unregistered by providing NULL function pointers.

Note
To use this API CONFIG_BT_CHANNEL_SOUNDING_TEST must be set.
Parameters
cs_test_cbSet of callbacks to be used with CS Test
Returns
Zero on success or (negative) error code on failure.

◆ bt_le_cs_write_cached_remote_fae_table()

int bt_le_cs_write_cached_remote_fae_table ( struct bt_conn * conn,
int8_t remote_fae_table[72] )

#include <zephyr/bluetooth/cs.h>

CS Write Cached Remote FAE Table.

This command is used to write a cached copy of the per-channel mode-0 Frequency Actuation Error table of the remote device in the local Controller.

Note
To use this API CONFIG_BT_CHANNEL_SOUNDING must be set.
Parameters
connConnection Object.
remote_fae_tablePer-channel mode-0 FAE table of the local Controller
Returns
Zero on success or (negative) error code on failure.

◆ bt_le_cs_write_cached_remote_supported_capabilities()

int bt_le_cs_write_cached_remote_supported_capabilities ( struct bt_conn * conn,
const struct bt_conn_le_cs_capabilities * params )

#include <zephyr/bluetooth/cs.h>

CS Write Cached Remote Supported Capabilities.

This command is used to write the cached copy of the CS capabilities that are supported by the remote Controller for the connection identified.

Note
To use this API CONFIG_BT_CHANNEL_SOUNDING must be set.
Parameters
connConnection Object.
paramsParameters for the CS Write Cached Remote Supported Capabilities command.
Returns
Zero on success or (negative) error code on failure.