l2cap: fix accept incoming ERTM connection when Information Request already complete

This commit is contained in:
Matthias Ringwald 2022-04-07 19:34:18 +02:00
parent 378b1cb274
commit 7dfda25627
2 changed files with 6 additions and 7 deletions

View File

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- HFP HF: emit HFP_SUBEVENT_TRANSMIT_DTMF_CODES after sending DTMF command
### Fixed
- L2CAP: Fix accept incoming ERTM connection when Information Request already complete
- HFP AG: activate all AG indicators upon service level connection establishment
### Changed

View File

@ -720,20 +720,18 @@ uint8_t l2cap_ertm_accept_connection(uint16_t local_cid, l2cap_ertm_config_t * e
// configure L2CAP ERTM
l2cap_ertm_configure_channel(channel, ertm_config, buffer, size);
// already available?
// we need to know if ERTM is supported before sending a config response
channel->state = L2CAP_STATE_WAIT_INCOMING_EXTENDED_FEATURES;
hci_connection_t * connection = hci_connection_for_handle(channel->con_handle);
btstack_assert(connection != NULL);
// we need to know if ERTM is supported before sending a config response
switch (connection->l2cap_state.information_state){
case L2CAP_INFORMATION_STATE_IDLE:
connection->l2cap_state.information_state = L2CAP_INFORMATION_STATE_W2_SEND_EXTENDED_FEATURE_REQUEST;
break;
case L2CAP_INFORMATION_STATE_DONE:
l2cap_handle_information_request_complete(connection);
break;
case L2CAP_INFORMATION_STATE_IDLE:
connection->l2cap_state.information_state = L2CAP_INFORMATION_STATE_W2_SEND_EXTENDED_FEATURE_REQUEST;
/* fall through */
default:
channel->state = L2CAP_STATE_WAIT_INCOMING_EXTENDED_FEATURES;
break;
}