We're trying to synchronise TX and RX in a connectionless direction finding setup. What we want to do is increment a data counter, log this on the TX timestamped, and send this as part of the periodic advertisement packet so that we can log it on the RX side and later provide the TX timestamp for data processing. We currently have `bt_le_ext_adv_start_param.num_events` set to 0 so that it just keeps sending periodic advertisement trains after initialising the Bluetooth and Direction Finding systems.
As far as I can tell, a counter is already incremented in the per_adv_counter, which is accessible from the `bt_df_per_adv_sync_iq_samples_report` whenever we receive a CTE. However, it seems like this is completely deferred to the subsystem and there is no way to access this in the TX application code. Is there e.g., an event we can listen to related to the sending of a CTE on the TX side?
As an alternative, I've tried setting bt_le_ext_adv_start_param.num_events to 1 and doing something like this in the callback
static void adv_sent_cb(struct bt_le_ext_adv *adv, struct bt_le_ext_adv_sent_info *info) { LOG_INF("Advertiser[%d] sent %d", bt_le_ext_adv_get_index(adv), info->num_sent); data_counter++; LOG_INF("Transmitting counter %d ", data_counter); memcpy(mfg_data, &data_counter, sizeof(uint16_t)); const static struct bt_data ad_update[] = { BT_DATA(BT_DATA_MANUFACTURER_DATA, mfg_data, 2), }; bt_le_adv_update_data(ad_update, ARRAY_SIZE(ad_update), sd, ARRAY_SIZE(sd)); bt_le_ext_adv_start(adv_set, &ext_adv_start_param); }
But checking the logging from the RX, this results in no CTEs being sent.