diff --git a/components/bt/host/bluedroid/bta/dm/bta_dm_act.c b/components/bt/host/bluedroid/bta/dm/bta_dm_act.c index f6817785d9..c7cc7ed318 100644 --- a/components/bt/host/bluedroid/bta/dm/bta_dm_act.c +++ b/components/bt/host/bluedroid/bta/dm/bta_dm_act.c @@ -1242,54 +1242,6 @@ void bta_dm_add_device (tBTA_DM_MSG *p_data) } } -#if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE) -/******************************************************************************* -** -** Function bta_dm_close_acl -** -** Description This function forces to close the connection to a remote device -** and optionally remove the device from security database if -** required. -**** -*******************************************************************************/ -void bta_dm_close_acl(tBTA_DM_MSG *p_data) -{ - tBTA_DM_API_REMOVE_ACL *p_remove_acl = &p_data->remove_acl; - UINT8 index; - - APPL_TRACE_DEBUG("bta_dm_close_acl"); - - if (BTM_IsAclConnectionUp(p_remove_acl->bd_addr, p_remove_acl->transport)) { - for (index = 0; index < bta_dm_cb.device_list.count; index ++) { - if (!bdcmp( bta_dm_cb.device_list.peer_device[index].peer_bdaddr, p_remove_acl->bd_addr)) { - break; - } - } - if (index != bta_dm_cb.device_list.count) { - if (p_remove_acl->remove_dev) { - bta_dm_cb.device_list.peer_device[index].remove_dev_pending = TRUE; - } - } else { - APPL_TRACE_ERROR("unknown device, remove ACL failed"); - } - /* Disconnect the ACL link */ - btm_remove_acl(p_remove_acl->bd_addr, p_remove_acl->transport); - } - /* if to remove the device from security database ? do it now */ - else if (p_remove_acl->remove_dev) { - if (!BTM_SecDeleteDevice(p_remove_acl->bd_addr, p_remove_acl->transport)) { - APPL_TRACE_ERROR("delete device from security database failed."); - } -#if (BLE_INCLUDED == TRUE && GATTC_INCLUDED == TRUE) - /* need to remove all pending background connection if any */ - BTA_GATTC_CancelOpen(0, p_remove_acl->bd_addr, FALSE); -#endif - } - /* otherwise, no action needed */ - -} -#endif // #if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE) - /******************************************************************************* ** ** Function bta_dm_bond diff --git a/components/bt/host/bluedroid/bta/dm/bta_dm_api.c b/components/bt/host/bluedroid/bta/dm/bta_dm_api.c index 1dc86e925c..68c3dfb059 100644 --- a/components/bt/host/bluedroid/bta/dm/bta_dm_api.c +++ b/components/bt/host/bluedroid/bta/dm/bta_dm_api.c @@ -2195,40 +2195,6 @@ void BTA_DmSetEncryption(BD_ADDR bd_addr, tBTA_TRANSPORT transport, tBTA_DM_ENCR } #endif ///SMP_INCLUDED == TRUE -#if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE) -/******************************************************************************* -** -** Function BTA_DmCloseACL -** -** Description This function force to close an ACL connection and remove the -** device from the security database list of known devices. -** -** Parameters: bd_addr - Address of the peer device -** remove_dev - remove device or not after link down -** -** Returns void -** -*******************************************************************************/ -void BTA_DmCloseACL(BD_ADDR bd_addr, BOOLEAN remove_dev, tBTA_TRANSPORT transport) -{ - tBTA_DM_API_REMOVE_ACL *p_msg; - - APPL_TRACE_API("BTA_DmCloseACL"); - - if ((p_msg = (tBTA_DM_API_REMOVE_ACL *) osi_malloc(sizeof(tBTA_DM_API_REMOVE_ACL))) != NULL) { - memset(p_msg, 0, sizeof(tBTA_DM_API_REMOVE_ACL)); - - p_msg->hdr.event = BTA_DM_API_REMOVE_ACL_EVT; - - memcpy(p_msg->bd_addr, bd_addr, BD_ADDR_LEN); - p_msg->remove_dev = remove_dev; - p_msg->transport = transport; - - bta_sys_sendmsg(p_msg); - } -} -#endif // #if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE) - #if BLE_INCLUDED == TRUE #if (BLE_42_SCAN_EN == TRUE) diff --git a/components/bt/host/bluedroid/bta/dm/bta_dm_main.c b/components/bt/host/bluedroid/bta/dm/bta_dm_main.c index 3a3a383852..407f595408 100644 --- a/components/bt/host/bluedroid/bta/dm/bta_dm_main.c +++ b/components/bt/host/bluedroid/bta/dm/bta_dm_main.c @@ -94,9 +94,6 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = { #endif // #if (CLASSIC_BT_INCLUDED == TRUE) bta_dm_acl_change, /* BTA_DM_ACL_CHANGE_EVT */ bta_dm_add_device, /* BTA_DM_API_ADD_DEVICE_EVT */ -#if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE) - bta_dm_close_acl, /* BTA_DM_API_REMOVE_ACL_EVT */ -#endif // #if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE) #if (SMP_INCLUDED == TRUE) /* security API events */ bta_dm_bond, /* BTA_DM_API_BOND_EVT */ diff --git a/components/bt/host/bluedroid/bta/dm/include/bta_dm_int.h b/components/bt/host/bluedroid/bta/dm/include/bta_dm_int.h index e53ddf4192..42760f79de 100644 --- a/components/bt/host/bluedroid/bta/dm/include/bta_dm_int.h +++ b/components/bt/host/bluedroid/bta/dm/include/bta_dm_int.h @@ -80,9 +80,6 @@ enum { BTA_DM_ACL_CHANGE_EVT, BTA_DM_API_ADD_DEVICE_EVT, -#if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE) - BTA_DM_API_REMOVE_ACL_EVT, -#endif // #if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE) #if (SMP_INCLUDED == TRUE) /* security API events */ BTA_DM_API_BOND_EVT, @@ -1215,17 +1212,6 @@ typedef struct { #endif /* BLE_INCLUDED */ -#if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE) -/* data type for BTA_DM_API_REMOVE_ACL_EVT */ -typedef struct { - BT_HDR hdr; - BD_ADDR bd_addr; - BOOLEAN remove_dev; - tBTA_TRANSPORT transport; - -} tBTA_DM_API_REMOVE_ACL; -#endif // #if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE) - typedef struct { BT_HDR hdr; BD_ADDR bd_addr; @@ -1798,10 +1784,6 @@ typedef union { tBTA_DM_API_BLE_SET_CSA_SUPPORT ble_set_csa_support; tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK ble_set_vendor_evt_mask; #endif -#if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE) - tBTA_DM_API_REMOVE_ACL remove_acl; -#endif // #if (BLE_HOST_REMOVE_AN_ACL_EN == TRUE) - #if (BLE_FEAT_ISO_EN == TRUE) #if (BLE_FEAT_ISO_BIG_BROCASTER_EN == TRUE) tBTA_DM_API_BIG_CREATE big_creat; diff --git a/components/bt/host/bluedroid/common/include/common/bt_target.h b/components/bt/host/bluedroid/common/include/common/bt_target.h index 9cbed01197..d14d0ced9f 100644 --- a/components/bt/host/bluedroid/common/include/common/bt_target.h +++ b/components/bt/host/bluedroid/common/include/common/bt_target.h @@ -1618,10 +1618,6 @@ #define BLE_INCLUDED FALSE #endif -#ifndef BLE_HOST_REMOVE_AN_ACL_EN -#define BLE_HOST_REMOVE_AN_ACL_EN FALSE -#endif - #ifndef BLE_HOST_READ_TX_POWER_EN #define BLE_HOST_READ_TX_POWER_EN FALSE #endif