From e57d740485b945f4e366d6c36c6234e580776f9d Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Mon, 16 Dec 2019 11:21:27 +0100 Subject: [PATCH] avdtp: introduce avdtp_configuration_state --- src/classic/avdtp.c | 1 + src/classic/avdtp.h | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/classic/avdtp.c b/src/classic/avdtp.c index ae450aed8..f09b1370c 100644 --- a/src/classic/avdtp.c +++ b/src/classic/avdtp.c @@ -345,6 +345,7 @@ avdtp_connection_t * avdtp_create_connection(bd_addr_t remote_addr, avdtp_contex connection->state = AVDTP_SIGNALING_CONNECTION_IDLE; connection->initiator_transaction_label = avdtp_get_next_initiator_transaction_label(context); connection->avdtp_cid = avdtp_get_next_avdtp_cid(context); + connection->configuration_state = AVDTP_CONFIGURATION_STATE_IDLE; context->avdtp_cid = connection->avdtp_cid; (void)memcpy(connection->remote_addr, remote_addr, 6); btstack_linked_list_add(&context->connections, (btstack_linked_item_t *) connection); diff --git a/src/classic/avdtp.h b/src/classic/avdtp.h index 800a21ed7..7f6e81887 100644 --- a/src/classic/avdtp.h +++ b/src/classic/avdtp.h @@ -379,6 +379,13 @@ typedef struct { avdtp_packet_type_t packet_type; } avdtp_signaling_packet_t; +typedef enum { + AVDTP_CONFIGURATION_STATE_IDLE, + AVDTP_CONFIGURATION_STATE_LOCAL_INITIATED, + AVDTP_CONFIGURATION_STATE_LOCAL_CONFIGURED, + AVDTP_CONFIGURATION_STATE_REMOTE_INITIATED, + AVDTP_CONFIGURATION_STATE_REMOTE_CONFIGURED, +} avtdp_configuration_state_t; typedef struct { btstack_linked_item_t item; @@ -423,6 +430,9 @@ typedef struct { // avdtp_sep_t remote_seps[AVDTP_MAX_NUM_SEPS]; // uint8_t remote_seps_num; + // configuration state machine + avtdp_configuration_state_t configuration_state; + // store current role uint8_t is_initiator; uint8_t is_configuration_initiated_locally;