a2dp: emit stream established if peer set-up configuration

This commit is contained in:
Matthias Ringwald 2024-07-08 15:05:37 +02:00
parent edc66e936a
commit 6d3263ec49
2 changed files with 9 additions and 3 deletions

View File

@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- HID Host: return complete HID report
- SM: fix CTKD key distribution over BR/EDR
- SM: fix CTKD after BR/EDR Role Change
- A2DP: emit stream established if peer set-up configuration
### Changed
- GAP: return command disallowed if disconnect already requested

View File

@ -494,6 +494,7 @@ void a2dp_config_process_avdtp_event_handler(avdtp_role_t role, uint8_t *packet,
uint8_t status;
uint8_t local_seid;
uint8_t remote_seid;
bool outgoing_active;
switch (hci_event_avdtp_meta_get_subevent_code(packet)){
case AVDTP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED:
@ -760,14 +761,18 @@ void a2dp_config_process_avdtp_event_handler(avdtp_role_t role, uint8_t *packet,
cid = avdtp_subevent_streaming_connection_established_get_avdtp_cid(packet);
connection = avdtp_get_connection_for_avdtp_cid(cid);
btstack_assert(connection != NULL);
config_process = a2dp_config_process_for_role(role, connection);
if (config_process->state != A2DP_W4_OPEN_STREAM_WITH_SEID) break;
outgoing_active = config_process->outgoing_active;
config_process->outgoing_active = false;
status = avdtp_subevent_streaming_connection_established_get_status(packet);
if (status != ERROR_CODE_SUCCESS){
log_info("A2DP source streaming connection could not be established, avdtp_cid 0x%02x, status 0x%02x ---", cid, status);
config_process->state = A2DP_CONNECTED;
// suppress event if streaming wasn't requested by us
if (outgoing_active == false){
break;
}
} else {
log_info("A2DP source streaming connection established --- avdtp_cid 0x%02x, local seid 0x%02x, remote seid 0x%02x", cid,
avdtp_subevent_streaming_connection_established_get_local_seid(packet),