From 2f6b9ce406c06dcd435edf9324ffa5d38db8dc51 Mon Sep 17 00:00:00 2001 From: Jakob Krantz Date: Fri, 26 Nov 2021 10:17:29 +0100 Subject: [PATCH] Bluetooth: host: Expose per adv evt counter in CTE IQ report. Allows the application to access the periodic advertising counter. Signed-off-by: Jakob Krantz --- include/bluetooth/direction.h | 2 ++ subsys/bluetooth/host/direction.c | 1 + 2 files changed, 3 insertions(+) diff --git a/include/bluetooth/direction.h b/include/bluetooth/direction.h index feb32d35135..7e55e94b8e4 100644 --- a/include/bluetooth/direction.h +++ b/include/bluetooth/direction.h @@ -101,6 +101,8 @@ struct bt_df_per_adv_sync_iq_samples_report { uint8_t slot_durations; /** Status of received PDU with CTE (@ref bt_df_packet_status). */ uint8_t packet_status; + /** Value of the paEventCounter of the AUX_SYNC_IND PDU. */ + uint16_t per_evt_counter; /** Number of IQ samples in report. */ uint8_t sample_count; /** Pinter to IQ samples data. */ diff --git a/subsys/bluetooth/host/direction.c b/subsys/bluetooth/host/direction.c index d70cb6c3ac3..7f2c8168048 100644 --- a/subsys/bluetooth/host/direction.c +++ b/subsys/bluetooth/host/direction.c @@ -351,6 +351,7 @@ void hci_df_prepare_connectionless_iq_report(struct net_buf *buf, report->cte_type = BIT(evt->cte_type); report->packet_status = evt->packet_status; report->slot_durations = evt->slot_durations; + report->per_evt_counter = sys_le16_to_cpu(evt->per_evt_counter); report->sample_count = evt->sample_count; report->sample = &evt->sample[0];