mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-30 15:32:41 +00:00
hfp: drop redundant bd_addr, sco_handle in hfp_emit_sco_connection_established
This commit is contained in:
parent
2ef72a1c4c
commit
f14c5daf9a
@ -468,9 +468,8 @@ static void hfp_emit_audio_connection_released(hfp_connection_t * hfp_connection
|
|||||||
hfp_emit_event_for_context(hfp_connection, event, sizeof(event));
|
hfp_emit_event_for_context(hfp_connection, event, sizeof(event));
|
||||||
}
|
}
|
||||||
|
|
||||||
void hfp_emit_sco_connection_established(hfp_connection_t *hfp_connection, uint8_t status, hci_con_handle_t sco_handle,
|
void hfp_emit_sco_connection_established(hfp_connection_t *hfp_connection, uint8_t status, uint8_t negotiated_codec,
|
||||||
bd_addr_t addr, uint8_t negotiated_codec, uint16_t packet_types,
|
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);
|
btstack_assert(hfp_connection != NULL);
|
||||||
uint8_t event[17];
|
uint8_t event[17];
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
@ -480,9 +479,9 @@ void hfp_emit_sco_connection_established(hfp_connection_t *hfp_connection, uint8
|
|||||||
little_endian_store_16(event, pos, hfp_connection->acl_handle);
|
little_endian_store_16(event, pos, hfp_connection->acl_handle);
|
||||||
pos += 2;
|
pos += 2;
|
||||||
event[pos++] = status; // status 0 == OK
|
event[pos++] = status; // status 0 == OK
|
||||||
little_endian_store_16(event, pos, sco_handle);
|
little_endian_store_16(event, pos, hfp_connection->sco_handle);
|
||||||
pos += 2;
|
pos += 2;
|
||||||
reverse_bd_addr(addr,&event[pos]);
|
reverse_bd_addr(hfp_connection->remote_addr,&event[pos]);
|
||||||
pos += 6;
|
pos += 6;
|
||||||
event[pos++] = negotiated_codec;
|
event[pos++] = negotiated_codec;
|
||||||
little_endian_store_16(event, pos, packet_types);
|
little_endian_store_16(event, pos, packet_types);
|
||||||
@ -886,7 +885,7 @@ void hfp_handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *packet
|
|||||||
if (hfp_handle_failed_sco_connection(status)) break;
|
if (hfp_handle_failed_sco_connection(status)) break;
|
||||||
hfp_connection->establish_audio_connection = 0;
|
hfp_connection->establish_audio_connection = 0;
|
||||||
hfp_connection->state = HFP_SERVICE_LEVEL_CONNECTION_ESTABLISHED;
|
hfp_connection->state = HFP_SERVICE_LEVEL_CONNECTION_ESTABLISHED;
|
||||||
hfp_emit_sco_connection_established(hfp_connection, status, 0, hfp_connection->remote_addr,
|
hfp_emit_sco_connection_established(hfp_connection, status,
|
||||||
hfp_connection->negotiated_codec, 0, 0, 0);
|
hfp_connection->negotiated_codec, 0, 0, 0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -907,7 +906,7 @@ void hfp_handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *packet
|
|||||||
|
|
||||||
hfp_connection->establish_audio_connection = 0;
|
hfp_connection->establish_audio_connection = 0;
|
||||||
hfp_connection->state = HFP_SERVICE_LEVEL_CONNECTION_ESTABLISHED;
|
hfp_connection->state = HFP_SERVICE_LEVEL_CONNECTION_ESTABLISHED;
|
||||||
hfp_emit_sco_connection_established(hfp_connection, status, 0, event_addr,
|
hfp_emit_sco_connection_established(hfp_connection, status,
|
||||||
hfp_connection->negotiated_codec,
|
hfp_connection->negotiated_codec,
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
break;
|
break;
|
||||||
@ -960,7 +959,7 @@ void hfp_handle_hci_event(uint8_t packet_type, uint16_t channel, uint8_t *packet
|
|||||||
hfp_connection->ag_audio_connection_opened_before_vra = true;
|
hfp_connection->ag_audio_connection_opened_before_vra = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
hfp_emit_sco_connection_established(hfp_connection, status, sco_handle, event_addr,
|
hfp_emit_sco_connection_established(hfp_connection, status,
|
||||||
hfp_connection->negotiated_codec,
|
hfp_connection->negotiated_codec,
|
||||||
packet_types, rx_packet_length, tx_packet_length);
|
packet_types, rx_packet_length, tx_packet_length);
|
||||||
break;
|
break;
|
||||||
|
@ -759,9 +759,8 @@ int store_bit(uint32_t bitmap, int position, uint8_t value);
|
|||||||
// UTILS_END
|
// UTILS_END
|
||||||
|
|
||||||
void hfp_finalize_connection_context(hfp_connection_t * hfp_connection);
|
void hfp_finalize_connection_context(hfp_connection_t * hfp_connection);
|
||||||
void hfp_emit_sco_connection_established(hfp_connection_t *hfp_connection, uint8_t status, hci_con_handle_t sco_handle,
|
void hfp_emit_sco_connection_established(hfp_connection_t *hfp_connection, uint8_t status, uint8_t negotiated_codec,
|
||||||
bd_addr_t addr, uint8_t negotiated_codec, uint16_t packet_types,
|
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_callback(btstack_packet_handler_t callback);
|
||||||
void hfp_set_ag_rfcomm_packet_handler(btstack_packet_handler_t handler);
|
void hfp_set_ag_rfcomm_packet_handler(btstack_packet_handler_t handler);
|
||||||
|
@ -1352,8 +1352,7 @@ static void hfp_hf_handle_rfcomm_command(hfp_connection_t * hfp_connection){
|
|||||||
switch (hfp_connection->codecs_state){
|
switch (hfp_connection->codecs_state){
|
||||||
case HFP_CODECS_RECEIVED_TRIGGER_CODEC_EXCHANGE:
|
case HFP_CODECS_RECEIVED_TRIGGER_CODEC_EXCHANGE:
|
||||||
hfp_reset_context_flags(hfp_connection);
|
hfp_reset_context_flags(hfp_connection);
|
||||||
hfp_emit_sco_connection_established(hfp_connection, HFP_REMOTE_REJECTS_AUDIO_CONNECTION, 0,
|
hfp_emit_sco_connection_established(hfp_connection, HFP_REMOTE_REJECTS_AUDIO_CONNECTION,
|
||||||
hfp_connection->remote_addr,
|
|
||||||
hfp_connection->negotiated_codec,
|
hfp_connection->negotiated_codec,
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user