Remove BLE_INCLUDED define
Test: Connect to a BLE Keyboard
Change-Id: I5f8f4017c90c3c404004632fd10e6c2b93bd7783
diff --git a/bta/dm/bta_dm_act.cc b/bta/dm/bta_dm_act.cc
index b8357c8..5e48257 100644
--- a/bta/dm/bta_dm_act.cc
+++ b/bta/dm/bta_dm_act.cc
@@ -101,7 +101,6 @@
static void bta_dm_sys_hw_cback(tBTA_SYS_HW_EVT status);
static void bta_dm_disable_search_and_disc(void);
-#if (BLE_INCLUDED == TRUE)
#if (SMP_INCLUDED == TRUE)
static uint8_t bta_dm_ble_smp_cback(tBTM_LE_EVT event, BD_ADDR bda,
tBTM_LE_EVT_DATA* p_data);
@@ -124,7 +123,6 @@
#define BTA_DM_BLE_ADV_CHNL_MAP \
(BTM_BLE_ADV_CHNL_37 | BTM_BLE_ADV_CHNL_38 | BTM_BLE_ADV_CHNL_39)
#endif
-#endif
/* Disable timer interval (in milliseconds) */
#ifndef BTA_DM_DISABLE_TIMER_MS
@@ -183,7 +181,7 @@
UUID_SERVCLASS_MESSAGE_NOTIFICATION, /* BTA_MN_SERVICE_ID */
UUID_SERVCLASS_HDP_PROFILE, /* BTA_HDP_SERVICE_ID */
UUID_SERVCLASS_PBAP_PCE /* BTA_PCE_SERVICE_ID */
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
,
UUID_PROTOCOL_ATT /* BTA_GATT_SERVICE_ID */
#endif
@@ -229,7 +227,7 @@
BTM_SEC_SERVICE_MAP, /* BTA_MN_SERVICE_ID */
BTM_SEC_SERVICE_HDP_SNK, /* BTA_HDP_SERVICE_ID */
BTM_SEC_SERVICE_PBAP /* BTA_PCE_SERVICE_ID */
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
,
BTM_SEC_SERVICE_ATT /* BTA_GATT_SERVICE_ID */
#endif
@@ -245,16 +243,12 @@
#else
NULL
#endif
-#if (BLE_INCLUDED == TRUE)
#if (SMP_INCLUDED == TRUE)
,
&bta_dm_ble_smp_cback
#endif
,
- &bta_dm_ble_id_key_cback
-#endif
-
-};
+ &bta_dm_ble_id_key_cback};
#define MAX_DISC_RAW_DATA_BUF (4096)
uint8_t g_disc_raw_data_buf[MAX_DISC_RAW_DATA_BUF];
@@ -366,11 +360,9 @@
static void bta_dm_sys_hw_cback(tBTA_SYS_HW_EVT status) {
DEV_CLASS dev_class;
tBTA_DM_SEC_CBACK* temp_cback;
-#if (BLE_INCLUDED == TRUE)
uint8_t key_mask = 0;
BT_OCTET16 er;
tBTA_BLE_LOCAL_ID_KEYS id_key;
-#endif
APPL_TRACE_DEBUG("%s with event: %i", __func__, status);
@@ -430,7 +422,6 @@
memcpy(dev_class, p_bta_dm_cfg->dev_class, sizeof(dev_class));
BTM_SetDeviceClass(dev_class);
-#if (BLE_INCLUDED == TRUE)
/* load BLE local information: ID keys, ER if available */
bta_dm_co_ble_load_local_keys(&key_mask, er, &id_key);
@@ -445,7 +436,6 @@
#if (BTA_GATT_INCLUDED == TRUE)
bta_dm_search_cb.conn_id = BTA_GATT_INVALID_CONN_ID;
#endif // (defined(BTA_GATT_INCLUDED) && BTA_GATT_INCLUDED)
-#endif // (defined(BLE_INCLUDED) && (BLE_INCLUDED == true))
BTM_SecRegister((tBTM_APPL_INFO*)&bta_security);
BTM_SetDefaultLinkSuperTout(p_bta_dm_cfg->link_timeout);
@@ -479,7 +469,7 @@
bta_sys_policy_register((tBTA_SYS_CONN_CBACK*)bta_dm_policy_cback);
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
bta_dm_gattc_register();
#endif
@@ -513,7 +503,7 @@
bta_dm_disable_search_and_disc();
bta_dm_cb.disabling = true;
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
BTM_BleClearBgConnDev();
#endif
@@ -560,9 +550,7 @@
if (BTM_GetNumAclLinks() && (param == 0)) {
for (i = 0; i < bta_dm_cb.device_list.count; i++) {
-#if (BLE_INCLUDED == TRUE)
transport = bta_dm_cb.device_list.peer_device[i].transport;
-#endif
btm_remove_acl(bta_dm_cb.device_list.peer_device[i].peer_bdaddr,
transport);
trigger_disc = true;
@@ -684,14 +672,14 @@
***
******************************************************************************/
void bta_dm_process_remove_device(BD_ADDR bd_addr) {
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
/* need to remove all pending background connection before unpair */
BTA_GATTC_CancelOpen(0, bd_addr, false);
#endif
BTM_SecDeleteDevice(bd_addr);
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
/* remove all cached GATT information */
BTA_GATTC_Refresh(bd_addr);
#endif
@@ -880,7 +868,7 @@
if (!BTM_SecDeleteDevice(p_remove_acl->bd_addr)) {
APPL_TRACE_ERROR("delete device from security database failed.");
}
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
/* need to remove all pending background connection if any */
BTA_GATTC_CancelOpen(0, p_remove_acl->bd_addr, false);
/* remove all cached GATT information */
@@ -907,9 +895,7 @@
for (uint8_t i = 0; i < bta_dm_cb.device_list.count; i++) {
BD_ADDR addr = {0};
bdcpy(addr, bta_dm_cb.device_list.peer_device[i].peer_bdaddr);
-#if (BLE_INCLUDED == TRUE)
transport = bta_dm_cb.device_list.peer_device[i].transport;
-#endif
if ((link_type == BTA_DM_LINK_TYPE_ALL) ||
((link_type == BTA_DM_LINK_TYPE_LE) &&
(transport == BT_TRANSPORT_LE)) ||
@@ -1156,7 +1142,7 @@
void bta_dm_search_start(tBTA_DM_MSG* p_data) {
tBTM_INQUIRY_CMPL result;
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
size_t len = sizeof(tBT_UUID) * p_data->search.num_uuid;
bta_dm_gattc_register();
#endif
@@ -1176,7 +1162,7 @@
bta_dm_search_cb.p_search_cback = p_data->search.p_cback;
bta_dm_search_cb.services = p_data->search.services;
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
osi_free_and_reset((void**)&bta_dm_search_cb.p_srvc_uuid);
if ((bta_dm_search_cb.num_uuid = p_data->search.num_uuid) != 0 &&
@@ -1237,7 +1223,7 @@
bta_sys_sendmsg(p_msg);
}
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
if (bta_dm_search_cb.gatt_disc_active) {
bta_dm_cancel_gatt_discovery(bta_dm_search_cb.peer_bdaddr);
}
@@ -1255,7 +1241,7 @@
*
******************************************************************************/
void bta_dm_discover(tBTA_DM_MSG* p_data) {
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
size_t len = sizeof(tBT_UUID) * p_data->discover.num_uuid;
#endif
APPL_TRACE_EVENT("%s services_to_search=0x%04X, sdp_search=%d", __func__,
@@ -1264,7 +1250,7 @@
/* save the search condition */
bta_dm_search_cb.services = p_data->discover.services;
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
bta_dm_gattc_register();
osi_free_and_reset((void**)&bta_dm_search_cb.p_srvc_uuid);
if ((bta_dm_search_cb.num_uuid = p_data->discover.num_uuid) != 0 &&
@@ -1541,7 +1527,7 @@
uint16_t service = 0xFFFF;
tSDP_PROTOCOL_ELEM pe;
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
tBT_UUID* p_uuid = bta_dm_search_cb.p_srvc_uuid;
tBTA_DM_SEARCH result;
tBT_UUID service_uuid;
@@ -1571,7 +1557,7 @@
p_sdp_rec =
SDP_FindServiceInDb(bta_dm_search_cb.p_sdp_db, service, p_sdp_rec);
}
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
/* finished with BR/EDR services, now we check the result for GATT based
* service UUID */
if (bta_dm_search_cb.service_index == BTA_MAX_SERVICE_ID) {
@@ -1627,7 +1613,7 @@
if (bta_dm_search_cb.services == BTA_ALL_SERVICE_MASK &&
bta_dm_search_cb.services_to_search == 0) {
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
if (bta_dm_search_cb.service_index == BTA_BLE_SERVICE_ID &&
bta_dm_search_cb.uuid_to_search > 0)
bta_dm_search_cb.uuid_to_search--;
@@ -1769,7 +1755,7 @@
void bta_dm_search_cmpl(tBTA_DM_MSG* p_data) {
APPL_TRACE_EVENT("%s", __func__);
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
osi_free_and_reset((void**)&bta_dm_search_cb.p_srvc_uuid);
#endif
@@ -1792,7 +1778,7 @@
void bta_dm_disc_result(tBTA_DM_MSG* p_data) {
APPL_TRACE_EVENT("%s", __func__);
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
/* if any BR/EDR service discovery has been done, report the event */
if ((bta_dm_search_cb.services &
((BTA_ALL_SERVICE_MASK | BTA_USER_SERVICE_MASK) &
@@ -1968,7 +1954,7 @@
if (!bta_dm_search_cb.name_discover_done) {
BTM_CancelRemoteDeviceName();
}
-#if (BLE_INCLUDED == TRUE) && (BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
if (bta_dm_search_cb.gatt_disc_active) {
bta_dm_cancel_gatt_discovery(bta_dm_search_cb.peer_bdaddr);
}
@@ -2009,7 +1995,7 @@
bta_dm_search_cb.services_to_search = 0;
}
} else {
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
/* for LE only profile */
if (bta_dm_search_cb.service_index == BTA_BLE_SERVICE_ID) {
if (bta_dm_search_cb.uuid_to_search > 0 &&
@@ -2068,7 +2054,7 @@
bta_dm_search_cb.service_index = BTA_MAX_SERVICE_ID;
} else {
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
if ((bta_dm_search_cb.service_index == BTA_BLE_SERVICE_ID &&
bta_dm_search_cb.uuid_to_search == 0) ||
bta_dm_search_cb.service_index != BTA_BLE_SERVICE_ID)
@@ -2139,7 +2125,6 @@
******************************************************************************/
static void bta_dm_discover_device(BD_ADDR remote_bd_addr) {
tBT_TRANSPORT transport = BT_TRANSPORT_BR_EDR;
-#if (BLE_INCLUDED == TRUE)
if (bta_dm_search_cb.transport == BTA_TRANSPORT_UNKNOWN) {
tBT_DEVICE_TYPE dev_type;
tBLE_ADDR_TYPE addr_type;
@@ -2150,7 +2135,6 @@
} else {
transport = bta_dm_search_cb.transport;
}
-#endif
/* Reset transport state for next discovery */
bta_dm_search_cb.transport = BTA_TRANSPORT_UNKNOWN;
@@ -2170,7 +2154,6 @@
APPL_TRACE_DEBUG("%s appl_knows_rem_name %d", __func__,
bta_dm_search_cb.p_btm_inq_info->appl_knows_rem_name);
}
-#if (BLE_INCLUDED == TRUE)
if ((bta_dm_search_cb.p_btm_inq_info) &&
(bta_dm_search_cb.p_btm_inq_info->results.device_type ==
BT_DEVICE_TYPE_BLE) &&
@@ -2178,7 +2161,6 @@
/* Do not perform RNR for LE devices at inquiry complete*/
bta_dm_search_cb.name_discover_done = true;
}
-#endif
/* if name discovery is not done and application needs remote name */
if ((!bta_dm_search_cb.name_discover_done) &&
((bta_dm_search_cb.p_btm_inq_info == NULL) ||
@@ -2198,7 +2180,7 @@
bta_dm_search_cb.service_index = 0;
bta_dm_search_cb.services_found = 0;
bta_dm_search_cb.services_to_search = bta_dm_search_cb.services;
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
bta_dm_search_cb.uuid_to_search = bta_dm_search_cb.num_uuid;
#endif
if ((bta_dm_search_cb.p_btm_inq_info != NULL) &&
@@ -2221,7 +2203,7 @@
else
bta_dm_search_cb.wait_disc = true;
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
if (bta_dm_search_cb.p_btm_inq_info) {
APPL_TRACE_DEBUG(
"%s p_btm_inq_info 0x%x results.device_type 0x%x "
@@ -2309,12 +2291,10 @@
(service_class & BTM_COD_SERVICE_LMTD_DISCOVER) ? true : false;
result.inq_res.rssi = p_inq->rssi;
-#if (BLE_INCLUDED == TRUE)
result.inq_res.ble_addr_type = p_inq->ble_addr_type;
result.inq_res.inq_result_type = p_inq->inq_result_type;
result.inq_res.device_type = p_inq->device_type;
result.inq_res.flag = p_inq->flag;
-#endif
/* application will parse EIR to find out remote device name */
result.inq_res.p_eir = p_eir;
@@ -2436,11 +2416,9 @@
BTM_SecDeleteRmtNameNotifyCallback(&bta_dm_service_search_remname_cback);
-#if (BLE_INCLUDED == TRUE)
if (bta_dm_search_cb.transport == BT_TRANSPORT_LE) {
GAP_BleReadPeerPrefConnParams(bta_dm_search_cb.peer_bdaddr);
}
-#endif
tBTA_DM_REM_NAME* p_msg =
(tBTA_DM_REM_NAME*)osi_malloc(sizeof(tBTA_DM_REM_NAME));
@@ -2633,11 +2611,9 @@
memcpy(p_auth_cmpl->key, key, LINK_KEY_LEN);
sec_event.auth_cmpl.fail_reason = HCI_SUCCESS;
-#if (BLE_INCLUDED == TRUE)
// Report the BR link key based on the BR/EDR address and type
BTM_ReadDevInfo(bd_addr, &sec_event.auth_cmpl.dev_type,
&sec_event.auth_cmpl.addr_type);
-#endif
if (bta_dm_cb.p_sec_cback) bta_dm_cb.p_sec_cback(event, &sec_event);
// Setting remove_dev_pending flag to false, where it will avoid deleting
@@ -2674,11 +2650,9 @@
memcpy(sec_event.auth_cmpl.bd_name, bd_name, (BD_NAME_LEN - 1));
sec_event.auth_cmpl.bd_name[BD_NAME_LEN - 1] = 0;
-#if (BLE_INCLUDED == TRUE)
// Report the BR link key based on the BR/EDR address and type
BTM_ReadDevInfo(bd_addr, &sec_event.auth_cmpl.dev_type,
&sec_event.auth_cmpl.addr_type);
-#endif
sec_event.auth_cmpl.fail_reason = (uint8_t)result;
if (bta_dm_cb.p_sec_cback)
@@ -2894,17 +2868,13 @@
case BTM_BL_CONN_EVT:
p_msg->is_new = true;
bdcpy(p_msg->bd_addr, p_data->conn.p_bda);
-#if (BLE_INCLUDED == TRUE)
p_msg->transport = p_data->conn.transport;
p_msg->handle = p_data->conn.handle;
-#endif
break;
case BTM_BL_DISCN_EVT:
bdcpy(p_msg->bd_addr, p_data->discn.p_bda);
-#if (BLE_INCLUDED == TRUE)
p_msg->transport = p_data->discn.transport;
p_msg->handle = p_data->discn.handle;
-#endif
break;
case BTM_BL_UPDATE_EVT:
p_msg->busy_level = p_data->update.busy_level;
@@ -3079,13 +3049,9 @@
if (is_new) {
for (i = 0; i < bta_dm_cb.device_list.count; i++) {
- if (!bdcmp(bta_dm_cb.device_list.peer_device[i].peer_bdaddr, p_bda)
-#if (BLE_INCLUDED == TRUE)
- &&
+ if (!bdcmp(bta_dm_cb.device_list.peer_device[i].peer_bdaddr, p_bda) &&
bta_dm_cb.device_list.peer_device[i].conn_handle ==
- p_data->acl_change.handle
-#endif
- )
+ p_data->acl_change.handle)
break;
}
@@ -3097,12 +3063,10 @@
bta_dm_cb.device_list.peer_device[bta_dm_cb.device_list.count]
.link_policy = bta_dm_cb.cur_policy;
bta_dm_cb.device_list.count++;
-#if (BLE_INCLUDED == TRUE)
bta_dm_cb.device_list.peer_device[i].conn_handle =
p_data->acl_change.handle;
if (p_data->acl_change.transport == BT_TRANSPORT_LE)
bta_dm_cb.device_list.le_count++;
-#endif
} else {
APPL_TRACE_ERROR("%s max active connection reached, no resources",
__func__);
@@ -3114,11 +3078,9 @@
bta_dm_cb.device_list.peer_device[i].pref_role = BTA_ANY_ROLE;
bdcpy(conn.link_up.bd_addr, p_bda);
bta_dm_cb.device_list.peer_device[i].info = BTA_DM_DI_NONE;
-#if (BLE_INCLUDED == TRUE)
conn.link_up.link_type = p_data->acl_change.transport;
bta_dm_cb.device_list.peer_device[i].transport =
p_data->acl_change.transport;
-#endif
if (((NULL != (p = BTM_ReadLocalFeatures())) &&
HCI_SNIFF_SUB_RATE_SUPPORTED(p)) &&
@@ -3134,13 +3096,9 @@
bta_dm_cb.p_sec_cback(BTA_DM_LINK_UP_EVT, (tBTA_DM_SEC*)&conn);
} else {
for (i = 0; i < bta_dm_cb.device_list.count; i++) {
- if (bdcmp(bta_dm_cb.device_list.peer_device[i].peer_bdaddr, p_bda)
-#if (BLE_INCLUDED == TRUE)
- ||
+ if (bdcmp(bta_dm_cb.device_list.peer_device[i].peer_bdaddr, p_bda) ||
bta_dm_cb.device_list.peer_device[i].transport !=
- p_data->acl_change.transport
-#endif
- )
+ p_data->acl_change.transport)
continue;
if (bta_dm_cb.device_list.peer_device[i].conn_state == BTA_DM_UNPAIRING) {
@@ -3163,12 +3121,10 @@
break;
}
if (bta_dm_cb.device_list.count) bta_dm_cb.device_list.count--;
-#if (BLE_INCLUDED == TRUE)
if ((p_data->acl_change.transport == BT_TRANSPORT_LE) &&
(bta_dm_cb.device_list.le_count))
bta_dm_cb.device_list.le_count--;
conn.link_down.link_type = p_data->acl_change.transport;
-#endif
if (bta_dm_search_cb.wait_disc &&
!bdcmp(bta_dm_search_cb.peer_bdaddr, p_bda)) {
@@ -3194,7 +3150,7 @@
}
if (conn.link_down.is_removed) {
BTM_SecDeleteDevice(p_bda);
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
/* need to remove all pending background connection */
BTA_GATTC_CancelOpen(0, p_bda, false);
/* remove all cached GATT information */
@@ -3369,7 +3325,7 @@
}
} else {
BTM_SecDeleteDevice(remote_bd_addr);
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
/* need to remove all pending background connection */
BTA_GATTC_CancelOpen(0, remote_bd_addr, false);
/* remove all cached GATT information */
@@ -3391,12 +3347,8 @@
static void bta_dm_adjust_roles(bool delay_role_switch) {
uint8_t i;
bool set_master_role = false;
-#if (BLE_INCLUDED == TRUE)
uint8_t br_count =
bta_dm_cb.device_list.count - bta_dm_cb.device_list.le_count;
-#else
- uint8_t br_count = bta_dm_cb.device_list.count;
-#endif
if (br_count) {
/* the configuration is no scatternet
* or AV connection exists and there are more than one ACL link */
@@ -3407,12 +3359,9 @@
}
for (i = 0; i < bta_dm_cb.device_list.count; i++) {
- if (bta_dm_cb.device_list.peer_device[i].conn_state == BTA_DM_CONNECTED
-#if (BLE_INCLUDED == TRUE)
- &&
- bta_dm_cb.device_list.peer_device[i].transport == BT_TRANSPORT_BR_EDR
-#endif
- ) {
+ if (bta_dm_cb.device_list.peer_device[i].conn_state == BTA_DM_CONNECTED &&
+ bta_dm_cb.device_list.peer_device[i].transport ==
+ BT_TRANSPORT_BR_EDR) {
if (!set_master_role &&
(bta_dm_cb.device_list.peer_device[i].pref_role != BTA_ANY_ROLE) &&
(p_bta_dm_rm_cfg[0].cfg == BTA_DM_PARTIAL_SCATTERNET)) {
@@ -3802,7 +3751,7 @@
APPL_TRACE_DEBUG(" with services_to_search=0x%08X", *p_services_to_search);
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
/* always do GATT based service discovery by SDP instead of from EIR */
/* if GATT based service is also to be put in EIR, need to modify this */
while (service_index < (BTA_MAX_SERVICE_ID - 1))
@@ -4021,7 +3970,6 @@
}
}
-#if (BLE_INCLUDED == TRUE)
/*******************************************************************************
*
* Function bta_dm_observe_results_cb
@@ -4173,10 +4121,8 @@
case BTM_LE_COMPLT_EVT:
bdcpy(sec_event.auth_cmpl.bd_addr, bda);
-#if (BLE_INCLUDED == TRUE)
BTM_ReadDevInfo(bda, &sec_event.auth_cmpl.dev_type,
&sec_event.auth_cmpl.addr_type);
-#endif
p_name = BTM_SecReadDevName(bda);
if (p_name != NULL)
strlcpy((char*)sec_event.auth_cmpl.bd_name, p_name, (BD_NAME_LEN));
@@ -5198,5 +5144,3 @@
}
}
#endif /* BLE_VND_INCLUDED */
-
-#endif /* BLE_INCLUDED */
diff --git a/bta/dm/bta_dm_api.cc b/bta/dm/bta_dm_api.cc
index 6eada78..bdb7b2f 100644
--- a/bta/dm/bta_dm_api.cc
+++ b/bta/dm/bta_dm_api.cc
@@ -270,7 +270,7 @@
p_msg->p_cback = p_cback;
p_msg->sdp_search = sdp_search;
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
p_msg->num_uuid = 0;
p_msg->p_uuid = NULL;
#endif
@@ -611,7 +611,6 @@
******************************************************************************/
void BTA_DmAddBleKey(BD_ADDR bd_addr, tBTA_LE_KEY_VALUE* p_le_key,
tBTA_LE_KEY_TYPE key_type) {
-#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_ADD_BLEKEY* p_msg =
(tBTA_DM_API_ADD_BLEKEY*)osi_calloc(sizeof(tBTA_DM_API_ADD_BLEKEY));
@@ -622,7 +621,6 @@
memcpy(&p_msg->blekey, p_le_key, sizeof(tBTA_LE_KEY_VALUE));
bta_sys_sendmsg(p_msg);
-#endif
}
/*******************************************************************************
@@ -642,7 +640,6 @@
******************************************************************************/
void BTA_DmAddBleDevice(BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type,
tBT_DEVICE_TYPE dev_type) {
-#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_ADD_BLE_DEVICE* p_msg = (tBTA_DM_API_ADD_BLE_DEVICE*)osi_calloc(
sizeof(tBTA_DM_API_ADD_BLE_DEVICE));
@@ -652,7 +649,6 @@
p_msg->dev_type = dev_type;
bta_sys_sendmsg(p_msg);
-#endif
}
/*******************************************************************************
@@ -670,7 +666,6 @@
*
******************************************************************************/
void BTA_DmBlePasskeyReply(BD_ADDR bd_addr, bool accept, uint32_t passkey) {
-#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_PASSKEY_REPLY* p_msg =
(tBTA_DM_API_PASSKEY_REPLY*)osi_calloc(sizeof(tBTA_DM_API_PASSKEY_REPLY));
@@ -681,7 +676,6 @@
if (accept) p_msg->passkey = passkey;
bta_sys_sendmsg(p_msg);
-#endif
}
/*******************************************************************************
@@ -698,7 +692,6 @@
*
******************************************************************************/
void BTA_DmBleConfirmReply(BD_ADDR bd_addr, bool accept) {
-#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_CONFIRM* p_msg =
(tBTA_DM_API_CONFIRM*)osi_calloc(sizeof(tBTA_DM_API_CONFIRM));
@@ -707,7 +700,6 @@
p_msg->accept = accept;
bta_sys_sendmsg(p_msg);
-#endif
}
/*******************************************************************************
@@ -723,7 +715,6 @@
*
******************************************************************************/
void BTA_DmBleSecurityGrant(BD_ADDR bd_addr, tBTA_DM_BLE_SEC_GRANT res) {
-#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_BLE_SEC_GRANT* p_msg =
(tBTA_DM_API_BLE_SEC_GRANT*)osi_calloc(sizeof(tBTA_DM_API_BLE_SEC_GRANT));
@@ -732,7 +723,6 @@
p_msg->res = res;
bta_sys_sendmsg(p_msg);
-#endif
}
/*******************************************************************************
@@ -757,7 +747,6 @@
void BTA_DmSetBlePrefConnParams(const BD_ADDR bd_addr, uint16_t min_conn_int,
uint16_t max_conn_int, uint16_t slave_latency,
uint16_t supervision_tout) {
-#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_BLE_CONN_PARAMS* p_msg = (tBTA_DM_API_BLE_CONN_PARAMS*)osi_calloc(
sizeof(tBTA_DM_API_BLE_CONN_PARAMS));
@@ -769,7 +758,6 @@
p_msg->supervision_tout = supervision_tout;
bta_sys_sendmsg(p_msg);
-#endif
}
/*******************************************************************************
@@ -786,7 +774,6 @@
*
******************************************************************************/
void BTA_DmSetBleConnScanParams(uint32_t scan_interval, uint32_t scan_window) {
-#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_BLE_SCAN_PARAMS* p_msg = (tBTA_DM_API_BLE_SCAN_PARAMS*)osi_calloc(
sizeof(tBTA_DM_API_BLE_SCAN_PARAMS));
@@ -795,7 +782,6 @@
p_msg->scan_window = scan_window;
bta_sys_sendmsg(p_msg);
-#endif // BLE_INCLUDED == true
}
/*******************************************************************************
@@ -815,7 +801,6 @@
*
******************************************************************************/
-#if (BLE_INCLUDED == TRUE)
void BTA_DmSetBleScanParams(
tGATT_IF client_if, uint32_t scan_interval, uint32_t scan_window,
tBLE_SCAN_MODE scan_mode,
@@ -832,7 +817,6 @@
bta_sys_sendmsg(p_msg);
}
-#endif // BLE_INCLUDED == true
/*******************************************************************************
*
@@ -849,7 +833,6 @@
******************************************************************************/
void BTA_DmSetBleAdvParams(uint16_t adv_int_min, uint16_t adv_int_max,
tBLE_BD_ADDR* p_dir_bda) {
-#if (BLE_INCLUDED == TRUE)
if (p_dir_bda != NULL) {
tBLE_BD_ADDR* bda = new tBLE_BD_ADDR;
memcpy(bda, p_dir_bda, sizeof(tBLE_BD_ADDR));
@@ -861,14 +844,12 @@
do_in_bta_thread(FROM_HERE, base::Bind(&bta_dm_ble_set_adv_params,
adv_int_min, adv_int_max, nullptr));
-#endif
}
/*******************************************************************************
* BLE ADV data management API
*******************************************************************************/
-#if (BLE_INCLUDED == TRUE)
/*******************************************************************************
*
* Function BTA_DmBleSetStorageParams
@@ -1021,8 +1002,6 @@
bta_sys_sendmsg(p_msg);
}
-#endif
-
/*******************************************************************************
* BLE ADV data management API
*******************************************************************************/
@@ -1044,7 +1023,6 @@
******************************************************************************/
void BTA_DmBleSetBgConnType(tBTA_DM_BLE_CONN_TYPE bg_conn_type,
tBTA_DM_BLE_SEL_CBACK* p_select_cback) {
-#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_BLE_SET_BG_CONN_TYPE* p_msg =
(tBTA_DM_API_BLE_SET_BG_CONN_TYPE*)osi_calloc(
sizeof(tBTA_DM_API_BLE_SET_BG_CONN_TYPE));
@@ -1054,7 +1032,6 @@
p_msg->p_select_cback = p_select_cback;
bta_sys_sendmsg(p_msg);
-#endif
}
/*******************************************************************************
@@ -1066,7 +1043,7 @@
* Returns void
*
******************************************************************************/
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
static void bta_dm_discover_send_msg(BD_ADDR bd_addr,
tBTA_SERVICE_MASK_EXT* p_services,
tBTA_DM_SEARCH_CBACK* p_cback,
@@ -1084,7 +1061,7 @@
p_msg->transport = transport;
if (p_services != NULL) {
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
p_msg->services = p_services->srvc_mask;
p_msg->num_uuid = p_services->num_uuid;
if (p_services->num_uuid != 0) {
@@ -1119,7 +1096,7 @@
tBTA_SERVICE_MASK_EXT* p_services,
tBTA_DM_SEARCH_CBACK* p_cback, bool sdp_search,
tBTA_TRANSPORT transport) {
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
bta_dm_discover_send_msg(bd_addr, p_services, p_cback, sdp_search, transport);
#endif
}
@@ -1141,7 +1118,7 @@
******************************************************************************/
void BTA_DmDiscoverExt(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT* p_services,
tBTA_DM_SEARCH_CBACK* p_cback, bool sdp_search) {
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
bta_dm_discover_send_msg(bd_addr, p_services, p_cback, sdp_search,
BTA_TRANSPORT_UNKNOWN);
#endif
@@ -1167,7 +1144,7 @@
* Returns void
*
******************************************************************************/
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
void BTA_DmSearchExt(tBTA_DM_INQ* p_dm_inq, tBTA_SERVICE_MASK_EXT* p_services,
tBTA_DM_SEARCH_CBACK* p_cback) {
const size_t len = p_services ? (sizeof(tBTA_DM_API_SEARCH) +
@@ -1221,7 +1198,6 @@
void BTA_DmBleUpdateConnectionParam(BD_ADDR bd_addr, uint16_t min_int,
uint16_t max_int, uint16_t latency,
uint16_t timeout) {
-#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_UPDATE_CONN_PARAM* p_msg =
(tBTA_DM_API_UPDATE_CONN_PARAM*)osi_calloc(
sizeof(tBTA_DM_API_UPDATE_CONN_PARAM));
@@ -1234,7 +1210,6 @@
p_msg->timeout = timeout;
bta_sys_sendmsg(p_msg);
-#endif
}
/*******************************************************************************
@@ -1249,7 +1224,7 @@
*
******************************************************************************/
void BTA_DmBleConfigLocalPrivacy(bool privacy_enable) {
-#if (BLE_INCLUDED == TRUE && BLE_PRIVACY_SPT == TRUE)
+#if (BLE_PRIVACY_SPT == TRUE)
tBTA_DM_API_LOCAL_PRIVACY* p_msg = (tBTA_DM_API_LOCAL_PRIVACY*)osi_calloc(
sizeof(tBTA_DM_API_ENABLE_PRIVACY));
@@ -1262,7 +1237,6 @@
#endif
}
-#if (BLE_INCLUDED == TRUE)
/*******************************************************************************
*
* Function BTA_DmBleCfgFilterCondition
@@ -1563,7 +1537,6 @@
bta_sys_sendmsg(p_msg);
}
-#endif
/*******************************************************************************
*
@@ -1632,7 +1605,6 @@
bta_sys_sendmsg(p_msg);
}
-#if (BLE_INCLUDED == TRUE)
/*******************************************************************************
*
* Function BTA_DmBleObserve
@@ -1688,7 +1660,7 @@
tBTM_BLE_VSC_CB cmn_ble_vsc_cb;
BTM_BleGetVendorCapabilities(&cmn_ble_vsc_cb);
-#if (BLE_INCLUDED == TRUE && BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
+#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
if (cmn_ble_vsc_cb.max_filter > 0) {
btm_ble_adv_filter_cleanup();
#if (BLE_PRIVACY_SPT == TRUE)
@@ -1702,4 +1674,3 @@
if (cmn_ble_vsc_cb.adv_inst_max > 0) btm_ble_multi_adv_cleanup();
}
-#endif
diff --git a/bta/dm/bta_dm_cfg.cc b/bta/dm/bta_dm_cfg.cc
index 37d9383..423602e 100644
--- a/bta/dm/bta_dm_cfg.cc
+++ b/bta/dm/bta_dm_cfg.cc
@@ -115,15 +115,9 @@
tBTA_DM_RM* p_bta_dm_rm_cfg = (tBTA_DM_RM*)&bta_dm_rm_cfg;
-#if (BLE_INCLUDED == TRUE)
#define BTA_DM_NUM_PM_ENTRY \
23 /* number of entries in bta_dm_pm_cfg except the first */
#define BTA_DM_NUM_PM_SPEC 15 /* number of entries in bta_dm_pm_spec */
-#else
-#define BTA_DM_NUM_PM_ENTRY \
- 21 /* number of entries in bta_dm_pm_cfg except the first */
-#define BTA_DM_NUM_PM_SPEC 13 /* number of entries in bta_dm_pm_spec */
-#endif
tBTA_DM_PM_TYPE_QUALIFIER tBTA_DM_PM_CFG
bta_dm_pm_cfg[BTA_DM_NUM_PM_ENTRY + 1] = {
@@ -151,13 +145,9 @@
{BTA_ID_HL, BTA_ALL_APP_ID, 8}, /* reuse fts spec table */
{BTA_ID_PAN, BTUI_PAN_ID_PANU, 9}, /* PANU spec table */
{BTA_ID_PAN, BTUI_PAN_ID_NAP, 10}, /* NAP spec table */
- {BTA_ID_HS, BTA_ALL_APP_ID, 11} /* HS spec table */
-#if (BLE_INCLUDED == TRUE)
- ,
- {BTA_ID_GATTC, BTA_ALL_APP_ID, 13} /* gattc spec table */
- ,
+ {BTA_ID_HS, BTA_ALL_APP_ID, 11}, /* HS spec table */
+ {BTA_ID_GATTC, BTA_ALL_APP_ID, 13}, /* gattc spec table */
{BTA_ID_GATTS, BTA_ALL_APP_ID, 14} /* gatts spec table */
-#endif
};
tBTA_DM_PM_TYPE_QUALIFIER tBTA_DM_PM_SPEC bta_dm_pm_spec[BTA_DM_NUM_PM_SPEC] = {
@@ -427,7 +417,6 @@
{BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */
}}
-#if (BLE_INCLUDED == TRUE)
/* GATTC : 13 */
,
{(BTA_DM_PM_SNIFF | BTA_DM_PM_PARK), /* allow park & sniff */
@@ -474,8 +463,6 @@
{BTA_DM_PM_NO_ACTION, 0}} /* mode change retry */
}}
-#endif
-
#ifdef BTE_SIM_APP /* For Insight builds only */
/* Entries at the end of the pm_spec table are user-defined (runtime
configurable),
diff --git a/bta/dm/bta_dm_int.h b/bta/dm/bta_dm_int.h
index 3d8b85d..48ad6f9 100644
--- a/bta/dm/bta_dm_int.h
+++ b/bta/dm/bta_dm_int.h
@@ -27,7 +27,7 @@
#include "bt_target.h"
#include "bta_sys.h"
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
#include "bta_gatt_api.h"
#endif
@@ -76,7 +76,6 @@
BTA_DM_CI_IO_REQ_EVT,
BTA_DM_CI_RMT_OOB_EVT,
-#if (BLE_INCLUDED == TRUE)
BTA_DM_API_ADD_BLEKEY_EVT,
BTA_DM_API_ADD_BLEDEVICE_EVT,
BTA_DM_API_BLE_PASSKEY_REPLY_EVT,
@@ -105,8 +104,6 @@
BTA_DM_API_BLE_TRACK_ADVERTISER_EVT,
BTA_DM_API_BLE_ENERGY_INFO_EVT,
-#endif
-
BTA_DM_API_ENABLE_TEST_MODE_EVT,
BTA_DM_API_DISABLE_TEST_MODE_EVT,
BTA_DM_API_EXECUTE_CBACK_EVT,
@@ -166,7 +163,7 @@
tBTA_SERVICE_MASK services;
tBTA_DM_SEARCH_CBACK* p_cback;
tBTA_DM_RS_RES rs_res;
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
uint8_t num_uuid;
tBT_UUID* p_uuid;
#endif
@@ -180,7 +177,7 @@
tBTA_DM_SEARCH_CBACK* p_cback;
bool sdp_search;
tBTA_TRANSPORT transport;
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
uint8_t num_uuid;
tBT_UUID* p_uuid;
#endif
@@ -281,10 +278,8 @@
uint8_t new_role;
BD_ADDR bd_addr;
uint8_t hci_status;
-#if (BLE_INCLUDED == TRUE)
uint16_t handle;
tBT_TRANSPORT transport;
-#endif
} tBTA_DM_ACL_CHANGE;
/* data type for BTA_DM_PM_BTM_STATUS_EVT */
@@ -344,7 +339,6 @@
BD_ADDR bd_addr;
} tBTA_DM_API_SET_ENCRYPTION;
-#if (BLE_INCLUDED == TRUE)
typedef struct {
BT_HDR hdr;
BD_ADDR bd_addr;
@@ -486,8 +480,6 @@
tBTA_BLE_ENERGY_INFO_CBACK* p_energy_info_cback;
} tBTA_DM_API_ENERGY_INFO;
-#endif /* BLE_INCLUDED */
-
/* data type for BTA_DM_API_REMOVE_ACL_EVT */
typedef struct {
BT_HDR hdr;
@@ -590,7 +582,6 @@
tBTA_DM_API_SET_ENCRYPTION set_encryption;
-#if (BLE_INCLUDED == TRUE)
tBTA_DM_API_ADD_BLEKEY add_ble_key;
tBTA_DM_API_ADD_BLE_DEVICE add_ble_device;
tBTA_DM_API_PASSKEY_REPLY ble_passkey_reply;
@@ -616,7 +607,6 @@
tBTA_DM_API_DISABLE_SCAN ble_disable_scan;
tBTA_DM_API_TRACK_ADVERTISER ble_track_advert;
tBTA_DM_API_ENERGY_INFO ble_energy_info;
-#endif
tBTA_DM_API_REMOVE_ACL remove_acl;
tBTA_DM_API_REMOVE_ALL_ACL remove_all_acl;
@@ -662,10 +652,8 @@
tBTA_DM_PM_ACTION pm_mode_attempted;
tBTA_DM_PM_ACTION pm_mode_failed;
bool remove_dev_pending;
-#if (BLE_INCLUDED == TRUE)
uint16_t conn_handle;
tBT_TRANSPORT transport;
-#endif
} tBTA_DM_PEER_DEVICE;
/* structure to store list of
@@ -673,9 +661,7 @@
typedef struct {
tBTA_DM_PEER_DEVICE peer_device[BTA_DM_NUM_PEER_DEVICE];
uint8_t count;
-#if (BLE_INCLUDED == TRUE)
uint8_t le_count;
-#endif
} tBTA_DM_ACTIVE_LINK;
typedef struct {
@@ -725,13 +711,11 @@
bool is_bta_dm_active;
tBTA_DM_ACTIVE_LINK device_list;
tBTA_DM_SEC_CBACK* p_sec_cback;
-#if (BLE_INCLUDED == TRUE)
tBTA_BLE_SCAN_SETUP_CBACK* p_setup_cback;
tBTA_DM_BLE_PF_CFG_CBACK* p_scan_filt_cfg_cback;
tBTA_DM_BLE_PF_STATUS_CBACK* p_scan_filt_status_cback;
tBTA_DM_BLE_PF_PARAM_CBACK* p_scan_filt_param_cback;
tBTA_BLE_ENERGY_INFO_CBACK* p_energy_info_cback;
-#endif
uint16_t state;
bool disabling;
alarm_t* disable_timer;
@@ -798,7 +782,6 @@
bool sdp_search;
bool cancel_pending; /* inquiry cancel is pending */
tBTA_TRANSPORT transport;
-#if (BLE_INCLUDED == TRUE)
tBTA_DM_SEARCH_CBACK* p_scan_cback;
#if (BTA_GATT_INCLUDED == TRUE)
tBTA_GATTC_IF client_if;
@@ -813,7 +796,6 @@
alarm_t* gatt_close_timer; /* GATT channel close delay timer */
BD_ADDR pending_close_bda; /* pending GATT channel remote device address */
#endif
-#endif
} tBTA_DM_SEARCH_CB;
@@ -939,7 +921,6 @@
extern void bta_dm_pm_timer(tBTA_DM_MSG* p_data);
extern void bta_dm_add_ampkey(tBTA_DM_MSG* p_data);
-#if (BLE_INCLUDED == TRUE)
extern void bta_dm_add_blekey(tBTA_DM_MSG* p_data);
extern void bta_dm_add_ble_device(tBTA_DM_MSG* p_data);
extern void bta_dm_ble_passkey_reply(tBTA_DM_MSG* p_data);
@@ -972,7 +953,6 @@
extern void bta_dm_ble_track_advertiser(tBTA_DM_MSG* p_data);
extern void bta_dm_ble_get_energy_info(tBTA_DM_MSG* p_data);
-#endif
extern void bta_dm_set_encryption(tBTA_DM_MSG* p_data);
extern void bta_dm_confirm(tBTA_DM_MSG* p_data);
extern void bta_dm_loc_oob(tBTA_DM_MSG* p_data);
diff --git a/bta/dm/bta_dm_main.cc b/bta/dm/bta_dm_main.cc
index ecbff69..d8810d0 100644
--- a/bta/dm/bta_dm_main.cc
+++ b/bta/dm/bta_dm_main.cc
@@ -70,7 +70,6 @@
bta_dm_ci_io_req_act, /* 21 BTA_DM_CI_IO_REQ_EVT */
bta_dm_ci_rmt_oob_act, /* 22 BTA_DM_CI_RMT_OOB_EVT */
-#if (BLE_INCLUDED == TRUE)
bta_dm_add_blekey, /* BTA_DM_API_ADD_BLEKEY_EVT */
bta_dm_add_ble_device, /* BTA_DM_API_ADD_BLEDEVICE_EVT */
bta_dm_ble_passkey_reply, /* BTA_DM_API_BLE_PASSKEY_REPLY_EVT */
@@ -96,7 +95,6 @@
bta_dm_ble_read_scan_reports, /* BTA_DM_API_BLE_READ_SCAN_REPORTS_EVT */
bta_dm_ble_track_advertiser, /* BTA_DM_API_BLE_TRACK_ADVERTISER_EVT */
bta_dm_ble_get_energy_info, /* BTA_DM_API_BLE_ENERGY_INFO_EVT */
-#endif
bta_dm_enable_test_mode, /* BTA_DM_API_ENABLE_TEST_MODE_EVT */
bta_dm_disable_test_mode, /* BTA_DM_API_DISABLE_TEST_MODE_EVT */
@@ -126,9 +124,7 @@
BTA_DM_SEARCH_CANCEL_TRANSAC_CMPL, /* 15 bta_dm_search_cancel_transac_cmpl */
BTA_DM_DISC_RMT_NAME, /* 16 bta_dm_disc_rmt_name */
BTA_DM_API_DI_DISCOVER, /* 17 bta_dm_di_disc */
-#if (BLE_INCLUDED == TRUE)
BTA_DM_CLOSE_GATT_CONN, /* 18 bta_dm_close_gatt_conn */
-#endif
BTA_DM_SEARCH_NUM_ACTIONS /* 19 */
};
@@ -153,11 +149,8 @@
bta_dm_search_cancel_transac_cmpl, /* 15 BTA_DM_SEARCH_CANCEL_TRANSAC_CMPL
*/
bta_dm_disc_rmt_name, /* 16 BTA_DM_DISC_RMT_NAME */
- bta_dm_di_disc /* 17 BTA_DM_API_DI_DISCOVER */
-#if (BLE_INCLUDED == TRUE)
- ,
+ bta_dm_di_disc, /* 17 BTA_DM_API_DI_DISCOVER */
bta_dm_close_gatt_conn
-#endif
};
#define BTA_DM_SEARCH_IGNORE BTA_DM_SEARCH_NUM_ACTIONS
@@ -188,11 +181,9 @@
/* DISCV_RES_EVT */ {BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE,
BTA_DM_SEARCH_IDLE},
/* API_DI_DISCOVER_EVT */ {BTA_DM_API_DI_DISCOVER, BTA_DM_SEARCH_IGNORE,
- BTA_DM_SEARCH_ACTIVE}
-#if (BLE_INCLUDED == TRUE)
- /* DISC_CLOSE_TOUT_EVT */,
+ BTA_DM_SEARCH_ACTIVE},
+ /* DISC_CLOSE_TOUT_EVT */
{BTA_DM_CLOSE_GATT_CONN, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IDLE}
-#endif
};
const uint8_t bta_dm_search_search_active_st_table[][BTA_DM_SEARCH_NUM_COLS] = {
@@ -215,11 +206,9 @@
/* DISCV_RES_EVT */ {BTA_DM_SEARCH_RESULT, BTA_DM_SEARCH_IGNORE,
BTA_DM_SEARCH_ACTIVE},
/* API_DI_DISCOVER_EVT */ {BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE,
- BTA_DM_SEARCH_ACTIVE}
-#if (BLE_INCLUDED == TRUE)
- /* DISC_CLOSE_TOUT_EVT */,
+ BTA_DM_SEARCH_ACTIVE},
+ /* DISC_CLOSE_TOUT_EVT */
{BTA_DM_CLOSE_GATT_CONN, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_ACTIVE}
-#endif
};
@@ -246,12 +235,9 @@
/* DISCV_RES_EVT */ {BTA_DM_SEARCH_CANCEL_TRANSAC_CMPL,
BTA_DM_SEARCH_CANCEL_CMPL, BTA_DM_SEARCH_IDLE},
/* API_DI_DISCOVER_EVT */ {BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE,
- BTA_DM_SEARCH_CANCELLING}
-#if (BLE_INCLUDED == TRUE)
- /* DISC_CLOSE_TOUT_EVT */,
+ BTA_DM_SEARCH_CANCELLING},
+ /* DISC_CLOSE_TOUT_EVT */
{BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_CANCELLING}
-#endif
-
};
const uint8_t bta_dm_search_disc_active_st_table[][BTA_DM_SEARCH_NUM_COLS] = {
@@ -275,12 +261,9 @@
/* DISCV_RES_EVT */ {BTA_DM_DISC_RESULT, BTA_DM_SEARCH_IGNORE,
BTA_DM_DISCOVER_ACTIVE},
/* API_DI_DISCOVER_EVT */ {BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE,
- BTA_DM_DISCOVER_ACTIVE}
-
-#if (BLE_INCLUDED == TRUE)
- /* DISC_CLOSE_TOUT_EVT */,
+ BTA_DM_DISCOVER_ACTIVE},
+ /* DISC_CLOSE_TOUT_EVT */
{BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE, BTA_DM_DISCOVER_ACTIVE}
-#endif
};
typedef const uint8_t (*tBTA_DM_ST_TBL)[BTA_DM_SEARCH_NUM_COLS];
diff --git a/bta/dm/bta_dm_pm.cc b/bta/dm/bta_dm_pm.cc
index 6f64bc2..a857b97 100644
--- a/bta/dm/bta_dm_pm.cc
+++ b/bta/dm/bta_dm_pm.cc
@@ -1147,7 +1147,6 @@
BTM_SetLinkPolicy(p_dev->peer_bdaddr, &policy_setting);
}
-#if (BLE_INCLUDED == TRUE)
/*******************************************************************************
*
* Function bta_dm_pm_obtain_controller_state
@@ -1169,4 +1168,3 @@
APPL_TRACE_DEBUG("bta_dm_pm_obtain_controller_state: %d", cur_state);
return cur_state;
}
-#endif
diff --git a/bta/gatt/bta_gattc_act.cc b/bta/gatt/bta_gattc_act.cc
index a2e88e2..36fad74 100644
--- a/bta/gatt/bta_gattc_act.cc
+++ b/bta/gatt/bta_gattc_act.cc
@@ -42,7 +42,7 @@
#include "bta_hh_int.h"
#endif
-#if (BTA_GATT_INCLUDED == TRUE && BLE_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
/*****************************************************************************
* Constants
@@ -760,9 +760,7 @@
void bta_gattc_set_discover_st(tBTA_GATTC_SERV* p_srcb) {
uint8_t i;
-#if (BLE_INCLUDED == TRUE)
L2CA_EnableUpdateBleConnParams(p_srcb->server_bda, false);
-#endif
for (i = 0; i < BTA_GATTC_CLCB_MAX; i++) {
if (bta_gattc_cb.clcb[i].p_srcb == p_srcb) {
bta_gattc_cb.clcb[i].status = BTA_GATT_OK;
@@ -884,10 +882,8 @@
APPL_TRACE_DEBUG("bta_gattc_disc_cmpl conn_id=%d", p_clcb->bta_conn_id);
-#if (BLE_INCLUDED == TRUE)
if (p_clcb->transport == BTA_TRANSPORT_LE)
L2CA_EnableUpdateBleConnParams(p_clcb->p_srcb->server_bda, true);
-#endif
p_clcb->p_srcb->state = BTA_GATTC_SERV_IDLE;
p_clcb->disc_active = false;
@@ -1708,4 +1704,4 @@
}
}
}
-#endif // BTA_GATT_INCLUDED == TRUE && BLE_INCLUDED == TRUE
+#endif // BTA_GATT_INCLUDED == TRUE
diff --git a/bta/gatt/bta_gattc_int.h b/bta/gatt/bta_gattc_int.h
index 53c5670..70b400d 100644
--- a/bta/gatt/bta_gattc_int.h
+++ b/bta/gatt/bta_gattc_int.h
@@ -421,10 +421,9 @@
tBTA_TRANSPORT transport, uint16_t mtu);
extern void bta_gattc_process_api_refresh(tBTA_GATTC_DATA* p_msg);
extern void bta_gattc_cfg_mtu(tBTA_GATTC_CLCB* p_clcb, tBTA_GATTC_DATA* p_data);
-#if (BLE_INCLUDED == TRUE)
extern void bta_gattc_listen(tBTA_GATTC_DATA* p_msg);
extern void bta_gattc_broadcast(tBTA_GATTC_DATA* p_msg);
-#endif
+
/* utility functions */
extern tBTA_GATTC_CLCB* bta_gattc_find_clcb_by_cif(uint8_t client_if,
BD_ADDR remote_bda,
diff --git a/bta/hh/bta_hh_int.h b/bta/hh/bta_hh_int.h
index 0edbf60..a2aa984 100644
--- a/bta/hh/bta_hh_int.h
+++ b/bta/hh/bta_hh_int.h
@@ -36,7 +36,7 @@
/* can be moved to bta_api.h */
#define BTA_HH_MAX_RPT_CHARS 8
-#if (BTA_GATT_INCLUDED == FALSE || BLE_INCLUDED == FALSE)
+#if (BTA_GATT_INCLUDED == FALSE)
#undef BTA_HH_LE_INCLUDED
#define BTA_HH_LE_INCLUDED false
#endif
diff --git a/bta/include/bta_api.h b/bta/include/bta_api.h
index f9d137f..f7845b7 100644
--- a/bta/include/bta_api.h
+++ b/bta/include/bta_api.h
@@ -28,10 +28,7 @@
#include "bt_target.h"
#include "bt_types.h"
#include "btm_api.h"
-
-#if (BLE_INCLUDED == TRUE)
#include "btm_ble_api.h"
-#endif
#ifdef __cplusplus
extern "C" {
@@ -92,7 +89,7 @@
#define BTA_HDP_SERVICE_ID 27 /* Health Device Profile */
#define BTA_PCE_SERVICE_ID 28 /* PhoneBook Access Client*/
#define BTA_SDP_SERVICE_ID 29 /* SDP Search*/
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
/* BLE profile service ID */
#define BTA_BLE_SERVICE_ID 30 /* GATT profile */
@@ -141,14 +138,14 @@
#define BTA_HL_SERVICE_MASK 0x08000000 /* Health Device Profile */
#define BTA_PCE_SERVICE_MASK 0x10000000 /* Phone Book Client */
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
#define BTA_BLE_SERVICE_MASK 0x20000000 /* GATT based service */
#define BTA_USER_SERVICE_MASK 0x40000000 /* Message Notification Profile */
#else
#define BTA_USER_SERVICE_MASK 0x20000000 /* Message Notification Profile */
#endif
-#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+#if (BTA_GATT_INCLUDED == TRUE)
#define BTA_ALL_SERVICE_MASK 0x3FFFFFFF /* All services supported by BTA. */
#else
#define BTA_ALL_SERVICE_MASK 0x1FFFFFFF /* All services supported by BTA. */
@@ -198,14 +195,12 @@
#define BTA_DM_GENERAL_DISC \
BTM_GENERAL_DISCOVERABLE /* General discoverable. \
*/
-#if (BLE_INCLUDED == TRUE)
#define BTA_DM_BLE_NON_DISCOVERABLE \
BTM_BLE_NON_DISCOVERABLE /* Device is not LE discoverable */
#define BTA_DM_BLE_GENERAL_DISCOVERABLE \
BTM_BLE_GENERAL_DISCOVERABLE /* Device is LE General discoverable */
#define BTA_DM_BLE_LIMITED_DISCOVERABLE \
BTM_BLE_LIMITED_DISCOVERABLE /* Device is LE Limited discoverable */
-#endif
typedef uint16_t
tBTA_DM_DISC; /* this discoverability mode is a bit mask among BR mode and
LE mode */
@@ -213,12 +208,10 @@
/* Connectable Modes */
#define BTA_DM_NON_CONN BTM_NON_CONNECTABLE /* Device is not connectable. */
#define BTA_DM_CONN BTM_CONNECTABLE /* Device is connectable. */
-#if (BLE_INCLUDED == TRUE)
#define BTA_DM_BLE_NON_CONNECTABLE \
BTM_BLE_NON_CONNECTABLE /* Device is LE non-connectable. */
#define BTA_DM_BLE_CONNECTABLE \
BTM_BLE_CONNECTABLE /* Device is LE connectable. */
-#endif
typedef uint16_t tBTA_DM_CONN;
@@ -242,13 +235,11 @@
#define BTA_DM_LIMITED_INQUIRY \
BTM_LIMITED_INQUIRY /* Perform limited inquiry. */
-#if (BLE_INCLUDED == TRUE)
#define BTA_BLE_INQUIRY_NONE BTM_BLE_INQUIRY_NONE
#define BTA_BLE_GENERAL_INQUIRY \
BTM_BLE_GENERAL_INQUIRY /* Perform LE general inquiry. */
#define BTA_BLE_LIMITED_INQUIRY \
BTM_BLE_LIMITED_INQUIRY /* Perform LE limited inquiry. */
-#endif
typedef uint8_t tBTA_DM_INQ_MODE;
/* Inquiry Filter Type */
@@ -339,8 +330,6 @@
uint8_t* bta_dm_eir_additional; /* additional data */
} tBTA_DM_EIR_CONF;
-#if (BLE_INCLUDED == TRUE)
-
/* advertising filter policy */
typedef tBTM_BLE_AFP tBTA_BLE_AFP;
@@ -368,7 +357,6 @@
typedef tBTM_BLE_BATCH_SCAN_EVT tBTA_BLE_BATCH_SCAN_EVT;
typedef tBTM_BLE_TRACK_ADV_ACTION tBTA_BLE_TRACK_ADV_ACTION;
-#endif
/* BLE customer specific feature function type definitions */
/* data type used on customer specific feature for RSSI monitoring */
@@ -667,9 +655,7 @@
/* Structure associated with BTA_DM_LINK_UP_EVT */
typedef struct {
BD_ADDR bd_addr; /* BD address peer device. */
-#if (BLE_INCLUDED == TRUE)
tBTA_TRANSPORT link_type;
-#endif
} tBTA_DM_LINK_UP;
/* Structure associated with BTA_DM_LINK_DOWN_EVT */
@@ -677,9 +663,7 @@
BD_ADDR bd_addr; /* BD address peer device. */
uint8_t status; /* connection open/closed */
bool is_removed; /* true if device is removed when link is down */
-#if (BLE_INCLUDED == TRUE)
tBTA_TRANSPORT link_type;
-#endif
} tBTA_DM_LINK_DOWN;
/* Structure associated with BTA_DM_ROLE_CHG_EVT */
@@ -699,7 +683,7 @@
#define BTA_IO_CAP_IO BTM_IO_CAP_IO /* 1 DisplayYesNo */
#define BTA_IO_CAP_IN BTM_IO_CAP_IN /* 2 KeyboardOnly */
#define BTA_IO_CAP_NONE BTM_IO_CAP_NONE /* 3 NoInputNoOutput */
-#if (BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE)
+#if (SMP_INCLUDED == TRUE)
#define BTA_IO_CAP_KBDISP BTM_IO_CAP_KBDISP /* 4 Keyboard display */
#endif
typedef tBTM_IO_CAP tBTA_IO_CAP;
@@ -925,14 +909,11 @@
bool is_limited; /* true, if the limited inquiry bit is set in the CoD */
int8_t rssi; /* The rssi value */
uint8_t* p_eir; /* received EIR */
-#if (BLE_INCLUDED == TRUE)
uint8_t inq_result_type;
uint8_t ble_addr_type;
tBTM_BLE_EVT_TYPE ble_evt_type;
tBT_DEVICE_TYPE device_type;
uint8_t flag;
-#endif
-
} tBTA_DM_INQ_RES;
/* Structure associated with BTA_DM_INQ_CMPL_EVT */
@@ -995,7 +976,6 @@
#define BTA_DM_BLE_SEC_MITM BTM_BLE_SEC_ENCRYPT_MITM
typedef tBTM_BLE_SEC_ACT tBTA_DM_BLE_SEC_ACT;
-#if (BLE_INCLUDED == TRUE)
typedef tBTM_BLE_TX_TIME_MS tBTA_DM_BLE_TX_TIME_MS;
typedef tBTM_BLE_RX_TIME_MS tBTA_DM_BLE_RX_TIME_MS;
typedef tBTM_BLE_IDLE_TIME_MS tBTA_DM_BLE_IDLE_TIME_MS;
@@ -1043,10 +1023,6 @@
tBTA_DM_CONTRL_STATE ctrl_state,
tBTA_STATUS status);
-#else
-typedef uint8_t tBTA_DM_BLE_SEC_ACT;
-#endif
-
/* Maximum service name length */
#define BTA_SERVICE_NAME_LEN 35
#define BTA_SERVICE_DESP_LEN BTA_SERVICE_NAME_LEN
@@ -1629,7 +1605,6 @@
extern int32_t BTA_DmPcmResample(void* p_src, uint32_t in_bytes, void* p_dst);
#endif
-#if (BLE_INCLUDED == TRUE)
/* BLE related API functions */
/*******************************************************************************
*
@@ -1920,9 +1895,6 @@
extern void BTA_DmBleObserve(bool start, uint8_t duration,
tBTA_DM_SEARCH_CBACK* p_results_cb);
-#endif
-
-#if (BLE_INCLUDED == TRUE)
/*******************************************************************************
*
* Function BTA_DmBleConfigLocalPrivacy
@@ -2182,8 +2154,6 @@
******************************************************************************/
extern void BTA_VendorCleanup(void);
-#endif
-
#ifdef __cplusplus
}
#endif
diff --git a/bta/include/bta_gatt_api.h b/bta/include/bta_gatt_api.h
index 6df3f82..3eab85e 100644
--- a/bta/include/bta_gatt_api.h
+++ b/bta/include/bta_gatt_api.h
@@ -39,11 +39,6 @@
#define BTA_GATT_INCLUDED false
#endif
-#if (BLE_INCLUDED == FALSE && BTA_GATT_INCLUDED == TRUE)
-#undef BTA_GATT_INCLUDED
-#define BTA_GATT_INCLUDED false
-#endif
-
#ifndef BTA_GATT_DEBUG
#define BTA_GATT_DEBUG false
#endif
diff --git a/bta/include/bta_hh_co.h b/bta/include/bta_hh_co.h
index ac52696..946acf6 100644
--- a/bta/include/bta_hh_co.h
+++ b/bta/include/bta_hh_co.h
@@ -81,7 +81,7 @@
******************************************************************************/
extern void bta_hh_co_close(uint8_t dev_handle, uint8_t app_id);
-#if (BLE_INCLUDED == TRUE && BTA_HH_LE_INCLUDED == TRUE)
+#if (BTA_HH_LE_INCLUDED == TRUE)
/*******************************************************************************
*
* Function bta_hh_le_co_rpt_info
@@ -135,7 +135,7 @@
******************************************************************************/
extern void bta_hh_le_co_reset_rpt_cache(BD_ADDR remote_bda, uint8_t app_id);
-#endif /* #if (BLE_INCLUDED == true && BTA_HH_LE_INCLUDED == TRUE) */
+#endif /* #if (BTA_HH_LE_INCLUDED == TRUE) */
#ifdef __cplusplus
}