Bluetooth: host: Add IQ reports handing in DF connecte mode

Add reception of IQ sample report from controller.
Add applications notification about received reports.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
This commit is contained in:
Piotr Pryga 2021-11-24 14:12:07 +01:00 committed by Christopher Friedt
commit a26ee7ce73
7 changed files with 123 additions and 0 deletions

View file

@ -23,6 +23,7 @@
#include <bluetooth/hci_err.h>
#include <bluetooth/addr.h>
#include <bluetooth/gap.h>
#include <bluetooth/direction.h>
#ifdef __cplusplus
extern "C" {
@ -927,6 +928,17 @@ struct bt_conn_cb {
struct bt_conn_le_data_len_info *info);
#endif /* defined(CONFIG_BT_USER_DATA_LEN_UPDATE) */
#if defined(CONFIG_BT_DF_CONNECTION_CTE_RX)
/** @brief Callback for IQ samples report collected when sampling
* CTE received by data channel PDU.
*
* @param conn The connection object.
* @param iq_report Report data for collected IQ samples.
*/
void (*cte_report_cb)(struct bt_conn *conn,
const struct bt_df_conn_iq_samples_report *iq_report);
#endif /* CONFIG_BT_DF_CONNECTION_CTE_RX */
struct bt_conn_cb *_next;
};

View file

@ -120,6 +120,28 @@ struct bt_df_conn_cte_rx_param {
const uint8_t *ant_ids;
};
struct bt_df_conn_iq_samples_report {
/** PHY that was used to receive PDU with CTE that was sampled. */
uint8_t rx_phy;
/** Channel index used to receive PDU with CTE that was sampled. */
uint8_t chan_idx;
/** The RSSI of the PDU with CTE (excluding CTE). */
int16_t rssi;
/** Id of antenna used to measure the RSSI. */
uint8_t rssi_ant_id;
/** Type of CTE (@ref bt_df_cte_type). */
uint8_t cte_type;
/** Duration of slots when received CTE type is AoA (@ref bt_df_antenna_switching_slot). */
uint8_t slot_durations;
/** Status of received PDU with CTE (@ref bt_df_packet_status). */
uint8_t packet_status;
/** Value of connection event counter when the CTE was received and sampled. */
uint16_t conn_evt_counter;
/** Number of IQ samples in report. */
uint8_t sample_count;
/** Pinter to IQ samples data. */
struct bt_hci_le_iq_sample const *sample;
};
/**
* @brief Set or update the Constant Tone Extension parameters for periodic advertising set.
*