mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 13:44:32 +02:00
fix(ble/bluedroid): Fixed issue with deleting link key when classic Bluetooth is not used
(cherry picked from commit 7c16bce827
)
Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
This commit is contained in:
@@ -186,8 +186,10 @@ BOOLEAN BTM_SecDeleteDevice (BD_ADDR bd_addr, tBT_TRANSPORT transport)
|
||||
}
|
||||
|
||||
if ((p_dev_rec = btm_find_dev(bd_addr)) != NULL) {
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/* Tell controller to get rid of the link key, if it has one stored */
|
||||
BTM_DeleteStoredLinkKey (p_dev_rec->bd_addr, NULL);
|
||||
#endif // (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
btm_sec_free_dev(p_dev_rec, transport);
|
||||
}
|
||||
|
@@ -952,6 +952,7 @@ tBTM_STATUS BTM_EnableTestMode(void)
|
||||
}
|
||||
}
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_DeleteStoredLinkKey
|
||||
@@ -1026,6 +1027,7 @@ void btm_delete_stored_link_key_complete (UINT8 *p)
|
||||
}
|
||||
}
|
||||
|
||||
#endif // (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function btm_report_device_status
|
||||
|
@@ -1001,12 +1001,12 @@ tBTM_STATUS btm_sec_bond_by_transport (BD_ADDR bd_addr, tBT_TRANSPORT transport,
|
||||
return (BTM_SUCCESS);
|
||||
}
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/* Tell controller to get rid of the link key if it has one stored */
|
||||
if ((BTM_DeleteStoredLinkKey (bd_addr, NULL)) != BTM_SUCCESS) {
|
||||
return (BTM_NO_RESOURCES);
|
||||
}
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/* Save the PIN code if we got a valid one */
|
||||
if (p_pin && (pin_len <= PIN_CODE_LEN) && (pin_len != 0)) {
|
||||
btm_cb.pin_code_len = pin_len;
|
||||
|
@@ -1146,7 +1146,9 @@ void btm_vsc_complete (UINT8 *p, UINT16 cc_opcode, UINT16 evt_len,
|
||||
tBTM_CMPL_CB *p_vsc_cplt_cback);
|
||||
void btm_inq_db_reset (void);
|
||||
void btm_vendor_specific_evt (UINT8 *p, UINT8 evt_len);
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
void btm_delete_stored_link_key_complete (UINT8 *p);
|
||||
#endif // (CLASSIC_BT_INCLUDED == TRUE)
|
||||
void btm_report_device_status (tBTM_DEV_STATUS status);
|
||||
void btm_set_afh_channels_complete (UINT8 *p);
|
||||
void btm_ble_set_channels_complete (UINT8 *p);
|
||||
|
@@ -960,10 +960,11 @@ static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_l
|
||||
case HCI_SET_EVENT_FILTER:
|
||||
btm_event_filter_complete (p);
|
||||
break;
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
case HCI_DELETE_STORED_LINK_KEY:
|
||||
btm_delete_stored_link_key_complete (p);
|
||||
break;
|
||||
#endif // (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
case HCI_READ_LOCAL_NAME:
|
||||
btm_read_local_name_complete (p, evt_len);
|
||||
|
@@ -3942,6 +3942,7 @@ tBTM_STATUS BTM_SetSsrParams (BD_ADDR remote_bda, UINT16 max_lat,
|
||||
//extern
|
||||
UINT16 BTM_GetHCIConnHandle (BD_ADDR remote_bda, tBT_TRANSPORT transport);
|
||||
|
||||
#if (CLASSIC_BT_INCLUDED == TRUE)
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTM_DeleteStoredLinkKey
|
||||
@@ -3957,6 +3958,7 @@ UINT16 BTM_GetHCIConnHandle (BD_ADDR remote_bda, tBT_TRANSPORT transport);
|
||||
*******************************************************************************/
|
||||
//extern
|
||||
tBTM_STATUS BTM_DeleteStoredLinkKey(BD_ADDR bd_addr, tBTM_CMPL_CB *p_cb);
|
||||
#endif // (CLASSIC_BT_INCLUDED == TRUE)
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
Reference in New Issue
Block a user