a2dp_source: store local stream endpoint in avdtp_connection

This commit is contained in:
Matthias Ringwald 2021-05-27 17:46:07 +02:00
parent 889ef44157
commit 7d99e5e205
2 changed files with 6 additions and 3 deletions

View File

@ -271,7 +271,8 @@ static void a2dp_handle_received_configuration(const uint8_t *packet, uint8_t lo
uint16_t cid = avdtp_subevent_signaling_media_codec_sbc_configuration_get_avdtp_cid(packet);
avdtp_connection_t * avdtp_connection = avdtp_get_connection_for_avdtp_cid(cid);
btstack_assert(avdtp_connection != NULL);
local_stream_endpoint = avdtp_get_stream_endpoint_for_seid(local_seid);
avdtp_connection->a2dp_source_local_stream_endpoint = avdtp_get_stream_endpoint_for_seid(local_seid);
local_stream_endpoint = avdtp_connection->a2dp_source_local_stream_endpoint;
// bail out if local seid invalid
if (!local_stream_endpoint) return;
@ -691,6 +692,7 @@ static void a2dp_source_packet_handler_internal(uint8_t packet_type, uint16_t ch
if (sep_discovery_cid == cid){
a2dp_source_set_config_timer_stop();
connection->a2dp_source_stream_endpoint_configured = false;
connection->a2dp_source_local_stream_endpoint = NULL;
local_stream_endpoint = NULL;
connection->a2dp_source_state = A2DP_IDLE;
@ -860,6 +862,7 @@ static uint8_t a2dp_source_config_init(avdtp_connection_t *connection, uint8_t l
}
// suitable Sink stream endpoint found, configure it
connection->a2dp_source_local_stream_endpoint = stream_endpoint;
local_stream_endpoint = stream_endpoint;
connection->a2dp_source_have_config = true;

View File

@ -534,8 +534,7 @@ typedef struct {
// configuration state machine
avtdp_configuration_state_t configuration_state;
// btstack_timer_source_t configuration_timer;
bool incoming_declined;
btstack_timer_source_t retry_timer;
@ -544,6 +543,7 @@ typedef struct {
bool a2dp_source_have_config;
bool a2dp_source_stream_endpoint_configured;
a2dp_state_t a2dp_source_state;
struct avdtp_stream_endpoint * a2dp_source_local_stream_endpoint;
} avdtp_connection_t;