Zephyr API Documentation 4.2.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>
#include <zephyr/net_buf.h>
#include <zephyr/sys/util_macro.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 = 0x01 , BT_LE_CS_ANTENNA_SELECTION_OPT_TWO = 0x02 , BT_LE_CS_ANTENNA_SELECTION_OPT_THREE = 0x03 , BT_LE_CS_ANTENNA_SELECTION_OPT_FOUR = 0x04 ,
  BT_LE_CS_ANTENNA_SELECTION_OPT_REPETITIVE = 0xFE , BT_LE_CS_ANTENNA_SELECTION_OPT_NO_RECOMMENDATION = 0xFF
}
enum  bt_le_cs_test_cs_sync_antenna_selection { BT_LE_CS_TEST_CS_SYNC_ANTENNA_SELECTION_ONE = 0x01 , BT_LE_CS_TEST_CS_SYNC_ANTENNA_SELECTION_TWO = 0x02 , BT_LE_CS_TEST_CS_SYNC_ANTENNA_SELECTION_THREE = 0x03 , BT_LE_CS_TEST_CS_SYNC_ANTENNA_SELECTION_FOUR = 0x04 }
 CS Test CS_SYNC Antenna Identifier. More...
enum  bt_le_cs_snr_control {
  BT_LE_CS_SNR_CONTROL_18dB = 0x0 , BT_LE_CS_SNR_CONTROL_21dB = 0x1 , BT_LE_CS_SNR_CONTROL_24dB = 0x2 , BT_LE_CS_SNR_CONTROL_27dB = 0x3 ,
  BT_LE_CS_SNR_CONTROL_30dB = 0x4 , BT_LE_CS_SNR_CONTROL_NOT_USED = 0xFF
}
 CS SNR control options. More...
enum  bt_le_cs_test_override_3_pm_tone_ext {
  BT_LE_CS_TEST_OVERRIDE_3_NO_TONE_EXT = 0x0 , BT_LE_CS_TEST_OVERRIDE_3_INITIATOR_TONE_EXT_ONLY = 0x1 , BT_LE_CS_TEST_OVERRIDE_3_REFLECTOR_TONE_EXT_ONLY = 0x2 , BT_LE_CS_TEST_OVERRIDE_3_INITIATOR_AND_REFLECTOR_TONE_EXT ,
  BT_LE_CS_TEST_OVERRIDE_3_REPETITIVE_TONE_EXT = 0x4
}
 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 = 0x0 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_01 = 0x1 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_02 = 0x2 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_03 = 0x3 ,
  BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_04 = 0x4 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_05 = 0x5 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_06 = 0x6 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_07 = 0x7 ,
  BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_08 = 0x8 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_09 = 0x9 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_10 = 0xA , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_11 = 0xB ,
  BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_12 = 0xC , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_13 = 0xD , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_14 = 0xE , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_15 = 0xF ,
  BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_16 = 0x10 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_17 = 0x11 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_18 = 0x12 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_19 = 0x13 ,
  BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_20 = 0x14 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_21 = 0x15 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_22 = 0x16 , BT_LE_CS_TEST_OVERRIDE_4_ANTENNA_PERMUTATION_INDEX_23 = 0x17 ,
  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 = 0x0 , BT_LE_CS_TEST_OVERRIDE_7_SS_MARKER_VAL_1100 = 0x1 , BT_LE_CS_TEST_OVERRIDE_7_SS_MARKER_VAL_LOOP = 0x2 }
 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 = 0x00 , BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_11110000 = 0x01 , BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_10101010 = 0x02 , BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_PRBS15 = 0x03 ,
  BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_11111111 = 0x04 , BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_00000000 = 0x05 , BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_00001111 = 0x06 , BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_01010101 = 0x07 ,
  BT_LE_CS_TEST_OVERRIDE_8_PAYLOAD_PATTERN_USER = 0x80
}
 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 = 0x01 , BT_LE_CS_PROCEDURE_PHY_2M = 0x02 , BT_LE_CS_PROCEDURE_PHY_CODED_S8 = 0x03 , BT_LE_CS_PROCEDURE_PHY_CODED_S2 = 0x04 }

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.
int bt_le_cs_get_antenna_path (uint8_t n_ap, uint8_t antenna_path_permutation_index, uint8_t tone_index)
 Get antenna path used for the CS tone exchange when using multiple antenna paths for mode-2 or mode-3 CS procedure.

Detailed Description

Bluetooth Channel Sounding handling.