1
0
mirror of https://github.com/bluekitchen/btstack.git synced 2025-03-17 10:20:50 +00:00

hci: track more cis connection info

This commit is contained in:
Matthias Ringwald 2023-09-22 11:24:17 +02:00
parent 620553bdf2
commit 7dd97f73d8
2 changed files with 23 additions and 4 deletions

@ -4274,9 +4274,15 @@ static void event_handler(uint8_t *packet, uint16_t size){
uint8_t status = hci_subevent_le_cis_established_get_status(packet); uint8_t status = hci_subevent_le_cis_established_get_status(packet);
iso_stream = hci_iso_stream_for_con_handle(handle); iso_stream = hci_iso_stream_for_con_handle(handle);
btstack_assert(iso_stream != NULL); btstack_assert(iso_stream != NULL);
// track SDU // track connection info
iso_stream->max_sdu_c_to_p = hci_subevent_le_cis_established_get_max_pdu_c_to_p(packet); iso_stream->number_of_subevents = hci_subevent_le_cis_established_get_nse(packet);
iso_stream->max_sdu_p_to_c = hci_subevent_le_cis_established_get_max_pdu_p_to_c(packet); iso_stream->burst_number_c_to_p = hci_subevent_le_cis_established_get_bn_c_to_p(packet);
iso_stream->burst_number_p_to_c = hci_subevent_le_cis_established_get_bn_p_to_c(packet);
iso_stream->flush_timeout_c_to_p = hci_subevent_le_cis_established_get_ft_c_to_p(packet);
iso_stream->flush_timeout_p_to_c = hci_subevent_le_cis_established_get_ft_p_to_c(packet);
iso_stream->max_sdu_c_to_p = hci_subevent_le_cis_established_get_max_pdu_c_to_p(packet);
iso_stream->max_sdu_p_to_c = hci_subevent_le_cis_established_get_max_pdu_p_to_c(packet);
iso_stream->iso_interval_1250us = hci_subevent_le_cis_established_get_iso_interval(packet);
if (hci_stack->iso_active_operation_group_id == HCI_ISO_GROUP_ID_SINGLE_CIS){ if (hci_stack->iso_active_operation_group_id == HCI_ISO_GROUP_ID_SINGLE_CIS){
// CIS Accept by Peripheral // CIS Accept by Peripheral
if (status == ERROR_CODE_SUCCESS){ if (status == ERROR_CODE_SUCCESS){
@ -9898,13 +9904,20 @@ static uint16_t hci_setup_cis_created(uint8_t * event, hci_iso_stream_t * iso_st
pos += 2; pos += 2;
little_endian_store_16(event, pos, iso_stream->acl_handle); little_endian_store_16(event, pos, iso_stream->acl_handle);
pos += 2; pos += 2;
little_endian_store_16(event, pos, iso_stream->iso_interval_1250us);
pos += 2;
event[pos++] = iso_stream->number_of_subevents;
event[pos++] = iso_stream->burst_number_c_to_p;
event[pos++] = iso_stream->burst_number_p_to_c;
event[pos++] = iso_stream->flush_timeout_c_to_p;
event[pos++] = iso_stream->flush_timeout_p_to_c;
return pos; return pos;
} }
// emits GAP_SUBEVENT_CIS_CREATED after calling hci_iso_finalize // emits GAP_SUBEVENT_CIS_CREATED after calling hci_iso_finalize
static void hci_cis_handle_created(hci_iso_stream_t * iso_stream, uint8_t status){ static void hci_cis_handle_created(hci_iso_stream_t * iso_stream, uint8_t status){
// cache data before finalizing struct // cache data before finalizing struct
uint8_t event [10]; uint8_t event [17];
uint16_t pos = hci_setup_cis_created(event, iso_stream, status); uint16_t pos = hci_setup_cis_created(event, iso_stream, status);
btstack_assert(pos <= sizeof(event)); btstack_assert(pos <= sizeof(event));
if (status != ERROR_CODE_SUCCESS){ if (status != ERROR_CODE_SUCCESS){

@ -743,8 +743,14 @@ typedef struct {
hci_con_handle_t acl_handle; hci_con_handle_t acl_handle;
// connection info // connection info
uint8_t number_of_subevents;
uint8_t burst_number_c_to_p;
uint8_t burst_number_p_to_c;
uint8_t flush_timeout_c_to_p;
uint8_t flush_timeout_p_to_c;
uint16_t max_sdu_c_to_p; uint16_t max_sdu_c_to_p;
uint16_t max_sdu_p_to_c; uint16_t max_sdu_p_to_c;
uint16_t iso_interval_1250us;
// re-assembly buffer // re-assembly buffer
uint16_t reassembly_pos; uint16_t reassembly_pos;