mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-24 22:43:35 +00:00
hci: fix gap_connect_cancel for gap_connect_with_whitelist
This commit is contained in:
parent
e57898c743
commit
14f2d8f08a
@ -15,6 +15,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
|
||||
- GAP: fix gap_connect_cancel for gap_connect_with_whitelist
|
||||
- L2CAP: Fix accept incoming ERTM connection when Information Request already complete
|
||||
- HFP AG: activate all AG indicators upon service level connection establishment
|
||||
|
||||
|
45
src/hci.c
45
src/hci.c
@ -7113,25 +7113,42 @@ static hci_connection_t * gap_get_outgoing_connection(void){
|
||||
}
|
||||
|
||||
uint8_t gap_connect_cancel(void){
|
||||
hci_connection_t * conn = gap_get_outgoing_connection();
|
||||
if (!conn) return 0;
|
||||
switch (conn->state){
|
||||
case SEND_CREATE_CONNECTION:
|
||||
// skip sending create connection and emit event instead
|
||||
hci_connection_t * conn;
|
||||
switch (hci_stack->le_connecting_request){
|
||||
case LE_CONNECTING_IDLE:
|
||||
break;
|
||||
case LE_CONNECTING_WHITELIST:
|
||||
hci_stack->le_connecting_request = LE_CONNECTING_IDLE;
|
||||
hci_emit_le_connection_complete(conn->address_type, conn->address, 0, ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER);
|
||||
btstack_linked_list_remove(&hci_stack->connections, (btstack_linked_item_t *) conn);
|
||||
btstack_memory_hci_connection_free( conn );
|
||||
break;
|
||||
case SENT_CREATE_CONNECTION:
|
||||
// request to send cancel connection
|
||||
conn->state = SEND_CANCEL_CONNECTION;
|
||||
hci_run();
|
||||
break;
|
||||
default:
|
||||
case LE_CONNECTING_DIRECT:
|
||||
hci_stack->le_connecting_request = LE_CONNECTING_IDLE;
|
||||
conn = gap_get_outgoing_connection();
|
||||
if (conn == NULL){
|
||||
hci_run();
|
||||
} else {
|
||||
switch (conn->state){
|
||||
case SEND_CREATE_CONNECTION:
|
||||
// skip sending create connection and emit event instead
|
||||
hci_emit_le_connection_complete(conn->address_type, conn->address, 0, ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER);
|
||||
btstack_linked_list_remove(&hci_stack->connections, (btstack_linked_item_t *) conn);
|
||||
btstack_memory_hci_connection_free( conn );
|
||||
break;
|
||||
case SENT_CREATE_CONNECTION:
|
||||
// request to send cancel connection
|
||||
conn->state = SEND_CANCEL_CONNECTION;
|
||||
hci_run();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case LE_CONNECTING_CANCEL:
|
||||
btstack_unreachable();
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
return ERROR_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user