hfp: drop packet types from hfp_emit_sco_connection_established as it's stored in hfp_connection_t

This commit is contained in:
Matthias Ringwald 2023-01-17 18:21:25 +01:00
parent d9290e95f9
commit 5e8e3664c9
3 changed files with 7 additions and 10 deletions

View File

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

View File

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

View File

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