From 5e8e3664c9f428500de2b2858a85bdf314ac9256 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Tue, 17 Jan 2023 18:21:25 +0100 Subject: [PATCH] hfp: drop packet types from hfp_emit_sco_connection_established as it's stored in hfp_connection_t --- src/classic/hfp.c | 12 +++++------- src/classic/hfp.h | 2 +- src/classic/hfp_hf.c | 3 +-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/classic/hfp.c b/src/classic/hfp.c index ec9a6bc25..6b38aac7f 100644 --- a/src/classic/hfp.c +++ b/src/classic/hfp.c @@ -469,7 +469,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 packet_types, uint16_t rx_packet_length, uint16_t tx_packet_length) { + uint16_t rx_packet_length, uint16_t tx_packet_length) { btstack_assert(hfp_connection != NULL); uint8_t event[17]; int pos = 0; @@ -484,7 +484,7 @@ void hfp_emit_sco_connection_established(hfp_connection_t *hfp_connection, uint8 reverse_bd_addr(hfp_connection->remote_addr,&event[pos]); pos += 6; event[pos++] = negotiated_codec; - little_endian_store_16(event, pos, packet_types); + little_endian_store_16(event, pos, hfp_connection->packet_types); hfp_emit_event_for_context(hfp_connection, event, sizeof(event)); } @@ -886,7 +886,7 @@ void hfp_handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *packet hfp_connection->establish_audio_connection = 0; hfp_connection->state = HFP_SERVICE_LEVEL_CONNECTION_ESTABLISHED; hfp_emit_sco_connection_established(hfp_connection, status, - hfp_connection->negotiated_codec, 0, 0, 0); + hfp_connection->negotiated_codec, 0, 0); } break; @@ -907,8 +907,7 @@ void hfp_handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *packet hfp_connection->establish_audio_connection = 0; hfp_connection->state = HFP_SERVICE_LEVEL_CONNECTION_ESTABLISHED; hfp_emit_sco_connection_established(hfp_connection, status, - hfp_connection->negotiated_codec, - 0, 0, 0); + hfp_connection->negotiated_codec, 0, 0); break; } @@ -959,8 +958,7 @@ void hfp_handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *packet break; } hfp_emit_sco_connection_established(hfp_connection, status, - hfp_connection->negotiated_codec, - hfp_connection->packet_types, rx_packet_length, tx_packet_length); + hfp_connection->negotiated_codec, rx_packet_length, tx_packet_length); break; } diff --git a/src/classic/hfp.h b/src/classic/hfp.h index b1fabf62f..d9b1b035a 100644 --- a/src/classic/hfp.h +++ b/src/classic/hfp.h @@ -761,7 +761,7 @@ int store_bit(uint32_t bitmap, int position, uint8_t value); void hfp_finalize_connection_context(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 packet_types, uint16_t rx_packet_length, uint16_t tx_packet_length); + uint16_t rx_packet_length, uint16_t tx_packet_length); void hfp_set_ag_callback(btstack_packet_handler_t callback); void hfp_set_ag_rfcomm_packet_handler(btstack_packet_handler_t handler); diff --git a/src/classic/hfp_hf.c b/src/classic/hfp_hf.c index b88ad8ca6..65efe3513 100644 --- a/src/classic/hfp_hf.c +++ b/src/classic/hfp_hf.c @@ -1353,8 +1353,7 @@ static void hfp_hf_handle_rfcomm_command(hfp_connection_t * hfp_connection){ case HFP_CODECS_RECEIVED_TRIGGER_CODEC_EXCHANGE: hfp_reset_context_flags(hfp_connection); hfp_emit_sco_connection_established(hfp_connection, HFP_REMOTE_REJECTS_AUDIO_CONNECTION, - hfp_connection->negotiated_codec, - 0, 0, 0); + hfp_connection->negotiated_codec, 0, 0); return; default: break;