hci: track highest outgoing cis for cig in central role

This commit is contained in:
Matthias Ringwald 2025-02-21 17:30:40 +01:00
parent a540f7c53c
commit c3045e83c2
2 changed files with 6 additions and 1 deletions

View File

@ -320,6 +320,7 @@ typedef struct {
hci_con_handle_t acl_con_handles[MAX_NR_CIS]; hci_con_handle_t acl_con_handles[MAX_NR_CIS];
bool cis_setup_active[MAX_NR_CIS]; bool cis_setup_active[MAX_NR_CIS];
bool cis_established[MAX_NR_CIS]; bool cis_established[MAX_NR_CIS];
uint8_t highest_outgoing_cis_index;
// request to send // request to send
bool can_send_now_requested; bool can_send_now_requested;
} le_audio_cig_t; } le_audio_cig_t;

View File

@ -10855,8 +10855,9 @@ uint8_t gap_cis_create(uint8_t cig_id, hci_con_handle_t cis_con_handles [], hci_
return ERROR_CODE_COMMAND_DISALLOWED; return ERROR_CODE_COMMAND_DISALLOWED;
} }
// store ACL Connection Handles // store ACL Connection Handles and set highest outgoing cis index
uint8_t i; uint8_t i;
cig->highest_outgoing_cis_index = 0;
for (i=0;i<cig->num_cis;i++){ for (i=0;i<cig->num_cis;i++){
// check that all con handles exist and store // check that all con handles exist and store
hci_con_handle_t cis_handle = cis_con_handles[i]; hci_con_handle_t cis_handle = cis_con_handles[i];
@ -10872,6 +10873,9 @@ uint8_t gap_cis_create(uint8_t cig_id, hci_con_handle_t cis_con_handles [], hci_
btstack_assert(iso_stream != NULL); btstack_assert(iso_stream != NULL);
iso_stream->acl_handle = acl_con_handles[j]; iso_stream->acl_handle = acl_con_handles[j];
found = true; found = true;
if (iso_stream->max_sdu_c_to_p > 0) {
cig->highest_outgoing_cis_index = i;
}
break; break;
} }
} }