Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: Channel Sounding: Add several channel sounding HCI commands #78455

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
175 changes: 175 additions & 0 deletions include/zephyr/bluetooth/conn.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,157 @@ enum __packed bt_conn_type {
BT_CONN_TYPE_SCO | BT_CONN_TYPE_ISO,
};

/** Supported AA-Only RTT precision. */
enum bt_conn_le_cs_capability_rtt_aa_only {
/** AA-Only RTT variant is not supported. */
BT_CONN_LE_CS_RTT_AA_ONLY_NOT_SUPP = 0,
/** 10ns time-of-flight accuracy. */
BT_CONN_LE_CS_RTT_AA_ONLY_10NS,
/** 150ns time-of-flight accuracy. */
BT_CONN_LE_CS_RTT_AA_ONLY_150NS,
};

/** Supported Sounding Sequence RTT precision. */
enum bt_conn_le_cs_capability_rtt_sounding {
/** Sounding Sequence RTT variant is not supported. */
BT_CONN_LE_CS_RTT_SOUNDING_NOT_SUPP = 0,
/** 10ns time-of-flight accuracy. */
BT_CONN_LE_CS_RTT_SOUNDING_10NS,
/** 150ns time-of-flight accuracy. */
BT_CONN_LE_CS_RTT_SOUNDING_150NS,
};

/** Supported Random Payload RTT precision. */
enum bt_conn_le_cs_capability_rtt_random_payload {
/** Random Payload RTT variant is not supported. */
BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_NOT_SUPP = 0,
/** 10ns time-of-flight accuracy. */
BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_10NS,
/** 150ns time-of-flight accuracy. */
BT_CONN_LE_CS_RTT_RANDOM_PAYLOAD_150NS,
};

/** Remote channel sounding capabilities for LE connections supporting CS */
struct bt_conn_le_cs_capabilities {
/** Number of CS configurations */
uint8_t num_config_supported;
/** Maximum number of consecutive CS procedures.
*
* When set to zero, indicates support for both fixed and indefinite
* numbers of CS procedures before termination.
*/
uint16_t max_consecutive_procedures_supported;
/** Number of antennas. */
uint8_t num_antennas_supported;
/** Maximum number of antenna paths. */
uint8_t max_antenna_paths_supported;
/** Initiator role. */
bool initiator_supported;
/** Reflector role. */
bool reflector_supported;
/** Mode-3 */
bool mode_3_supported;
/** RTT AA-Only */
enum bt_conn_le_cs_capability_rtt_aa_only rtt_aa_only_precision;
/** RTT Sounding */
enum bt_conn_le_cs_capability_rtt_sounding rtt_sounding_precision;
/** RTT Random Payload */
enum bt_conn_le_cs_capability_rtt_random_payload rtt_random_payload_precision;
/** Number of CS steps needed to achieve the
* accuracy requirements for RTT AA Only.
*
* Set to 0 if RTT AA Only isn't supported.
*/
uint8_t rtt_aa_only_n;
/** Number of CS steps needed to achieve the
* accuracy requirements for RTT Sounding.
*
* Set to 0 if RTT Sounding isn't supported
*/
uint8_t rtt_sounding_n;
/** Number of CS steps needed to achieve the
* accuracy requirements for RTT Random Payload.
*
* Set to 0 if RTT Random Payload isn't supported.
*/
uint8_t rtt_random_payload_n;
/** Phase-based normalized attack detector metric
* when a CS_SYNC with sounding sequence is received.
*/
bool phase_based_nadm_sounding_supported;
/** Phase-based normalized attack detector metric
* when a CS_SYNC with random sequence is received.
*/
bool phase_based_nadm_random_supported;
/** CS_SYNC LE 2M PHY. */
bool cs_sync_2m_phy_supported;
/** CS_SYNC LE 2M 2BT PHY. */
bool cs_sync_2m_2bt_phy_supported;
/** Subfeature: CS with no Frequency Actuation Error. */
bool cs_without_fae_supported;
/** Subfeature: Channel Selection Algorithm #3c */
bool chsel_alg_3c_supported;
/** Subfeature: Phase-based Ranging from RTT sounding sequence. */
bool pbr_from_rtt_sounding_seq_supported;
olivier-le-sage marked this conversation as resolved.
Show resolved Hide resolved
/** Optional T_IP1 time durations during CS steps.
*
* - Bit 0: 10 us
* - Bit 1: 20 us
* - Bit 2: 30 us
* - Bit 3: 40 us
* - Bit 4: 50 us
* - Bit 5: 60 us
* - Bit 6: 80 us
*/
uint16_t t_ip1_times_supported;
/** Optional T_IP2 time durations during CS steps.
*
* - Bit 0: 10 us
* - Bit 1: 20 us
* - Bit 2: 30 us
* - Bit 3: 40 us
* - Bit 4: 50 us
* - Bit 5: 60 us
* - Bit 6: 80 us
*/
uint16_t t_ip2_times_supported;
/** Optional T_FCS time durations during CS steps.
*
* - Bit 0: 15 us
* - Bit 1: 20 us
* - Bit 2: 30 us
* - Bit 3: 40 us
* - Bit 4: 50 us
* - Bit 5: 60 us
* - Bit 6: 80 us
* - Bit 7: 100 us
* - Bit 8: 120 us
*/
uint16_t t_fcs_times_supported;
/** Optional T_PM time durations during CS steps.
*
* - Bit 0: 10 us
* - Bit 1: 20 us
*/
uint16_t t_pm_times_supported;
/** Time in microseconds for the antenna switch period of the CS tones. */
uint8_t t_sw_time;
/** Supported SNR levels used in RTT packets.
*
* - Bit 0: 18dB
* - Bit 1: 21dB
* - Bit 2: 24dB
* - Bit 3: 27dB
* - Bit 4: 30dB
*/
uint8_t tx_snr_capability;
};

/** Remote FAE Table for LE connections supporting CS */
struct bt_conn_le_cs_fae_table {
uint8_t *remote_fae_table;
};

/** @brief Increment a connection's reference count.
*
* Increment the reference count of a connection object.
Expand Down Expand Up @@ -1359,6 +1510,30 @@ struct bt_conn_cb {
const struct bt_conn_le_subrate_changed *params);
#endif /* CONFIG_BT_SUBRATING */

#if defined(CONFIG_BT_CHANNEL_SOUNDING)
/** @brief LE CS Read Remote Supported Capabilities Complete event.
*
* This callback notifies the application that the remote channel
* sounding capabilities have been received from the peer.
*
* @param conn Connection object.
* @param remote_cs_capabilities Remote Channel Sounding Capabilities.
*/
void (*remote_cs_capabilities_available)(struct bt_conn *conn,
struct bt_conn_le_cs_capabilities *params);

/** @brief LE CS Read Remote FAE Table Complete event.
*
* This callback notifies the application that the remote mode-0
* FAE Table has been received from the peer.
*
* @param conn Connection object.
* @param params FAE Table.
*/
void (*remote_cs_fae_table_available)(struct bt_conn *conn,
struct bt_conn_le_cs_fae_table *params);
#endif

/** @internal Internally used field for list handling */
sys_snode_t _node;
};
Expand Down
Loading
Loading