avdtp: track who succeeded in configuration

This commit is contained in:
Matthias Ringwald 2019-12-16 10:50:36 +01:00
parent f53ec64947
commit a30d031959
3 changed files with 7 additions and 1 deletions

View File

@ -426,6 +426,10 @@ typedef struct {
// store current role
uint8_t is_initiator;
uint8_t is_configuration_initiated_locally;
// we won the configuration race, only valid after configuration was accepted
bool is_our_configuration;
btstack_timer_source_t configuration_timer;
} avdtp_connection_t;

View File

@ -216,6 +216,7 @@ void avdtp_acceptor_stream_config_subsm(avdtp_connection_t * connection, uint8_t
log_info("acceptor SM received SET_CONFIGURATION cmd: change role to acceptor, is_initiator %d", connection->is_initiator);
}
connection->is_our_configuration = false;
log_info("ACP: AVDTP_ACCEPTOR_W2_ANSWER_SET_CONFIGURATION connection %p", connection);
stream_endpoint->state = AVDTP_STREAM_ENDPOINT_CONFIGURATION_SUBSTATEMACHINE;
stream_endpoint->acceptor_config_state = AVDTP_ACCEPTOR_W2_ANSWER_SET_CONFIGURATION;

View File

@ -176,7 +176,8 @@ void avdtp_initiator_stream_config_subsm(avdtp_connection_t * connection, uint8_
stream_endpoint->state = AVDTP_STREAM_ENDPOINT_CONFIGURED;
stream_endpoint->remote_sep = sep;
stream_endpoint->connection = connection;
connection->is_our_configuration = true;
log_info("INT: configured remote seid %d, to %p", stream_endpoint->remote_sep.seid, stream_endpoint);
switch (stream_endpoint->media_codec_type){