hci: track timestamp of number of completed packets event per BIG

This commit is contained in:
Matthias Ringwald 2022-08-26 12:19:22 +02:00
parent d9a1d8eddc
commit fe977b3735
2 changed files with 11 additions and 0 deletions

View File

@ -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 {

View File

@ -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;