From c8149263fa0ed6feba039c37b502611448b8f498 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 30 May 2023 14:14:29 +0200 Subject: [PATCH] hfp: provide sco packet types and packet lengths in HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED --- src/classic/hfp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/classic/hfp.c b/src/classic/hfp.c index 6ba53ed43..dca0e57e1 100644 --- a/src/classic/hfp.c +++ b/src/classic/hfp.c @@ -488,7 +488,7 @@ static void hfp_emit_audio_connection_released(hfp_connection_t * hfp_connection void hfp_emit_sco_connection_established(hfp_connection_t *hfp_connection, uint8_t status, uint8_t negotiated_codec, uint16_t rx_packet_length, uint16_t tx_packet_length) { btstack_assert(hfp_connection != NULL); - uint8_t event[17]; + uint8_t event[21]; int pos = 0; event[pos++] = HCI_EVENT_HFP_META; event[pos++] = sizeof(event) - 2; @@ -502,6 +502,10 @@ void hfp_emit_sco_connection_established(hfp_connection_t *hfp_connection, uint8 pos += 6; event[pos++] = negotiated_codec; little_endian_store_16(event, pos, hfp_connection->packet_types); + little_endian_store_16(event, pos, rx_packet_length); + pos += 2; + little_endian_store_16(event, pos, tx_packet_length); + pos += 2; hfp_emit_event_for_context(hfp_connection, event, sizeof(event)); }