mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-30 15:32:41 +00:00
hci: keep le connecting request on create connection cancel complete,
fixes logic for gap_auto_connection_stop + gap_auto_connection_start() sequence
This commit is contained in:
parent
c128876187
commit
f496d06e14
@ -24,6 +24,7 @@ HFP: `ENABLE_HFP_AT_MESSAGES` lets HFP emit `HFP_SUBEVENT_AT_MESSAGE_SENT` and
|
||||
### Fixed
|
||||
L2CAP: fix packet size check for incoming classic basic channels (regression introduced in v1.2.1)
|
||||
A2DP Source: emit codec configure event with reconfigure flag set on reconfigure
|
||||
HCI: keep `le connecting request` on command complete, fixes gap_auto_connection_stop() + gap_auto_connection_start()
|
||||
|
||||
### Changed
|
||||
HFP/GOEP Client/AVDTP/A2DP: return `SDP_SERVICE_NOT_FOUND` if no suitable SDP record is found
|
||||
|
16
src/hci.c
16
src/hci.c
@ -2182,7 +2182,6 @@ static void event_handle_le_connection_complete(const uint8_t * packet){
|
||||
// whitelist connect
|
||||
if (hci_is_le_connection_type(addr_type)){
|
||||
hci_stack->le_connecting_state = LE_CONNECTING_IDLE;
|
||||
hci_stack->le_connecting_request = LE_CONNECTING_IDLE;
|
||||
}
|
||||
// get outgoing connection conn struct for direct connect
|
||||
conn = gap_get_outgoing_connection();
|
||||
@ -2312,7 +2311,6 @@ static void event_handler(uint8_t *packet, uint16_t size){
|
||||
#ifdef ENABLE_LE_CENTRAL
|
||||
if (hci_is_le_connection_type(addr_type)){
|
||||
hci_stack->le_connecting_state = LE_CONNECTING_IDLE;
|
||||
hci_stack->le_connecting_request = LE_CONNECTING_IDLE;
|
||||
}
|
||||
#endif
|
||||
// error => outgoing connection failed
|
||||
@ -3748,18 +3746,24 @@ static bool hci_run_general_gap_le(void){
|
||||
|
||||
#ifdef ENABLE_LE_CENTRAL
|
||||
// connecting control
|
||||
if (hci_stack->le_connecting_state != LE_CONNECTING_IDLE){
|
||||
bool connecting_with_whitelist;
|
||||
switch (hci_stack->le_connecting_state){
|
||||
case LE_CONNECTING_DIRECT:
|
||||
case LE_CONNECTING_WHITELIST:
|
||||
// stop connecting if:
|
||||
// - connecting uses white and whitelist modification pending
|
||||
// - if it got disabled
|
||||
// - resolving list modified
|
||||
bool connecting_uses_whitelist = hci_stack->le_connecting_request == LE_CONNECTING_WHITELIST;
|
||||
if ((connecting_uses_whitelist && whitelist_modification_pending) ||
|
||||
connecting_with_whitelist = hci_stack->le_connecting_state == LE_CONNECTING_WHITELIST;
|
||||
if ((connecting_with_whitelist && whitelist_modification_pending) ||
|
||||
(hci_stack->le_connecting_request == LE_CONNECTING_IDLE) ||
|
||||
resolving_list_modification_pending) {
|
||||
|
||||
connecting_stop = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -3795,11 +3799,9 @@ static bool hci_run_general_gap_le(void){
|
||||
|
||||
#ifdef ENABLE_LE_CENTRAL
|
||||
if (connecting_stop){
|
||||
if (hci_stack->le_connecting_state != LE_CONNECTING_CANCEL){
|
||||
hci_send_cmd(&hci_le_create_connection_cancel);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_LE_PERIPHERAL
|
||||
|
Loading…
x
Reference in New Issue
Block a user