Loading system/bta/dm/bta_dm_act.c +7 −3 Original line number Original line Diff line number Diff line Loading @@ -3333,12 +3333,16 @@ void bta_dm_acl_change(tBTA_DM_MSG *p_data) } } if (conn.link_down.is_removed) if (conn.link_down.is_removed) { { BTM_SecDeleteDevice(p_bda); // p_bda points to security record, which is removed in // BTM_SecDeleteDevice. BD_ADDR addr_copy; memcpy(addr_copy, p_bda, BD_ADDR_LEN); BTM_SecDeleteDevice(addr_copy); #if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE) #if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE) /* need to remove all pending background connection */ /* need to remove all pending background connection */ BTA_GATTC_CancelOpen(0, p_bda, FALSE); BTA_GATTC_CancelOpen(0, addr_copy, FALSE); /* remove all cached GATT information */ /* remove all cached GATT information */ BTA_GATTC_Refresh(p_bda); BTA_GATTC_Refresh(addr_copy); #endif #endif } } Loading system/stack/btm/btm_dev.c +13 −12 Original line number Original line Diff line number Diff line Loading @@ -157,17 +157,16 @@ BOOLEAN BTM_SecAddDevice (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, } } /******************************************************************************* /** Free resources associated with the device associated with |bd_addr| address. ** * ** Function BTM_SecDeleteDevice * *** WARNING *** ** * tBTM_SEC_DEV_REC associated with bd_addr becomes invalid after this function ** Description Free resources associated with the device. * is called, also any of it's fields. i.e. if you use p_dev_rec->bd_addr, it is ** * no longer valid! ** Parameters: bd_addr - BD address of the peer * *** WARNING *** ** * ** Returns TRUE if removed OK, FALSE if not found or ACL link is active * Returns true if removed OK, false if not found or ACL link is active. ** */ *******************************************************************************/ BOOLEAN BTM_SecDeleteDevice (BD_ADDR bd_addr) BOOLEAN BTM_SecDeleteDevice (BD_ADDR bd_addr) { { if (BTM_IsAclConnectionUp(bd_addr, BT_TRANSPORT_LE) || if (BTM_IsAclConnectionUp(bd_addr, BT_TRANSPORT_LE) || Loading @@ -180,9 +179,11 @@ BOOLEAN BTM_SecDeleteDevice (BD_ADDR bd_addr) tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev(bd_addr); tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev(bd_addr); if (p_dev_rec != NULL) if (p_dev_rec != NULL) { { BD_ADDR bda; memcpy(bda, bd_addr, BD_ADDR_LEN); btm_sec_free_dev(p_dev_rec); btm_sec_free_dev(p_dev_rec); /* Tell controller to get rid of the link key, if it has one stored */ /* Tell controller to get rid of the link key, if it has one stored */ BTM_DeleteStoredLinkKey (p_dev_rec->bd_addr, NULL); BTM_DeleteStoredLinkKey (bda, NULL); } } return TRUE; return TRUE; Loading system/stack/include/btm_api.h +10 −9 Original line number Original line Diff line number Diff line Loading @@ -3313,15 +3313,16 @@ extern BOOLEAN BTM_SecAddDevice (BD_ADDR bd_addr, DEV_CLASS dev_class, UINT8 key_type, tBTM_IO_CAP io_cap, UINT8 pin_length); UINT8 key_type, tBTM_IO_CAP io_cap, UINT8 pin_length); /******************************************************************************* /** Free resources associated with the device associated with |bd_addr| address. ** * ** Function BTM_SecDeleteDevice * *** WARNING *** ** * tBTM_SEC_DEV_REC associated with bd_addr becomes invalid after this function ** Description Free resources associated with the device. * is called, also any of it's fields. i.e. if you use p_dev_rec->bd_addr, it is ** * no longer valid! ** Returns TRUE if rmoved OK, FALSE if not found * *** WARNING *** ** * *******************************************************************************/ * Returns true if removed OK, false if not found or ACL link is active. */ extern BOOLEAN BTM_SecDeleteDevice (BD_ADDR bd_addr); extern BOOLEAN BTM_SecDeleteDevice (BD_ADDR bd_addr); /******************************************************************************* /******************************************************************************* Loading Loading
system/bta/dm/bta_dm_act.c +7 −3 Original line number Original line Diff line number Diff line Loading @@ -3333,12 +3333,16 @@ void bta_dm_acl_change(tBTA_DM_MSG *p_data) } } if (conn.link_down.is_removed) if (conn.link_down.is_removed) { { BTM_SecDeleteDevice(p_bda); // p_bda points to security record, which is removed in // BTM_SecDeleteDevice. BD_ADDR addr_copy; memcpy(addr_copy, p_bda, BD_ADDR_LEN); BTM_SecDeleteDevice(addr_copy); #if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE) #if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE) /* need to remove all pending background connection */ /* need to remove all pending background connection */ BTA_GATTC_CancelOpen(0, p_bda, FALSE); BTA_GATTC_CancelOpen(0, addr_copy, FALSE); /* remove all cached GATT information */ /* remove all cached GATT information */ BTA_GATTC_Refresh(p_bda); BTA_GATTC_Refresh(addr_copy); #endif #endif } } Loading
system/stack/btm/btm_dev.c +13 −12 Original line number Original line Diff line number Diff line Loading @@ -157,17 +157,16 @@ BOOLEAN BTM_SecAddDevice (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name, } } /******************************************************************************* /** Free resources associated with the device associated with |bd_addr| address. ** * ** Function BTM_SecDeleteDevice * *** WARNING *** ** * tBTM_SEC_DEV_REC associated with bd_addr becomes invalid after this function ** Description Free resources associated with the device. * is called, also any of it's fields. i.e. if you use p_dev_rec->bd_addr, it is ** * no longer valid! ** Parameters: bd_addr - BD address of the peer * *** WARNING *** ** * ** Returns TRUE if removed OK, FALSE if not found or ACL link is active * Returns true if removed OK, false if not found or ACL link is active. ** */ *******************************************************************************/ BOOLEAN BTM_SecDeleteDevice (BD_ADDR bd_addr) BOOLEAN BTM_SecDeleteDevice (BD_ADDR bd_addr) { { if (BTM_IsAclConnectionUp(bd_addr, BT_TRANSPORT_LE) || if (BTM_IsAclConnectionUp(bd_addr, BT_TRANSPORT_LE) || Loading @@ -180,9 +179,11 @@ BOOLEAN BTM_SecDeleteDevice (BD_ADDR bd_addr) tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev(bd_addr); tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev(bd_addr); if (p_dev_rec != NULL) if (p_dev_rec != NULL) { { BD_ADDR bda; memcpy(bda, bd_addr, BD_ADDR_LEN); btm_sec_free_dev(p_dev_rec); btm_sec_free_dev(p_dev_rec); /* Tell controller to get rid of the link key, if it has one stored */ /* Tell controller to get rid of the link key, if it has one stored */ BTM_DeleteStoredLinkKey (p_dev_rec->bd_addr, NULL); BTM_DeleteStoredLinkKey (bda, NULL); } } return TRUE; return TRUE; Loading
system/stack/include/btm_api.h +10 −9 Original line number Original line Diff line number Diff line Loading @@ -3313,15 +3313,16 @@ extern BOOLEAN BTM_SecAddDevice (BD_ADDR bd_addr, DEV_CLASS dev_class, UINT8 key_type, tBTM_IO_CAP io_cap, UINT8 pin_length); UINT8 key_type, tBTM_IO_CAP io_cap, UINT8 pin_length); /******************************************************************************* /** Free resources associated with the device associated with |bd_addr| address. ** * ** Function BTM_SecDeleteDevice * *** WARNING *** ** * tBTM_SEC_DEV_REC associated with bd_addr becomes invalid after this function ** Description Free resources associated with the device. * is called, also any of it's fields. i.e. if you use p_dev_rec->bd_addr, it is ** * no longer valid! ** Returns TRUE if rmoved OK, FALSE if not found * *** WARNING *** ** * *******************************************************************************/ * Returns true if removed OK, false if not found or ACL link is active. */ extern BOOLEAN BTM_SecDeleteDevice (BD_ADDR bd_addr); extern BOOLEAN BTM_SecDeleteDevice (BD_ADDR bd_addr); /******************************************************************************* /******************************************************************************* Loading