diff options
Diffstat (limited to 'stack/sdp/sdp_api.c')
-rw-r--r-- | stack/sdp/sdp_api.c | 228 |
1 files changed, 0 insertions, 228 deletions
diff --git a/stack/sdp/sdp_api.c b/stack/sdp/sdp_api.c index 558bd8b69..6e84ded80 100644 --- a/stack/sdp/sdp_api.c +++ b/stack/sdp/sdp_api.c @@ -37,13 +37,6 @@ #include "sdpint.h" #include "btu.h" -#include <cutils/log.h> -#define info(fmt, ...) LOGI ("%s: " fmt,__FUNCTION__, ## __VA_ARGS__) -#define debug(fmt, ...) LOGD ("%s: " fmt,__FUNCTION__, ## __VA_ARGS__) -#define error(fmt, ...) LOGE ("## ERROR : %s: " fmt "##",__FUNCTION__, ## __VA_ARGS__) -#define asrt(s) if(!(s)) LOGE ("## %s assert %s failed at line:%d ##",__FUNCTION__, #s, __LINE__) - - /********************************************************************** ** C L I E N T F U N C T I O N P R O T O T Y P E S * ***********************************************************************/ @@ -686,17 +679,6 @@ tSDP_DISC_REC *SDP_FindServiceUUIDInDb (tSDP_DISCOVERY_DB *p_db, tBT_UUID *p_uui { if (SDP_DISC_ATTR_TYPE(p_sattr->attr_len_type) == UUID_DESC_TYPE) { - - SDP_TRACE_DEBUG("uuid len=%d ", p_uuid->len); - if (p_uuid->len == 2) - { - SDP_TRACE_DEBUG("uuid=0x%x \n", p_uuid->uu.uuid16); - } - else - { - SDP_TRACE_DEBUG("\n"); - } - if (sdpu_compare_uuid_with_attr (p_uuid, p_sattr)) return(p_rec); } @@ -1273,119 +1255,6 @@ UINT16 SDP_SetLocalDiRecord( tSDP_DI_RECORD *p_device_info, UINT32 *p_handle ) /******************************************************************************* ** -** Function SDP_GetLocalDiRecord -** -** Description This function adds a DI record to the local SDP database. -** -** Fills in the device information of the record -** p_handle - if p_handle == 0, the primary record is returned -** -** Returns Returns SDP_SUCCESS if record exists, else error -** -*******************************************************************************/ -UINT16 SDP_GetLocalDiRecord(tSDP_DI_GET_RECORD *p_device_info, UINT32 *p_handle ) -{ - UINT16 result = SDP_NO_DI_RECORD_FOUND; - -#if SDP_SERVER_ENABLED == TRUE - tSDP_RECORD *p_rec; - tSDP_ATTRIBUTE *p_attr; - UINT8 *p_temp; - INT32 templen; - - if (*p_handle == 0) - *p_handle = sdp_cb.server_db.di_primary_handle; - - if ((p_rec = sdp_db_find_record(*p_handle)) != NULL) - { - memset(p_device_info, 0, sizeof(tSDP_DI_RECORD)); - - result = SDP_SUCCESS; - - /* Retrieve the Specification ID */ - if ((p_attr = sdp_db_find_attr_in_rec(p_rec, ATTR_ID_SPECIFICATION_ID, - ATTR_ID_SPECIFICATION_ID)) != NULL) - { - p_temp = p_attr->value_ptr; - BE_STREAM_TO_UINT16 (p_device_info->spec_id, p_temp); - } - - /* Retrieve the Vendor ID */ - if ((p_attr = sdp_db_find_attr_in_rec(p_rec, ATTR_ID_VENDOR_ID, - ATTR_ID_VENDOR_ID)) != NULL) - { - p_temp = p_attr->value_ptr; - BE_STREAM_TO_UINT16 (p_device_info->rec.vendor, p_temp); - } - - /* Retrieve the Product ID */ - if ((p_attr = sdp_db_find_attr_in_rec(p_rec, ATTR_ID_PRODUCT_ID, - ATTR_ID_PRODUCT_ID)) != NULL) - { - p_temp = p_attr->value_ptr; - BE_STREAM_TO_UINT16 (p_device_info->rec.product, p_temp); - } - - /* Retrieve the Version ID */ - if ((p_attr = sdp_db_find_attr_in_rec(p_rec, ATTR_ID_PRODUCT_VERSION, - ATTR_ID_PRODUCT_VERSION)) != NULL) - { - p_temp = p_attr->value_ptr; - BE_STREAM_TO_UINT16 (p_device_info->rec.version, p_temp); - } - - /* Retrieve the Vendor ID Source ID */ - if ((p_attr = sdp_db_find_attr_in_rec(p_rec, ATTR_ID_VENDOR_ID_SOURCE, - ATTR_ID_VENDOR_ID_SOURCE)) != NULL) - { - p_temp = p_attr->value_ptr; - BE_STREAM_TO_UINT16 (p_device_info->rec.vendor_id_source, p_temp); - } - - /* Retrieve the Primary Record */ - if ((p_attr = sdp_db_find_attr_in_rec(p_rec, ATTR_ID_PRIMARY_RECORD, - ATTR_ID_PRIMARY_RECORD)) != NULL) - { - p_device_info->rec.primary_record = *p_attr->value_ptr; - } - - /* Retrieve the Client Executable URL */ - if ((p_attr = sdp_db_find_attr_in_rec(p_rec, ATTR_ID_CLIENT_EXE_URL, - ATTR_ID_CLIENT_EXE_URL)) != NULL) - { - templen = (INT32)((p_attr->len < SDP_MAX_ATTR_LEN) ? p_attr->len : SDP_MAX_ATTR_LEN); - p_temp = p_attr->value_ptr; - BE_STREAM_TO_ARRAY (p_temp, p_device_info->rec.client_executable_url, templen); - } - - /* Retrieve the Service Description */ - if ((p_attr = sdp_db_find_attr_in_rec(p_rec, ATTR_ID_SERVICE_DESCRIPTION, - ATTR_ID_SERVICE_DESCRIPTION)) != NULL) - { - templen = (INT32)((p_attr->len < SDP_MAX_ATTR_LEN) ? p_attr->len : SDP_MAX_ATTR_LEN); - p_temp = p_attr->value_ptr; - BE_STREAM_TO_ARRAY (p_temp, p_device_info->rec.service_description, templen); - } - - /* Retrieve the Documentation URL */ - if ((p_attr = sdp_db_find_attr_in_rec(p_rec, ATTR_ID_DOCUMENTATION_URL, - ATTR_ID_DOCUMENTATION_URL)) != NULL) - { - templen = (INT32)((p_attr->len < SDP_MAX_ATTR_LEN) ? p_attr->len : SDP_MAX_ATTR_LEN); - p_temp = p_attr->value_ptr; - BE_STREAM_TO_ARRAY (p_temp, p_device_info->rec.documentation_url, templen); - } - } - else - *p_handle = 0; -#endif - - return result; -} - - -/******************************************************************************* -** ** Function SDP_SetTraceLevel ** ** Description This function sets the trace level for SDP. If called with @@ -1401,100 +1270,3 @@ UINT8 SDP_SetTraceLevel (UINT8 new_level) return(sdp_cb.trace_level); } - -#if SDP_FOR_JV_INCLUDED == TRUE -/******************************************************************************* -** -** Function SDP_ConnOpen -** -** Description This function creates a connection to the SDP server on the -** given device. -** -** Returns 0, if failed to initiate connection. Otherwise, the handle. -** -*******************************************************************************/ -UINT32 SDP_ConnOpen (UINT8 *p_bd_addr, tSDP_DISC_RES_CB *p_rcb, - tSDP_DISC_CMPL_CB *p_cb) -{ -#if SDP_CLIENT_ENABLED == TRUE - tCONN_CB *p_ccb; - UINT32 idx = 0; - - if (!p_cb || !p_rcb) - return(idx); - - /* Specific BD address */ - p_ccb = sdp_conn_originate (p_bd_addr); - - if (!p_ccb) - return(idx); - - p_ccb->disc_state = SDP_DISC_WAIT_CONN; - p_ccb->p_db = (tSDP_DISCOVERY_DB *)p_rcb; - p_ccb->p_cb = p_cb; - - p_ccb->is_attr_search = SDP_IS_PASS_THRU; - - idx = (UINT32)(p_ccb - sdp_cb.ccb); - return(UINT32)(idx + 1); -#else - return(0); -#endif -} - -/******************************************************************************* -** -** Function SDP_WriteData -** -** Description This function sends data to the connected SDP server. -** -** Returns TRUE if data is sent, FALSE if failed. -** -*******************************************************************************/ -BOOLEAN SDP_WriteData (UINT32 handle, BT_HDR *p_msg) -{ -#if SDP_CLIENT_ENABLED == TRUE - tCONN_CB *p_ccb = NULL; - - if (p_msg && (handle > 0) && (handle <= SDP_MAX_CONNECTIONS) ) - { - p_ccb = &sdp_cb.ccb[handle - 1]; - if ( (p_ccb->con_state == SDP_STATE_CONNECTED) && - (p_ccb->con_flags & SDP_FLAGS_IS_ORIG) ) - { - /* Start inactivity timer */ - btu_start_timer (&p_ccb->timer_entry, BTU_TTYPE_SDP, SDP_INACT_TIMEOUT); - L2CA_DataWrite (p_ccb->connection_id, p_msg); - return TRUE; - } - } -#endif - return FALSE; -} - -/******************************************************************************* -** -** Function SDP_ConnClose -** -** Description This function is called to close a SDP connection. -** -** Parameters: handle - Handle of the connection returned by SDP_ConnOpen -** -** Returns TRUE if connection is closed, FALSE if failed to find the handle. -** -*******************************************************************************/ -BOOLEAN SDP_ConnClose (UINT32 handle) -{ -#if SDP_CLIENT_ENABLED == TRUE - tCONN_CB *p_ccb = NULL; - - if (handle > 0 && handle <= SDP_MAX_CONNECTIONS) - { - p_ccb = &sdp_cb.ccb[handle - 1]; - sdp_disconnect (p_ccb, SDP_SUCCESS); - return TRUE; - } -#endif - return FALSE; -} -#endif |