Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
cs.h File Reference

Bluetooth Channel Sounding handling. More...

#include <stdint.h>
#include <stdbool.h>
#include <zephyr/bluetooth/hci_types.h>
#include <zephyr/bluetooth/conn.h>

Go to the source code of this file.

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_initiator_snr_control {
  BT_LE_CS_INITIATOR_SNR_CONTROL_18dB = BT_HCI_OP_LE_CS_INITIATOR_SNR_18 , BT_LE_CS_INITIATOR_SNR_CONTROL_21dB = BT_HCI_OP_LE_CS_INITIATOR_SNR_21 , BT_LE_CS_INITIATOR_SNR_CONTROL_24dB = BT_HCI_OP_LE_CS_INITIATOR_SNR_24 , BT_LE_CS_INITIATOR_SNR_CONTROL_27dB = BT_HCI_OP_LE_CS_INITIATOR_SNR_27 ,
  BT_LE_CS_INITIATOR_SNR_CONTROL_30dB = BT_HCI_OP_LE_CS_INITIATOR_SNR_30 , BT_LE_CS_INITIATOR_SNR_CONTROL_NOT_USED = BT_HCI_OP_LE_CS_INITIATOR_SNR_NOT_USED
}
 CS Test Initiator SNR control options. More...
 
enum  bt_le_cs_reflector_snr_control {
  BT_LE_CS_REFLECTOR_SNR_CONTROL_18dB = BT_HCI_OP_LE_CS_REFLECTOR_SNR_18 , BT_LE_CS_REFLECTOR_SNR_CONTROL_21dB = BT_HCI_OP_LE_CS_REFLECTOR_SNR_21 , BT_LE_CS_REFLECTOR_SNR_CONTROL_24dB = BT_HCI_OP_LE_CS_REFLECTOR_SNR_24 , BT_LE_CS_REFLECTOR_SNR_CONTROL_27dB = BT_HCI_OP_LE_CS_REFLECTOR_SNR_27 ,
  BT_LE_CS_REFLECTOR_SNR_CONTROL_30dB = BT_HCI_OP_LE_CS_REFLECTOR_SNR_30 , BT_LE_CS_REFLECTOR_SNR_CONTROL_NOT_USED = BT_HCI_OP_LE_CS_REFLECTOR_SNR_NOT_USED
}
 CS Test Reflector 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

Bluetooth Channel Sounding handling.