hfp: sco connection is created by ag if codec negotiation is supported

This commit is contained in:
Matthias Ringwald 2021-04-12 17:19:30 +02:00
parent 29cddf58f6
commit 40e8d6c5eb
3 changed files with 4 additions and 2 deletions

View File

@ -41,6 +41,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- GAP: allow to disable link supervision timeout - GAP: allow to disable link supervision timeout
- HFP HF: only emit single event for RING and AG Status updates - HFP HF: only emit single event for RING and AG Status updates
- HFP AG: fix audio connection setup for in-band ringtone on incoming connection - HFP AG: fix audio connection setup for in-band ringtone on incoming connection
- HFP: fix audio connection setup by HF if codec negotiation is supported
### Changed ### Changed
- HCI: config I2S for BCM Controllers if `ENABLE_SCO_OVER_PCM`, reduce bit clock to 256/512 kHz - HCI: config I2S for BCM Controllers if `ENABLE_SCO_OVER_PCM`, reduce bit clock to 256/512 kHz

View File

@ -553,6 +553,7 @@ static int codecs_exchange_state_machine(hfp_connection_t * hfp_connection){
case HFP_CMD_TRIGGER_CODEC_CONNECTION_SETUP: case HFP_CMD_TRIGGER_CODEC_CONNECTION_SETUP:
hfp_connection->codecs_state = HFP_CODECS_RECEIVED_TRIGGER_CODEC_EXCHANGE; hfp_connection->codecs_state = HFP_CODECS_RECEIVED_TRIGGER_CODEC_EXCHANGE;
hfp_connection->establish_audio_connection = 1;
hfp_ag_send_ok(hfp_connection->rfcomm_cid); hfp_ag_send_ok(hfp_connection->rfcomm_cid);
return 1; return 1;

View File

@ -1335,7 +1335,6 @@ void hfp_hf_establish_audio_connection(hci_con_handle_t acl_handle){
if (hfp_connection->state >= HFP_W2_DISCONNECT_SCO) return; if (hfp_connection->state >= HFP_W2_DISCONNECT_SCO) return;
hfp_connection->trigger_codec_exchange = 0; hfp_connection->trigger_codec_exchange = 0;
hfp_connection->establish_audio_connection = 1;
if (!has_codec_negotiation_feature(hfp_connection)){ if (!has_codec_negotiation_feature(hfp_connection)){
log_info("no codec negotiation feature, using NBS"); log_info("no codec negotiation feature, using NBS");
hfp_connection->codecs_state = HFP_CODECS_EXCHANGED; hfp_connection->codecs_state = HFP_CODECS_EXCHANGED;
@ -1343,6 +1342,7 @@ void hfp_hf_establish_audio_connection(hci_con_handle_t acl_handle){
hfp_connection->codec_confirmed = hfp_connection->suggested_codec; hfp_connection->codec_confirmed = hfp_connection->suggested_codec;
hfp_connection->negotiated_codec = hfp_connection->suggested_codec; hfp_connection->negotiated_codec = hfp_connection->suggested_codec;
hfp_init_link_settings(hfp_connection, hfp_hf_esco_s4_supported(hfp_connection)); hfp_init_link_settings(hfp_connection, hfp_hf_esco_s4_supported(hfp_connection));
hfp_connection->establish_audio_connection = 1;
hfp_connection->state = HFP_W4_SCO_CONNECTED; hfp_connection->state = HFP_W4_SCO_CONNECTED;
} else { } else {
switch (hfp_connection->codecs_state){ switch (hfp_connection->codecs_state){