Bluetooh: host: Add CTE RX and sample enable for conn mode

Add enable of CTE reception and sampling in connected mode.

The implementation allows an application to decide what type
of CTE is expected to be reported. Bluetooth Core specification
does not provide such functionality, so it is provided as part
of host implementation. Host will filter out all reports for not
enabled CTE types.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
This commit is contained in:
Piotr Pryga 2021-11-23 15:24:30 +01:00 committed by Christopher Friedt
commit f18637fe30
4 changed files with 231 additions and 37 deletions

View file

@ -109,6 +109,17 @@ struct bt_df_per_adv_sync_iq_samples_report {
struct bt_hci_le_iq_sample const *sample;
};
struct bt_df_conn_cte_rx_param {
/* Bitmap with allowed CTE types (@ref bt_df_cte_type). */
uint8_t cte_type;
/** Antenna switching slots (@ref bt_df_antenna_switching_slot). */
uint8_t slot_durations;
/** Length of antenna switch pattern. */
uint8_t num_ant_ids;
/** Antenna switch pattern. */
const uint8_t *ant_ids;
};
/**
* @brief Set or update the Constant Tone Extension parameters for periodic advertising set.
*
@ -165,4 +176,23 @@ int bt_df_per_adv_sync_cte_rx_enable(struct bt_le_per_adv_sync *sync,
*/
int bt_df_per_adv_sync_cte_rx_disable(struct bt_le_per_adv_sync *sync);
/**
* @brief Enable receive and sampling of Constant Tone Extension for the connection object.
*
* @param conn Connection object.
* @param params CTE receive and sampling parameters.
*
* @return Zero in case of success, other value in case of failure.
*/
int bt_df_conn_cte_rx_enable(struct bt_conn *conn, const struct bt_df_conn_cte_rx_param *params);
/**
* @brief Disable receive and sampling of Constant Tone Extension for the connection object.
*
* @param conn Connection object.
*
* @return Zero in case of success, other value in case of failure.
*/
int bt_df_conn_cte_rx_disable(struct bt_conn *conn);
#endif /* ZEPHYR_INCLUDE_BLUETOOTH_DF_H_ */