static void bta_dm_inq_cmpl_cb (void *p_result);
static void bta_dm_service_search_remname_cback (BD_ADDR bd_addr, DEV_CLASS dc, BD_NAME bd_name);
static void bta_dm_remname_cback (tBTM_REMOTE_DEV_NAME *p_remote_name);
+#if (SDP_INCLUDED == TRUE)
static void bta_dm_find_services ( BD_ADDR bd_addr);
+#endif ///SDP_INCLUDED == TRUE
static void bta_dm_discover_next_device(void);
#if (SDP_INCLUDED == TRUE)
static void bta_dm_sdp_callback (UINT16 sdp_status);
#endif /* (BTM_LOCAL_IO_CAPS != BTM_IO_CAP_NONE) */
static void bta_dm_set_eir (char *local_name);
-
+#if (SDP_INCLUDED == TRUE)
static void bta_dm_eir_search_services( tBTM_INQ_RESULTS *p_result,
tBTA_SERVICE_MASK *p_services_to_search,
tBTA_SERVICE_MASK *p_services_found);
-
+#endif ///SDP_INCLUDED == TRUE
static void bta_dm_search_timer_cback (TIMER_LIST_ENT *p_tle);
static void bta_dm_disable_conn_down_timer_cback (TIMER_LIST_ENT *p_tle);
static void bta_dm_rm_cback(tBTA_SYS_CONN_STATUS status, UINT8 id, UINT8 app_id, BD_ADDR peer_addr);
static char *bta_dm_get_remname(void);
#endif ///SDP_INCLUDED == TRUE || SMP_INCLUDED == TRUE
static void bta_dm_bond_cancel_complete_cback(tBTM_STATUS result);
-
+#if (SDP_INCLUDED == TRUE)
static BOOLEAN bta_dm_read_remote_device_name (BD_ADDR bd_addr, tBT_TRANSPORT transport);
static void bta_dm_discover_device(BD_ADDR remote_bd_addr);
-
+#endif ///SDP_INCLUDED == TRUE
static void bta_dm_sys_hw_cback( tBTA_SYS_HW_EVT status );
static void bta_dm_disable_search_and_disc(void);
** Returns void
**
*******************************************************************************/
+#if (SDP_INCLUDED == TRUE)
void bta_dm_discover (tBTA_DM_MSG *p_data)
{
-#if (SDP_INCLUDED == TRUE)
#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
UINT16 len = (UINT16)(sizeof(tBT_UUID) * p_data->discover.num_uuid);
#endif
bta_dm_search_cb.name_discover_done = FALSE;
memcpy(&bta_dm_search_cb.uuid, &p_data->discover.uuid, sizeof(tSDP_UUID));
bta_dm_discover_device(p_data->discover.bd_addr);
-#endif ///SDP_INCLUDED == TRUE
}
/*******************************************************************************
*******************************************************************************/
void bta_dm_di_disc_cmpl(tBTA_DM_MSG *p_data)
{
-#if (SDP_INCLUDED == TRUE)
tBTA_DM_DI_DISC_CMPL di_disc;
memset(&di_disc, 0, sizeof(tBTA_DM_DI_DISC_CMPL));
bta_dm_di_cb.p_di_db = NULL;
bta_dm_search_cb.p_search_cback(BTA_DM_DI_DISC_CMPL_EVT, (tBTA_DM_SEARCH *) &di_disc);
-#endif ///SDP_INCLUDED == TRUE
}
-#if (SDP_INCLUDED == TRUE)
/*******************************************************************************
**
** Function bta_dm_di_disc_callback
** Returns void
**
*******************************************************************************/
+#if (SDP_INCLUDED == TRUE)
void bta_dm_di_disc (tBTA_DM_MSG *p_data)
{
-#if (SDP_INCLUDED == TRUE)
UINT16 result = BTA_FAILURE;
tBTA_DM_MSG *p_msg;
p_data->hdr.offset = result;
bta_sys_sendmsg(p_msg);
}
-#endif ///SDP_INCLUDED == TRUE
}
+#endif ///SDP_INCLUDED == TRUE
/*******************************************************************************
**
** Returns TRUE if started to get remote name
**
*******************************************************************************/
+#if (SDP_INCLUDED == TRUE)
static BOOLEAN bta_dm_read_remote_device_name (BD_ADDR bd_addr, tBT_TRANSPORT transport)
{
tBTM_STATUS btm_status;
return (FALSE);
}
}
+#endif ///SDP_INCLUDED == TRUE
/*******************************************************************************
**
/* start name and service discovery from the first device on inquiry result */
bta_dm_search_cb.name_discover_done = FALSE;
bta_dm_search_cb.peer_name[0] = 0;
+#if (SDP_INCLUDED == TRUE)
bta_dm_discover_device(bta_dm_search_cb.p_btm_inq_info->results.remote_bd_addr);
+#endif ///SDP_INCLUDED == TRUE
} else {
/* no devices, search complete */
bta_dm_search_cb.services = 0;
if ( p_data->rem_name.result.disc_res.bd_name[0] && bta_dm_search_cb.p_btm_inq_info) {
bta_dm_search_cb.p_btm_inq_info->appl_knows_rem_name = TRUE;
}
-
+#if (SDP_INCLUDED == TRUE)
bta_dm_discover_device(bta_dm_search_cb.peer_bdaddr);
+#endif ///SDP_INCLUDED == TRUE
}
/*******************************************************************************
p_btm_inq_info->appl_knows_rem_name = TRUE;
}
}
-
+#if (SDP_INCLUDED == TRUE)
bta_dm_discover_device(p_data->rem_name.result.disc_res.bd_addr);
+#endif ///SDP_INCLUDED == TRUE
}
/*******************************************************************************
** Returns void
**
*******************************************************************************/
+#if (SDP_INCLUDED == TRUE)
void bta_dm_sdp_result (tBTA_DM_MSG *p_data)
{
-#if (SDP_INCLUDED == TRUE)
tSDP_DISC_REC *p_sdp_rec = NULL;
tBTA_DM_MSG *p_msg;
BOOLEAN scn_found = FALSE;
bta_sys_sendmsg(p_msg);
}
}
-#endif ///SDP_INCLUDE == TRUE
}
+#endif ///SDP_INCLUDE == TRUE
/*******************************************************************************
**
#endif
if (p_data->hdr.layer_specific == BTA_DM_API_DI_DISCOVER_EVT) {
+ #if (SDP_INCLUDED == TRUE)
bta_dm_di_disc_cmpl(p_data);
+ #endif ///SDP_INCLUDED == TRUE
} else {
bta_dm_search_cb.p_search_cback(BTA_DM_DISC_CMPL_EVT, NULL);
}
** Returns void
**
*******************************************************************************/
+#if (SDP_INCLUDED == TRUE)
void bta_dm_queue_disc (tBTA_DM_MSG *p_data)
{
-#if (SDP_INCLUDED == TRUE)
if (bta_dm_search_cb.p_search_queue) {
GKI_freebuf(bta_dm_search_cb.p_search_queue);
}
bta_dm_search_cb.p_search_queue = (tBTA_DM_MSG *)GKI_getbuf(sizeof(tBTA_DM_API_DISCOVER));
memcpy(bta_dm_search_cb.p_search_queue, p_data, sizeof(tBTA_DM_API_DISCOVER));
-#endif ///SDP_INCLUDED == TRUE
}
+#endif ///SDP_INCLUDED == TRUE
/*******************************************************************************
**
** Returns void
**
*******************************************************************************/
+#if (SDP_INCLUDED == TRUE)
void bta_dm_search_cancel_transac_cmpl(tBTA_DM_MSG *p_data)
{
-#if (SDP_INCLUDED == TRUE)
UNUSED(p_data);
if (bta_dm_search_cb.p_sdp_db) {
GKI_freebuf(bta_dm_search_cb.p_sdp_db);
}
bta_dm_search_cancel_notify(NULL);
-#endif ///SDP_INCLUDED == TRUE
}
+#endif ///SDP_INCLUDED == TRUE
/*******************************************************************************
** Returns void
**
*******************************************************************************/
+#if (SDP_INCLUDED == TRUE)
static void bta_dm_find_services ( BD_ADDR bd_addr)
{
-#if (SDP_INCLUDED == TRUE)
tSDP_UUID uuid;
tBTA_DM_MSG *p_msg;
bta_sys_sendmsg(p_msg);
}
}
-#endif ///SDP_INCLUDED == TRUE
}
+#endif ///SDP_INCLUDED == TRUE
/*******************************************************************************
**
if ((bta_dm_search_cb.p_btm_inq_info = BTM_InqDbNext(bta_dm_search_cb.p_btm_inq_info)) != NULL) {
bta_dm_search_cb.name_discover_done = FALSE;
bta_dm_search_cb.peer_name[0] = 0;
+#if (SDP_INCLUDED == TRUE)
bta_dm_discover_device(bta_dm_search_cb.p_btm_inq_info->results.remote_bd_addr);
+#endif ///SDP_INCLUDED == TRUE
} else {
/* no devices, search complete */
bta_dm_search_cb.services = 0;
** Returns void
**
*******************************************************************************/
+#if (SDP_INCLUDED == TRUE)
static void bta_dm_discover_device(BD_ADDR remote_bd_addr)
{
tBTA_DM_MSG *p_msg;
}
}
-#if (SDP_INCLUDED == TRUE)
/*******************************************************************************
**
** Function bta_dm_sdp_callback
** Returns None
**
*******************************************************************************/
+#if (SDP_INCLUDED == TRUE)
static void bta_dm_eir_search_services( tBTM_INQ_RESULTS *p_result,
tBTA_SERVICE_MASK *p_services_to_search,
tBTA_SERVICE_MASK *p_services_found)
APPL_TRACE_ERROR("BTA EIR search result, services_to_search=0x%08X, services_found=0x%08X",
*p_services_to_search, *p_services_found);
}
+#endif ///SDP_INCLUDED == TRUE
#if (BTA_EIR_CANNED_UUID_LIST != TRUE)
/*******************************************************************************
static UINT8 bta_dm_ble_smp_cback (tBTM_LE_EVT event, BD_ADDR bda, tBTM_LE_EVT_DATA *p_data)
{
tBTM_STATUS status = BTM_SUCCESS;
-#if (SMP_INCLUDED == TRUE)
tBTA_DM_SEC sec_event;
char *p_name = NULL;
status = BTM_NOT_AUTHORIZED;
break;
}
-#endif ///SMP_INCLUDED == TRUE
return status;
}
#endif /* SMP_INCLUDED == TRUE */
** Returns void
**
*******************************************************************************/
+#if (SDP_INCLUDED == TRUE)
void BTA_DmDiscover(BD_ADDR bd_addr, tBTA_SERVICE_MASK services,
tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search)
{
-#if (SDP_INCLUDED == TRUE)
tBTA_DM_API_DISCOVER *p_msg;
if ((p_msg = (tBTA_DM_API_DISCOVER *) GKI_getbuf(sizeof(tBTA_DM_API_DISCOVER))) != NULL) {
p_msg->sdp_search = sdp_search;
bta_sys_sendmsg(p_msg);
}
-#endif ///SDP_INCLUDED == TRUE
}
-#if (SDP_INCLUDED == TRUE)
-
/*******************************************************************************
**
** Function BTA_DmDiscoverUUID
extern void bta_dm_search_start (tBTA_DM_MSG *p_data);
extern void bta_dm_search_cancel (tBTA_DM_MSG *p_data);
extern void bta_dm_discover (tBTA_DM_MSG *p_data);
+#if (SDP_INCLUDED == TRUE)
extern void bta_dm_di_disc (tBTA_DM_MSG *p_data);
+#endif ///SDP_INCLUDED == TRUE
extern void bta_dm_inq_cmpl (tBTA_DM_MSG *p_data);
extern void bta_dm_rmt_name (tBTA_DM_MSG *p_data);
+#if (SDP_INCLUDED == TRUE)
extern void bta_dm_sdp_result (tBTA_DM_MSG *p_data);
+#endif ///SDP_INCLUDED == TRUE
extern void bta_dm_search_cmpl (tBTA_DM_MSG *p_data);
extern void bta_dm_free_sdp_db (tBTA_DM_MSG *p_data);
extern void bta_dm_disc_result (tBTA_DM_MSG *p_data);
enum {
BTA_DM_API_SEARCH, /* 0 bta_dm_search_start */
BTA_DM_API_SEARCH_CANCEL, /* 1 bta_dm_search_cancel */
+#if (SDP_INCLUDED == TRUE)
BTA_DM_API_DISCOVER, /* 2 bta_dm_discover */
+#endif ///SDP_INCLUDED == TRUE
BTA_DM_INQUIRY_CMPL, /* 3 bta_dm_inq_cmpl */
BTA_DM_REMT_NAME, /* 4 bta_dm_rmt_name */
+#if (SDP_INCLUDED == TRUE)
BTA_DM_SDP_RESULT, /* 5 bta_dm_sdp_result */
+#endif ///SDP_INCLUDED == TRUE
BTA_DM_SEARCH_CMPL, /* 6 bta_dm_search_cmpl*/
BTA_DM_FREE_SDP_DB, /* 7 bta_dm_free_sdp_db */
BTA_DM_DISC_RESULT, /* 8 bta_dm_disc_result */
BTA_DM_SEARCH_RESULT, /* 9 bta_dm_search_result */
BTA_DM_QUEUE_SEARCH, /* 10 bta_dm_queue_search */
+#if (SDP_INCLUDED == TRUE)
BTA_DM_QUEUE_DISC, /* 11 bta_dm_queue_disc */
+#endif ///SDP_INCLUDED == TRUE
BTA_DM_SEARCH_CLEAR_QUEUE, /* 12 bta_dm_search_clear_queue */
BTA_DM_SEARCH_CANCEL_CMPL, /* 13 bta_dm_search_cancel_cmpl */
BTA_DM_SEARCH_CANCEL_NOTIFY, /* 14 bta_dm_search_cancel_notify */
+#if (SDP_INCLUDED == TRUE)
BTA_DM_SEARCH_CANCEL_TRANSAC_CMPL, /* 15 bta_dm_search_cancel_transac_cmpl */
+#endif ///SDP_INCLUDED == TRUE
BTA_DM_DISC_RMT_NAME, /* 16 bta_dm_disc_rmt_name */
+#if (SDP_INCLUDED == TRUE)
BTA_DM_API_DI_DISCOVER, /* 17 bta_dm_di_disc */
+#endif ///SDP_INCLUDED == TRUE
#if BLE_INCLUDED == TRUE
BTA_DM_CLOSE_GATT_CONN, /* 18 bta_dm_close_gatt_conn */
#endif
bta_dm_search_start, /* 0 BTA_DM_API_SEARCH */
bta_dm_search_cancel, /* 1 BTA_DM_API_SEARCH_CANCEL */
+#if (SDP_INCLUDED == TRUE)
bta_dm_discover, /* 2 BTA_DM_API_DISCOVER */
+#endif ///SDP_INCLUDED == TRUE
bta_dm_inq_cmpl, /* 3 BTA_DM_INQUIRY_CMPL */
bta_dm_rmt_name, /* 4 BTA_DM_REMT_NAME */
+#if (SDP_INCLUDED == TRUE)
bta_dm_sdp_result, /* 5 BTA_DM_SDP_RESULT */
+#endif ///SDP_INCLUDED == TRUE
bta_dm_search_cmpl, /* 6 BTA_DM_SEARCH_CMPL */
bta_dm_free_sdp_db, /* 7 BTA_DM_FREE_SDP_DB */
bta_dm_disc_result, /* 8 BTA_DM_DISC_RESULT */
bta_dm_search_result, /* 9 BTA_DM_SEARCH_RESULT */
bta_dm_queue_search, /* 10 BTA_DM_QUEUE_SEARCH */
+#if (SDP_INCLUDED == TRUE)
bta_dm_queue_disc, /* 11 BTA_DM_QUEUE_DISC */
+#endif ///SDP_INCLUDED == TRUE
bta_dm_search_clear_queue, /* 12 BTA_DM_SEARCH_CLEAR_QUEUE */
bta_dm_search_cancel_cmpl, /* 13 BTA_DM_SEARCH_CANCEL_CMPL */
bta_dm_search_cancel_notify, /* 14 BTA_DM_SEARCH_CANCEL_NOTIFY */
+#if (SDP_INCLUDED == TRUE)
bta_dm_search_cancel_transac_cmpl, /* 15 BTA_DM_SEARCH_CANCEL_TRANSAC_CMPL */
+#endif ///SDP_INCLUDED == TRUE
bta_dm_disc_rmt_name, /* 16 BTA_DM_DISC_RMT_NAME */
+#if (SDP_INCLUDED == TRUE)
bta_dm_di_disc /* 17 BTA_DM_API_DI_DISCOVER */
+#endif ///SDP_INCLUDED == TRUE
#if BLE_INCLUDED == TRUE && SDP_INCLUDED == TRUE
, bta_dm_close_gatt_conn
#endif
/* Event Action 1 Action 2 Next State */
/* API_SEARCH */ {BTA_DM_API_SEARCH, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_ACTIVE},
/* API_SEARCH_CANCEL */ {BTA_DM_SEARCH_CANCEL_NOTIFY, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IDLE},
+#if (SDP_INCLUDED == TRUE)
/* API_SEARCH_DISC */ {BTA_DM_API_DISCOVER, BTA_DM_SEARCH_IGNORE, BTA_DM_DISCOVER_ACTIVE},
+#endif ///SDP_INCLUDED == TRUE
/* INQUIRY_CMPL */ {BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IDLE},
/* REMT_NAME_EVT */ {BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IDLE},
/* SDP_RESULT_EVT */ {BTA_DM_FREE_SDP_DB, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IDLE},
/* SEARCH_CMPL_EVT */ {BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IDLE},
/* 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 (SDP_INCLUDED == TRUE)
+ /* API_DI_DISCOVER_EVT */ {BTA_DM_API_DI_DISCOVER, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_ACTIVE},
+#endif ///SDP_INCLUDED == TRUE
#if BLE_INCLUDED == TRUE
- /* DISC_CLOSE_TOUT_EVT */ , {BTA_DM_CLOSE_GATT_CONN, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IDLE}
+ /* DISC_CLOSE_TOUT_EVT */ {BTA_DM_CLOSE_GATT_CONN, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IDLE},
#endif
};
const UINT8 bta_dm_search_search_active_st_table[][BTA_DM_SEARCH_NUM_COLS] = {
/* API_SEARCH_DISC */ {BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_ACTIVE},
/* INQUIRY_CMPL */ {BTA_DM_INQUIRY_CMPL, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_ACTIVE},
/* REMT_NAME_EVT */ {BTA_DM_REMT_NAME, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_ACTIVE},
+#if (SDP_INCLUDED == TRUE)
/* SDP_RESULT_EVT */ {BTA_DM_SDP_RESULT, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_ACTIVE},
+#endif ///SDP_INCLUDED == TRUE
/* SEARCH_CMPL_EVT */ {BTA_DM_SEARCH_CMPL, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IDLE},
/* 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}
/* Event Action 1 Action 2 Next State */
/* API_SEARCH */ {BTA_DM_QUEUE_SEARCH, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_CANCELLING},
/* API_SEARCH_CANCEL */ {BTA_DM_SEARCH_CLEAR_QUEUE, BTA_DM_SEARCH_CANCEL_NOTIFY, BTA_DM_SEARCH_CANCELLING},
+#if (SDP_INCLUDED == TRUE)
/* API_SEARCH_DISC */ {BTA_DM_QUEUE_DISC, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_CANCELLING},
+#endif ///SDP_INCLUDED == TRUE
/* INQUIRY_CMPL */ {BTA_DM_SEARCH_CANCEL_CMPL, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IDLE},
+#if (SDP_INCLUDED == TRUE)
/* REMT_NAME_EVT */ {BTA_DM_SEARCH_CANCEL_TRANSAC_CMPL, BTA_DM_SEARCH_CANCEL_CMPL, BTA_DM_SEARCH_IDLE},
/* SDP_RESULT_EVT */ {BTA_DM_SEARCH_CANCEL_TRANSAC_CMPL, BTA_DM_SEARCH_CANCEL_CMPL, BTA_DM_SEARCH_IDLE},
/* SEARCH_CMPL_EVT */ {BTA_DM_SEARCH_CANCEL_TRANSAC_CMPL, BTA_DM_SEARCH_CANCEL_CMPL, BTA_DM_SEARCH_IDLE},
/* DISCV_RES_EVT */ {BTA_DM_SEARCH_CANCEL_TRANSAC_CMPL, BTA_DM_SEARCH_CANCEL_CMPL, BTA_DM_SEARCH_IDLE},
+#endif ///SDP_INCLUDED == TRUE
/* 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_IGNORE, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_CANCELLING}
/* API_SEARCH_DISC */ {BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE, BTA_DM_DISCOVER_ACTIVE},
/* INQUIRY_CMPL */ {BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IGNORE, BTA_DM_DISCOVER_ACTIVE},
/* REMT_NAME_EVT */ {BTA_DM_DISC_RMT_NAME, BTA_DM_SEARCH_IGNORE, BTA_DM_DISCOVER_ACTIVE},
+#if (SDP_INCLUDED == TRUE)
/* SDP_RESULT_EVT */ {BTA_DM_SDP_RESULT, BTA_DM_SEARCH_IGNORE, BTA_DM_DISCOVER_ACTIVE},
+#endif ///SDP_INCLUDED == TRUE
/* SEARCH_CMPL_EVT */ {BTA_DM_SEARCH_CMPL, BTA_DM_SEARCH_IGNORE, BTA_DM_SEARCH_IDLE},
/* 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}
// #include "osi/include/log.h"
static void bta_gattc_char_dscpt_disc_cmpl(UINT16 conn_id, tBTA_GATTC_SERV *p_srvc_cb);
+#if (SDP_INCLUDED == TRUE)
static tBTA_GATT_STATUS bta_gattc_sdp_service_disc(UINT16 conn_id, tBTA_GATTC_SERV *p_server_cb);
-
#define BTA_GATT_SDP_DB_SIZE 4096
+#endif ///SDP_INCLUDED == TRUE
/*****************************************************************************
** Constants
if (p_clcb->transport == BTA_TRANSPORT_LE) {
status = bta_gattc_discover_procedure(conn_id, p_server_cb, disc_type);
} else {
+ #if (SDP_INCLUDED == TRUE)
status = bta_gattc_sdp_service_disc(conn_id, p_server_cb);
+ #endif ///SDP_INCLUDED == TRUE
}
}
** Returns void
**
*******************************************************************************/
+#if (SDP_INCLUDED == TRUE)
void bta_gattc_sdp_callback (UINT16 sdp_status)
{
-#if (SDP_INCLUDED == TRUE)
tSDP_DISC_REC *p_sdp_rec = NULL;
tBT_UUID service_uuid;
tSDP_PROTOCOL_ELEM pe;
GKI_freebuf(bta_gattc_cb.p_sdp_db);
bta_gattc_cb.p_sdp_db = NULL;
bta_gattc_cb.sdp_conn_id = 0;
-#endif ///SDP_INCLUDED == TRUE
}
+#endif ///SDP_INCLUDED == TRUE
+
/*******************************************************************************
**
** Function bta_gattc_sdp_service_disc
** Returns void
**
*******************************************************************************/
+#if (SDP_INCLUDED == TRUE)
static tBTA_GATT_STATUS bta_gattc_sdp_service_disc(UINT16 conn_id, tBTA_GATTC_SERV *p_server_cb)
{
-#if (SDP_INCLUDED == TRUE)
tSDP_UUID uuid;
UINT16 num_attrs = 2;
UINT16 attr_list[2];
}
}
return status;
-#else
- return BTA_GATT_NO_RESOURCES;
-#endif ///SDP_INCLUDED == TRUE
}
+#endif ///SDP_INCLUDED == TRUE
+
/*******************************************************************************
**
** Function bta_gattc_disc_res_cback
** Returns void
**
*******************************************************************************/
+#if (SDP_INCLUDED == TRUE)
extern void BTA_DmDiscover(BD_ADDR bd_addr, tBTA_SERVICE_MASK services,
tBTA_DM_SEARCH_CBACK *p_cback, BOOLEAN sdp_search);
-#if (SDP_INCLUDED == TRUE)
// btla-specific ++
/*******************************************************************************
**
static void bta_create_raw_sdp_record(bluetooth_sdp_record *record, tSDP_DISC_REC *p_rec)
{
-#if (SDP_INCLUDED == TRUE)
tSDP_DISC_ATTR *p_attr;
tSDP_PROTOCOL_ELEM pe;
}
record->hdr.user1_ptr_len = p_bta_sdp_cfg->p_sdp_db->raw_size;
record->hdr.user1_ptr = p_bta_sdp_cfg->p_sdp_db->raw_data;
-#endif ///SDP_INCLUDED == TRUE
}
*******************************************************************************/
static void bta_sdp_search_cback(UINT16 result, void *user_data)
{
-#if (SDP_INCLUDED == TRUE)
tSDP_DISC_REC *p_rec = NULL;
tBTA_SDP_SEARCH_COMP evt_data = {0}; // We need to zero-initialize
tBTA_SDP_STATUS status = BTA_SDP_FAILURE;
bta_sdp_cb.p_dm_cback(BTA_SDP_SEARCH_COMP_EVT, (tBTA_SDP *) &evt_data, (void *)&uuid->uu.uuid128);
osi_free(user_data); // We no longer need the user data to track the search
-#endif ///SDP_INCLUDED == TRUE
}
/*******************************************************************************
*******************************************************************************/
void bta_sdp_search(tBTA_SDP_MSG *p_data)
{
-#if (SDP_INCLUDED == TRUE)
int x = 0;
// TODO: Leaks!!! but needed as user-data pointer
tBT_UUID *bta_sdp_search_uuid = osi_malloc(sizeof(tBT_UUID));
/*
else report the result when the cback is called
*/
-#endif ///SDP_INCLUDED == TRUE
}
/*******************************************************************************