/****************************************************************************** * * Copyright (C) 1999-2012 Broadcom Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************************//* ... *//****************************************************************************** * * This file contains internally used SDP definitions * ******************************************************************************//* ... */#ifndefSDP_INT_H#defineSDP_INT_H#include"common/bt_target.h"#include"common/bt_defs.h"#include"stack/sdp_api.h"#include"stack/l2c_api.h"#include"osi/list.h"5 includes#if(SDP_INCLUDED==TRUE)/* Continuation length - we use a 2-byte offset */#defineSDP_CONTINUATION_LEN2#defineSDP_MAX_CONTINUATION_LEN16/* As per the spec *//* Timeout definitions. */#defineSDP_INACT_TIMEOUT30/* Inactivity timeout */#ifBT_SDP_BQB_INCLUDED#defineSDP_BQB_INACT_TIMEOUT90/* Inactivity timeout for BQB test */#endif/* BT_SDP_BQB_INCLUDED *//* Define the Out-Flow default values. */#defineSDP_OFLOW_QOS_FLAG0#defineSDP_OFLOW_SERV_TYPE0#defineSDP_OFLOW_TOKEN_RATE0#defineSDP_OFLOW_TOKEN_BUCKET_SIZE0#defineSDP_OFLOW_PEAK_BANDWIDTH0#defineSDP_OFLOW_LATENCY0#defineSDP_OFLOW_DELAY_VARIATION0/* Define the In-Flow default values. */#defineSDP_IFLOW_QOS_FLAG0#defineSDP_IFLOW_SERV_TYPE0#defineSDP_IFLOW_TOKEN_RATE0#defineSDP_IFLOW_TOKEN_BUCKET_SIZE0#defineSDP_IFLOW_PEAK_BANDWIDTH0#defineSDP_IFLOW_LATENCY0#defineSDP_IFLOW_DELAY_VARIATION0#defineSDP_LINK_TO0/* Define the type of device notification. *//* (Inquiry Scan and Page Scan) */#defineSDP_DEVICE_NOTI_LENsizeof(BT_HDR)+\HCIC_PREAMBLE_SIZE+\HCIC_PARAM_SIZE_WRITE_PARAM1...#defineSDP_DEVICE_NOTI_FLAG0x03/* Define the Protocol Data Unit (PDU) types.*//* ... */#defineSDP_PDU_ERROR_RESPONSE0x01#defineSDP_PDU_SERVICE_SEARCH_REQ0x02#defineSDP_PDU_SERVICE_SEARCH_RSP0x03#defineSDP_PDU_SERVICE_ATTR_REQ0x04#defineSDP_PDU_SERVICE_ATTR_RSP0x05#defineSDP_PDU_SERVICE_SEARCH_ATTR_REQ0x06#defineSDP_PDU_SERVICE_SEARCH_ATTR_RSP0x07/* Max UUIDs and attributes we support per sequence */#defineMAX_UUIDS_PER_SEQ8#defineMAX_ATTR_PER_SEQ826 defines/* Max length we support for any attribute */// btla-specific ++#ifdefSDP_MAX_ATTR_LEN#defineMAX_ATTR_LENSDP_MAX_ATTR_LEN#else#defineMAX_ATTR_LEN256#endif// btla-specific --/* Internal UUID sequence representation */typedefstruct{UINT16len;UINT8value[MAX_UUID_SIZE];}{...}tUID_ENT;typedefstruct{UINT16num_uids;tUID_ENTuuid_entry[MAX_UUIDS_PER_SEQ];}{...}tSDP_UUID_SEQ;/* Internal attribute sequence definitions */typedefstruct{UINT16start;UINT16end;}{...}tATT_ENT;typedefstruct{UINT16num_attr;tATT_ENTattr_entry[MAX_ATTR_PER_SEQ];}{...}tSDP_ATTR_SEQ;/* Define the attribute element of the SDP database record */typedefstruct{UINT32len;/* Number of bytes in the entry */UINT8*value_ptr;/* Points to attr_pad */UINT16id;UINT8type;}{...}tSDP_ATTRIBUTE;/* An SDP record consists of a handle, and 1 or more attributes */typedefstruct{UINT32record_handle;UINT32free_pad_ptr;UINT16num_attributes;tSDP_ATTRIBUTEattribute[SDP_MAX_REC_ATTR];UINT8attr_pad[SDP_MAX_PAD_LEN];}{...}tSDP_RECORD;/* Define the SDP database */typedefstruct{UINT32di_primary_handle;/* Device ID Primary record or NULL if nonexistent */UINT16num_records;list_t*p_record_list;}{...}tSDP_DB;enum{SDP_IS_SEARCH,SDP_IS_ATTR_SEARCH,}{...};#ifSDP_SERVER_ENABLED==TRUE/* Continuation information for the SDP server response */typedefstruct{UINT16next_attr_index;/* attr index for next continuation response */UINT16next_attr_start_id;/* attr id to start with for the attr index in next cont. response */tSDP_RECORD*prev_sdp_rec;/* last sdp record that was completely sent in the response */BOOLEANlast_attr_seq_desc_sent;/* whether attr seq length has been sent previously */UINT16attr_offset;/* offset within the attr to keep trak of partial attributes in the responses */}{...}tSDP_CONT_INFO;/* ... */#endif/* SDP_SERVER_ENABLED == TRUE *//* Define the SDP Connection Control Block */typedefstruct{#defineSDP_STATE_IDLE0#defineSDP_STATE_CONN_SETUP1#defineSDP_STATE_CFG_SETUP2#defineSDP_STATE_CONNECTED3UINT8con_state;#defineSDP_FLAGS_IS_ORIG0x01#defineSDP_FLAGS_HIS_CFG_DONE0x02#defineSDP_FLAGS_MY_CFG_DONE0x04UINT8con_flags;BD_ADDRdevice_address;TIMER_LIST_ENTtimer_entry;UINT16rem_mtu_size;UINT16connection_id;UINT16list_len;/* length of the response in the GKI buffer */UINT8*rsp_list;/* pointer to GKI buffer holding response */#ifSDP_CLIENT_ENABLED==TRUEtSDP_DISCOVERY_DB*p_db;/* Database to save info into */tSDP_DISC_CMPL_CB*p_cb;/* Callback for discovery done */tSDP_DISC_CMPL_CB2*p_cb2;/* Callback for discovery done piggy back with the user data */void*user_data;/* piggy back user data */UINT32handles[SDP_MAX_DISC_SERVER_RECS];/* Discovered server record handles */UINT16num_handles;/* Number of server handles */UINT16cur_handle;/* Current handle being processed */UINT16transaction_id;UINT16disconnect_reason;/* Disconnect reason */#if(defined(SDP_BROWSE_PLUS)&&SDP_BROWSE_PLUS==TRUE)UINT16cur_uuid_idx;#endif#defineSDP_DISC_WAIT_CONN0#defineSDP_DISC_WAIT_HANDLES1#defineSDP_DISC_WAIT_ATTR2#defineSDP_DISC_WAIT_SEARCH_ATTR3#defineSDP_DISC_WAIT_CANCEL55 definesUINT8disc_state;UINT8is_attr_search;/* ... */#endif/* SDP_CLIENT_ENABLED == TRUE */#ifSDP_SERVER_ENABLED==TRUEUINT16cont_offset;/* Continuation state data in the server response */tSDP_CONT_INFOcont_info;/* structure to hold continuation information for the server response *//* ... */#endif/* SDP_SERVER_ENABLED == TRUE */}{...}tCONN_CB;/* The main SDP control block */typedefstruct{tL2CAP_CFG_INFOl2cap_my_cfg;/* My L2CAP config */tCONN_CBccb[SDP_MAX_CONNECTIONS];#ifSDP_SERVER_ENABLED==TRUEtSDP_DBserver_db;#endiftL2CAP_APPL_INFOreg_info;/* L2CAP Registration info */UINT16max_attr_list_size;/* Max attribute list size to use */UINT16max_recs_per_search;/* Max records we want per seaarch */UINT8trace_level;}{...}tSDP_CB;#ifdef__cplusplusextern"C"{#endif/* Global SDP data */#ifSDP_DYNAMIC_MEMORY==FALSEexterntSDP_CBsdp_cb;#elseexterntSDP_CB*sdp_cb_ptr;#definesdp_cb(*sdp_cb_ptr)/* ... */#endif#ifdef__cplusplus}{...}#endif/* Functions provided by sdp_main.c */externvoidsdp_init(void);externvoidsdp_deinit(void);externvoidsdp_disconnect(tCONN_CB*p_ccb,UINT16reason);#if(defined(SDP_DEBUG)&&SDP_DEBUG==TRUE)externUINT16sdp_set_max_attr_list_size(UINT16max_size);#endif/* Functions provided by sdp_conn.c*//* ... */externvoidsdp_conn_rcv_l2e_conn_ind(BT_HDR*p_msg);externvoidsdp_conn_rcv_l2e_conn_cfm(BT_HDR*p_msg);externvoidsdp_conn_rcv_l2e_disc(BT_HDR*p_msg);externvoidsdp_conn_rcv_l2e_config_ind(BT_HDR*p_msg);externvoidsdp_conn_rcv_l2e_config_cfm(BT_HDR*p_msg);externvoidsdp_conn_rcv_l2e_conn_failed(BT_HDR*p_msg);externvoidsdp_conn_rcv_l2e_connected(BT_HDR*p_msg);externvoidsdp_conn_rcv_l2e_conn_failed(BT_HDR*p_msg);externvoidsdp_conn_rcv_l2e_data(BT_HDR*p_msg);externvoidsdp_conn_timeout(tCONN_CB*p_ccb);externtCONN_CB*sdp_conn_originate(UINT8*p_bd_addr);/* Functions provided by sdp_utils.c*//* ... */externtCONN_CB*sdpu_find_ccb_by_cid(UINT16cid);externtCONN_CB*sdpu_find_ccb_by_db(tSDP_DISCOVERY_DB*p_db);externtCONN_CB*sdpu_allocate_ccb(void);externvoidsdpu_release_ccb(tCONN_CB*p_ccb);externUINT8*sdpu_build_attrib_seq(UINT8*p_out,UINT16*p_attr,UINT16num_attrs);externUINT8*sdpu_build_attrib_entry(UINT8*p_out,tSDP_ATTRIBUTE*p_attr);externvoidsdpu_build_n_send_error(tCONN_CB*p_ccb,UINT16trans_num,UINT16error_code,char*p_error_text);externUINT8*sdpu_extract_attr_seq(UINT8*p,UINT16param_len,tSDP_ATTR_SEQ*p_seq);externUINT8*sdpu_extract_uid_seq(UINT8*p,UINT16param_len,tSDP_UUID_SEQ*p_seq);externUINT8*sdpu_get_len_from_type(UINT8*p,UINT8type,UINT32*p_len);externBOOLEANsdpu_is_base_uuid(UINT8*p_uuid);externBOOLEANsdpu_compare_uuid_arrays(UINT8*p_uuid1,UINT32len1,UINT8*p_uuid2,UINT16len2);externBOOLEANsdpu_compare_bt_uuids(tBT_UUID*p_uuid1,tBT_UUID*p_uuid2);externBOOLEANsdpu_compare_uuid_with_attr(tBT_UUID*p_btuuid,tSDP_DISC_ATTR*p_attr);externvoidsdpu_sort_attr_list(UINT16num_attr,tSDP_DISCOVERY_DB*p_db);externUINT16sdpu_get_list_len(tSDP_UUID_SEQ*uid_seq,tSDP_ATTR_SEQ*attr_seq);externUINT16sdpu_get_attrib_seq_len(tSDP_RECORD*p_rec,tSDP_ATTR_SEQ*attr_seq);externUINT16sdpu_get_attrib_entry_len(tSDP_ATTRIBUTE*p_attr);externUINT8*sdpu_build_partial_attrib_entry(UINT8*p_out,tSDP_ATTRIBUTE*p_attr,UINT16len,UINT16*offset);externvoidsdpu_uuid16_to_uuid128(UINT16uuid16,UINT8*p_uuid128);/* Functions provided by sdp_db.c*//* ... */externtSDP_RECORD*sdp_db_service_search(tSDP_RECORD*p_rec,tSDP_UUID_SEQ*p_seq);externtSDP_RECORD*sdp_db_find_record(UINT32handle);externtSDP_ATTRIBUTE*sdp_db_find_attr_in_rec(tSDP_RECORD*p_rec,UINT16start_attr,UINT16end_attr);/* Functions provided by sdp_server.c*//* ... */#ifSDP_SERVER_ENABLED==TRUEexternvoidsdp_server_handle_client_req(tCONN_CB*p_ccb,BT_HDR*p_msg);#else#definesdp_server_handle_client_req(p_ccb,p_msg)#endif/* Functions provided by sdp_discovery.c*//* ... */#ifSDP_CLIENT_ENABLED==TRUEexternvoidsdp_disc_connected(tCONN_CB*p_ccb);externvoidsdp_disc_server_rsp(tCONN_CB*p_ccb,BT_HDR*p_msg);/* ... */#else#definesdp_disc_connected(p_ccb)#definesdp_disc_server_rsp(p_ccb,p_msg)/* ... */#endif/* ... */#endif///SDP_INCLUDED == TRUE/* ... */#endif
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.