mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(bt/bluedroid): Fixed BLE create conn cancel when conn already exist
This commit is contained in:
parent
f8ad2871e6
commit
5c50fac22a
@ -2148,7 +2148,7 @@ void btm_ble_create_ll_conn_complete (UINT8 status)
|
||||
tL2C_LCB *p_lcb = l2cu_find_lcb_by_bd_addr(l2cb.ble_connecting_bda, BT_TRANSPORT_LE);
|
||||
/* Do not remove lcb if an LE link is already up as a peripheral */
|
||||
if (p_lcb != NULL &&
|
||||
!(p_lcb->link_role == HCI_ROLE_SLAVE && BTM_ACL_IS_CONNECTED(l2cb.ble_connecting_bda))) {
|
||||
!(p_lcb->link_role == HCI_ROLE_SLAVE && BTM_LE_ACL_IS_CONNECTED(l2cb.ble_connecting_bda))) {
|
||||
p_lcb->disc_reason = L2CAP_CONN_CANCEL;
|
||||
l2cu_release_lcb (p_lcb);
|
||||
}
|
||||
|
@ -50,6 +50,7 @@ typedef char tBTM_LOC_BD_NAME[BTM_MAX_LOC_BD_NAME_LEN + 1];
|
||||
#endif
|
||||
|
||||
#define BTM_ACL_IS_CONNECTED(bda) (btm_bda_to_acl (bda, BT_TRANSPORT_BR_EDR) != NULL)
|
||||
#define BTM_LE_ACL_IS_CONNECTED(bda) (btm_bda_to_acl (bda, BT_TRANSPORT_LE) != NULL)
|
||||
|
||||
/* Definitions for Server Channel Number (SCN) management
|
||||
*/
|
||||
|
@ -111,7 +111,7 @@ BOOLEAN L2CA_CancelBleConnectReq (BD_ADDR rem_bda)
|
||||
p_lcb = l2cu_find_lcb_by_bd_addr(rem_bda, BT_TRANSPORT_LE);
|
||||
/* Do not remove lcb if an LE link is already up as a peripheral */
|
||||
if (p_lcb != NULL &&
|
||||
!(p_lcb->link_role == HCI_ROLE_SLAVE && BTM_ACL_IS_CONNECTED(rem_bda))) {
|
||||
!(p_lcb->link_role == HCI_ROLE_SLAVE && BTM_LE_ACL_IS_CONNECTED(rem_bda))) {
|
||||
p_lcb->disc_reason = L2CAP_CONN_CANCEL;
|
||||
l2cu_release_lcb (p_lcb);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user