mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-25 16:43:28 +00:00
avdtp: mark stream endpoint as used on send/receive of set config command
This commit is contained in:
parent
0dbf08549f
commit
1114e1584c
@ -422,7 +422,6 @@ static void a2dp_source_packet_handler_internal(uint8_t packet_type, uint16_t ch
|
||||
configuration.min_bitpool_value = avdtp_choose_sbc_min_bitpool_value(stream_endpoint, avdtp_subevent_signaling_media_codec_sbc_capability_get_min_bitpool_value(packet));
|
||||
|
||||
// and pre-select this endpoint
|
||||
stream_endpoint->sep.in_use = 1;
|
||||
local_seid = avdtp_stream_endpoint_seid(stream_endpoint);
|
||||
remote_seid = avdtp_subevent_signaling_media_codec_sbc_capability_get_remote_seid(packet);
|
||||
a2dp_source_set_config_sbc(cid, local_seid, remote_seid, &configuration);
|
||||
|
@ -101,6 +101,13 @@ avdtp_acceptor_handle_configuration_command(avdtp_connection_t *connection, int
|
||||
sep.configured_service_categories = avdtp_unpack_service_capabilities(connection, connection->acceptor_signaling_packet.signal_identifier, &sep.configuration, connection->acceptor_signaling_packet.command+offset, packet_size-offset);
|
||||
sep.in_use = 1;
|
||||
|
||||
// test if sep already in use
|
||||
if (stream_endpoint->sep.in_use != 0){
|
||||
log_info("stream endpoint already in use");
|
||||
connection->error_code = AVDTP_ERROR_CODE_SEP_IN_USE;
|
||||
connection->reject_service_category = 0;
|
||||
}
|
||||
|
||||
// let application validate media configuration as well
|
||||
if (connection->error_code == 0){
|
||||
if ((sep.configured_service_categories & (1 << AVDTP_MEDIA_CODEC)) != 0){
|
||||
@ -150,6 +157,9 @@ avdtp_acceptor_handle_configuration_command(avdtp_connection_t *connection, int
|
||||
stream_endpoint->remote_sep = sep;
|
||||
log_info("add remote seid %d", stream_endpoint->remote_sep.seid);
|
||||
}
|
||||
|
||||
// mark as in_use
|
||||
stream_endpoint->sep.in_use = 1;
|
||||
|
||||
// if media codec configuration set, copy configuration and emit event
|
||||
if ((sep.configured_service_categories & (1 << AVDTP_MEDIA_CODEC)) != 0){
|
||||
|
@ -171,6 +171,7 @@ void avdtp_initiator_stream_config_subsm(avdtp_connection_t *connection, uint8_t
|
||||
sep.in_use = 1;
|
||||
|
||||
stream_endpoint->state = AVDTP_STREAM_ENDPOINT_CONFIGURED;
|
||||
stream_endpoint->sep.in_use = 1;
|
||||
stream_endpoint->remote_sep = sep;
|
||||
stream_endpoint->connection = connection;
|
||||
connection->configuration_state = AVDTP_CONFIGURATION_STATE_LOCAL_CONFIGURED;
|
||||
|
Loading…
x
Reference in New Issue
Block a user