diff --git a/src/gap.h b/src/gap.h index 960c3f3d6..3432c52ce 100644 --- a/src/gap.h +++ b/src/gap.h @@ -243,6 +243,9 @@ typedef struct { const le_audio_big_params_t * params; // request to send bool can_send_now_requested; + // previous and current timestamp of number completed event to track ISO intervals + bool num_completed_timestamp_current_valid; + uint32_t num_completed_timestamp_current_ms; } le_audio_big_t; typedef struct { diff --git a/src/hci.c b/src/hci.c index f6504e4c4..dae8d1c7e 100644 --- a/src/hci.c +++ b/src/hci.c @@ -3255,6 +3255,14 @@ static void event_handler(uint8_t *packet, uint16_t size){ log_error("hci_number_completed_packets, more packet slots freed then sent."); iso_stream->num_packets_sent = 0; } + uint8_t big_handle = iso_stream->big_handle; + if (big_handle != 0xff){ + le_audio_big_t * big = hci_big_for_handle(big_handle); + if (big != NULL){ + big->num_completed_timestamp_current_valid = true; + big->num_completed_timestamp_current_ms = btstack_run_loop_get_time_ms(); + } + } log_info("hci_number_completed_packet %u processed for handle %u, outstanding %u", num_packets, handle, iso_stream->num_packets_sent); notify_iso = true;