a2dp:emit A2DP_SUBEVENT_STREAM_ESTABLISHED with if connection fails

This commit is contained in:
Matthias Ringwald 2023-01-16 12:16:05 +01:00
parent f31c3c8178
commit fb301407de
3 changed files with 5 additions and 8 deletions

View File

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## Fixed ## Fixed
- btstack_stdin_embedded: use timer to poll RTT input, fix for tickless RTOS - btstack_stdin_embedded: use timer to poll RTT input, fix for tickless RTOS
- gatt_client: return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER for invalid connection handle - gatt_client: return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER for invalid connection handle
- A2DP: emit A2DP_SUBEVENT_STREAM_ESTABLISHED with if connection fails, e.g. because of Page Timeout
## Changed ## Changed
- GAP: add gap_set_peer_privacy_mode with default LE_PRIVACY_MODE_DEVICE - GAP: add gap_set_peer_privacy_mode with default LE_PRIVACY_MODE_DEVICE

View File

@ -837,12 +837,6 @@ static void a2dp_sink_packet_handler(uint8_t packet_type, uint16_t channel, uint
dump_sbc_configuration(&a2dp_conn->sbc_configuration); dump_sbc_configuration(&a2dp_conn->sbc_configuration);
break; break;
} }
case A2DP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED:
status = a2dp_subevent_signaling_connection_established_get_status(packet);
if (status != ERROR_CODE_SUCCESS){
printf("A2DP Sink : Signaling connection failed, status 0x%02x\n", status);
}
break;
case A2DP_SUBEVENT_STREAM_ESTABLISHED: case A2DP_SUBEVENT_STREAM_ESTABLISHED:
a2dp_subevent_stream_established_get_bd_addr(packet, a2dp_conn->addr); a2dp_subevent_stream_established_get_bd_addr(packet, a2dp_conn->addr);

View File

@ -501,13 +501,15 @@ void a2dp_config_process_avdtp_event_handler(avdtp_role_t role, uint8_t *packet,
if (status != ERROR_CODE_SUCCESS){ if (status != ERROR_CODE_SUCCESS){
// notify about connection error only if we're initiator // notify about connection error only if we're initiator
if (config_process->outgoing_active){ if (config_process->outgoing_active){
log_info("A2DP source signaling connection failed status 0x%02x", status); log_info("A2DP signaling connection failed status 0x%02x", status);
config_process->outgoing_active = false; config_process->outgoing_active = false;
a2dp_replace_subevent_id_and_emit_for_role(role, packet, size, A2DP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED); a2dp_replace_subevent_id_and_emit_for_role(role, packet, size, A2DP_SUBEVENT_SIGNALING_CONNECTION_ESTABLISHED);
// also emit streaming connection failed
a2dp_emit_streaming_connection_failed_for_role(role, connection, status);
} }
break; break;
} }
log_info("A2DP source signaling connection established avdtp_cid 0x%02x", cid); log_info("A2DP signaling connection established avdtp_cid 0x%02x", cid);
config_process->state = A2DP_CONNECTED; config_process->state = A2DP_CONNECTED;
// notify app // notify app