mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-04 13:14:32 +02:00
fix(ble/bluedroid): Fixed fail to disconnect when device record is cleared
(cherry picked from commit b6dc79af47
)
Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
This commit is contained in:
@@ -2519,8 +2519,7 @@ tBTM_STATUS btm_remove_acl (BD_ADDR bd_addr, tBT_TRANSPORT transport)
|
|||||||
} else /* otherwise can disconnect right away */
|
} else /* otherwise can disconnect right away */
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (hci_handle != 0xFFFF && p_dev_rec &&
|
if (hci_handle != 0xFFFF && (( p_dev_rec && p_dev_rec->sec_state != BTM_SEC_STATE_DISCONNECTING) || (!p_dev_rec))) {
|
||||||
p_dev_rec->sec_state != BTM_SEC_STATE_DISCONNECTING) {
|
|
||||||
if (!btsnd_hcic_disconnect (hci_handle, HCI_ERR_PEER_USER)) {
|
if (!btsnd_hcic_disconnect (hci_handle, HCI_ERR_PEER_USER)) {
|
||||||
status = BTM_NO_RESOURCES;
|
status = BTM_NO_RESOURCES;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user