The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Copyright (C) 1999-2012 Broadcom Corporation |
| 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at: |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | * |
| 17 | ******************************************************************************/ |
| 18 | |
| 19 | /****************************************************************************** |
| 20 | * |
| 21 | * This file contains internally used SDP definitions |
| 22 | * |
| 23 | ******************************************************************************/ |
| 24 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 25 | #ifndef SDP_INT_H |
| 26 | #define SDP_INT_H |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 27 | |
| 28 | #include "bt_target.h" |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 29 | #include "l2c_api.h" |
Pavlin Radoslavov | 78bcff7 | 2015-12-04 17:36:34 -0800 | [diff] [blame] | 30 | #include "osi/include/alarm.h" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 31 | #include "sdp_api.h" |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 32 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 33 | /* Continuation length - we use a 2-byte offset */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 34 | #define SDP_CONTINUATION_LEN 2 |
| 35 | #define SDP_MAX_CONTINUATION_LEN 16 /* As per the spec */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 36 | |
| 37 | /* Timeout definitions. */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 38 | #define SDP_INACT_TIMEOUT_MS (30 * 1000) /* Inactivity timeout (in ms) */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 39 | |
| 40 | /* Define the Out-Flow default values. */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 41 | #define SDP_OFLOW_QOS_FLAG 0 |
| 42 | #define SDP_OFLOW_SERV_TYPE 0 |
| 43 | #define SDP_OFLOW_TOKEN_RATE 0 |
| 44 | #define SDP_OFLOW_TOKEN_BUCKET_SIZE 0 |
| 45 | #define SDP_OFLOW_PEAK_BANDWIDTH 0 |
| 46 | #define SDP_OFLOW_LATENCY 0 |
| 47 | #define SDP_OFLOW_DELAY_VARIATION 0 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 48 | |
| 49 | /* Define the In-Flow default values. */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 50 | #define SDP_IFLOW_QOS_FLAG 0 |
| 51 | #define SDP_IFLOW_SERV_TYPE 0 |
| 52 | #define SDP_IFLOW_TOKEN_RATE 0 |
| 53 | #define SDP_IFLOW_TOKEN_BUCKET_SIZE 0 |
| 54 | #define SDP_IFLOW_PEAK_BANDWIDTH 0 |
| 55 | #define SDP_IFLOW_LATENCY 0 |
| 56 | #define SDP_IFLOW_DELAY_VARIATION 0 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 57 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 58 | #define SDP_LINK_TO 0 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 59 | |
| 60 | /* Define the type of device notification. */ |
| 61 | /* (Inquiry Scan and Page Scan) */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 62 | #define SDP_DEVICE_NOTI_LEN \ |
| 63 | (sizeof(BT_HDR) + HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_WRITE_PARAM1) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 64 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 65 | #define SDP_DEVICE_NOTI_FLAG 0x03 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 66 | |
| 67 | /* Define the Protocol Data Unit (PDU) types. |
| 68 | */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 69 | #define SDP_PDU_ERROR_RESPONSE 0x01 |
| 70 | #define SDP_PDU_SERVICE_SEARCH_REQ 0x02 |
| 71 | #define SDP_PDU_SERVICE_SEARCH_RSP 0x03 |
| 72 | #define SDP_PDU_SERVICE_ATTR_REQ 0x04 |
| 73 | #define SDP_PDU_SERVICE_ATTR_RSP 0x05 |
| 74 | #define SDP_PDU_SERVICE_SEARCH_ATTR_REQ 0x06 |
| 75 | #define SDP_PDU_SERVICE_SEARCH_ATTR_RSP 0x07 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 76 | |
| 77 | /* Max UUIDs and attributes we support per sequence */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 78 | #define MAX_UUIDS_PER_SEQ 16 |
| 79 | #define MAX_ATTR_PER_SEQ 16 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 80 | |
| 81 | /* Max length we support for any attribute */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 82 | #ifdef SDP_MAX_ATTR_LEN |
| 83 | #define MAX_ATTR_LEN SDP_MAX_ATTR_LEN |
| 84 | #else |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 85 | #define MAX_ATTR_LEN 256 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 86 | #endif |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 87 | |
| 88 | /* Internal UUID sequence representation */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 89 | typedef struct { |
| 90 | uint16_t len; |
| 91 | uint8_t value[MAX_UUID_SIZE]; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 92 | } tUID_ENT; |
| 93 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 94 | typedef struct { |
| 95 | uint16_t num_uids; |
| 96 | tUID_ENT uuid_entry[MAX_UUIDS_PER_SEQ]; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 97 | } tSDP_UUID_SEQ; |
| 98 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 99 | /* Internal attribute sequence definitions */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 100 | typedef struct { |
| 101 | uint16_t start; |
| 102 | uint16_t end; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 103 | } tATT_ENT; |
| 104 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 105 | typedef struct { |
| 106 | uint16_t num_attr; |
| 107 | tATT_ENT attr_entry[MAX_ATTR_PER_SEQ]; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 108 | } tSDP_ATTR_SEQ; |
| 109 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 110 | /* Define the attribute element of the SDP database record */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 111 | typedef struct { |
| 112 | uint32_t len; /* Number of bytes in the entry */ |
| 113 | uint8_t* value_ptr; /* Points to attr_pad */ |
| 114 | uint16_t id; |
| 115 | uint8_t type; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 116 | } tSDP_ATTRIBUTE; |
| 117 | |
| 118 | /* An SDP record consists of a handle, and 1 or more attributes */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 119 | typedef struct { |
| 120 | uint32_t record_handle; |
| 121 | uint32_t free_pad_ptr; |
| 122 | uint16_t num_attributes; |
| 123 | tSDP_ATTRIBUTE attribute[SDP_MAX_REC_ATTR]; |
| 124 | uint8_t attr_pad[SDP_MAX_PAD_LEN]; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 125 | } tSDP_RECORD; |
| 126 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 127 | /* Define the SDP database */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 128 | typedef struct { |
| 129 | uint32_t |
| 130 | di_primary_handle; /* Device ID Primary record or NULL if nonexistent */ |
| 131 | uint16_t num_records; |
| 132 | tSDP_RECORD record[SDP_MAX_RECORDS]; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 133 | } tSDP_DB; |
| 134 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 135 | enum { |
| 136 | SDP_IS_SEARCH, |
| 137 | SDP_IS_ATTR_SEARCH, |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 138 | }; |
| 139 | |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame] | 140 | #if (SDP_SERVER_ENABLED == TRUE) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 141 | /* Continuation information for the SDP server response */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 142 | typedef struct { |
| 143 | uint16_t next_attr_index; /* attr index for next continuation response */ |
| 144 | uint16_t next_attr_start_id; /* attr id to start with for the attr index in |
| 145 | next cont. response */ |
| 146 | tSDP_RECORD* prev_sdp_rec; /* last sdp record that was completely sent in the |
| 147 | response */ |
| 148 | bool last_attr_seq_desc_sent; /* whether attr seq length has been sent |
| 149 | previously */ |
| 150 | uint16_t attr_offset; /* offset within the attr to keep trak of partial |
| 151 | attributes in the responses */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 152 | } tSDP_CONT_INFO; |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 153 | #endif /* SDP_SERVER_ENABLED == TRUE */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 154 | |
| 155 | /* Define the SDP Connection Control Block */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 156 | typedef struct { |
| 157 | #define SDP_STATE_IDLE 0 |
| 158 | #define SDP_STATE_CONN_SETUP 1 |
| 159 | #define SDP_STATE_CFG_SETUP 2 |
| 160 | #define SDP_STATE_CONNECTED 3 |
| 161 | uint8_t con_state; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 162 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 163 | #define SDP_FLAGS_IS_ORIG 0x01 |
| 164 | #define SDP_FLAGS_HIS_CFG_DONE 0x02 |
| 165 | #define SDP_FLAGS_MY_CFG_DONE 0x04 |
| 166 | uint8_t con_flags; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 167 | |
Jakub Pawlowski | 9e030fd | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 168 | RawAddress device_address; |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 169 | alarm_t* sdp_conn_timer; |
| 170 | uint16_t rem_mtu_size; |
| 171 | uint16_t connection_id; |
| 172 | uint16_t list_len; /* length of the response in the GKI buffer */ |
| 173 | uint8_t* rsp_list; /* pointer to GKI buffer holding response */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 174 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 175 | tSDP_DISCOVERY_DB* p_db; /* Database to save info into */ |
| 176 | tSDP_DISC_CMPL_CB* p_cb; /* Callback for discovery done */ |
| 177 | tSDP_DISC_CMPL_CB2* |
| 178 | p_cb2; /* Callback for discovery done piggy back with the user data */ |
| 179 | void* user_data; /* piggy back user data */ |
| 180 | uint32_t |
| 181 | handles[SDP_MAX_DISC_SERVER_RECS]; /* Discovered server record handles */ |
| 182 | uint16_t num_handles; /* Number of server handles */ |
| 183 | uint16_t cur_handle; /* Current handle being processed */ |
| 184 | uint16_t transaction_id; |
| 185 | uint16_t disconnect_reason; /* Disconnect reason */ |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame] | 186 | #if (SDP_BROWSE_PLUS == TRUE) |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 187 | uint16_t cur_uuid_idx; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 188 | #endif |
| 189 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 190 | #define SDP_DISC_WAIT_CONN 0 |
| 191 | #define SDP_DISC_WAIT_HANDLES 1 |
| 192 | #define SDP_DISC_WAIT_ATTR 2 |
| 193 | #define SDP_DISC_WAIT_SEARCH_ATTR 3 |
| 194 | #define SDP_DISC_WAIT_CANCEL 5 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 195 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 196 | uint8_t disc_state; |
| 197 | uint8_t is_attr_search; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 198 | |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame] | 199 | #if (SDP_SERVER_ENABLED == TRUE) |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 200 | uint16_t cont_offset; /* Continuation state data in the server response */ |
| 201 | tSDP_CONT_INFO cont_info; /* structure to hold continuation information for |
| 202 | the server response */ |
| 203 | #endif /* SDP_SERVER_ENABLED == TRUE */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 204 | |
| 205 | } tCONN_CB; |
| 206 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 207 | /* The main SDP control block */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 208 | typedef struct { |
| 209 | tL2CAP_CFG_INFO l2cap_my_cfg; /* My L2CAP config */ |
| 210 | tCONN_CB ccb[SDP_MAX_CONNECTIONS]; |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame] | 211 | #if (SDP_SERVER_ENABLED == TRUE) |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 212 | tSDP_DB server_db; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 213 | #endif |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 214 | tL2CAP_APPL_INFO reg_info; /* L2CAP Registration info */ |
| 215 | uint16_t max_attr_list_size; /* Max attribute list size to use */ |
| 216 | uint16_t max_recs_per_search; /* Max records we want per seaarch */ |
| 217 | uint8_t trace_level; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 218 | } tSDP_CB; |
| 219 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 220 | /* Global SDP data */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 221 | extern tSDP_CB sdp_cb; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 222 | |
Pavlin Radoslavov | b2a292b | 2016-10-14 19:34:48 -0700 | [diff] [blame] | 223 | /* Functions provided by sdp_main.cc */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 224 | extern void sdp_init(void); |
| 225 | extern void sdp_disconnect(tCONN_CB* p_ccb, uint16_t reason); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 226 | |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame] | 227 | #if (SDP_DEBUG == TRUE) |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 228 | extern uint16_t sdp_set_max_attr_list_size(uint16_t max_size); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 229 | #endif |
| 230 | |
Pavlin Radoslavov | b2a292b | 2016-10-14 19:34:48 -0700 | [diff] [blame] | 231 | /* Functions provided by sdp_conn.cc |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 232 | */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 233 | extern void sdp_conn_rcv_l2e_conn_ind(BT_HDR* p_msg); |
| 234 | extern void sdp_conn_rcv_l2e_conn_cfm(BT_HDR* p_msg); |
| 235 | extern void sdp_conn_rcv_l2e_disc(BT_HDR* p_msg); |
| 236 | extern void sdp_conn_rcv_l2e_config_ind(BT_HDR* p_msg); |
| 237 | extern void sdp_conn_rcv_l2e_config_cfm(BT_HDR* p_msg); |
| 238 | extern void sdp_conn_rcv_l2e_conn_failed(BT_HDR* p_msg); |
| 239 | extern void sdp_conn_rcv_l2e_connected(BT_HDR* p_msg); |
| 240 | extern void sdp_conn_rcv_l2e_conn_failed(BT_HDR* p_msg); |
| 241 | extern void sdp_conn_rcv_l2e_data(BT_HDR* p_msg); |
| 242 | extern void sdp_conn_timer_timeout(void* data); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 243 | |
Jakub Pawlowski | 9e030fd | 2017-06-24 17:30:18 -0700 | [diff] [blame] | 244 | extern tCONN_CB* sdp_conn_originate(const RawAddress& p_bd_addr); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 245 | |
Pavlin Radoslavov | b2a292b | 2016-10-14 19:34:48 -0700 | [diff] [blame] | 246 | /* Functions provided by sdp_utils.cc |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 247 | */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 248 | extern tCONN_CB* sdpu_find_ccb_by_cid(uint16_t cid); |
| 249 | extern tCONN_CB* sdpu_find_ccb_by_db(tSDP_DISCOVERY_DB* p_db); |
| 250 | extern tCONN_CB* sdpu_allocate_ccb(void); |
| 251 | extern void sdpu_release_ccb(tCONN_CB* p_ccb); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 252 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 253 | extern uint8_t* sdpu_build_attrib_seq(uint8_t* p_out, uint16_t* p_attr, |
| 254 | uint16_t num_attrs); |
| 255 | extern uint8_t* sdpu_build_attrib_entry(uint8_t* p_out, tSDP_ATTRIBUTE* p_attr); |
| 256 | extern void sdpu_build_n_send_error(tCONN_CB* p_ccb, uint16_t trans_num, |
| 257 | uint16_t error_code, char* p_error_text); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 258 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 259 | extern uint8_t* sdpu_extract_attr_seq(uint8_t* p, uint16_t param_len, |
| 260 | tSDP_ATTR_SEQ* p_seq); |
| 261 | extern uint8_t* sdpu_extract_uid_seq(uint8_t* p, uint16_t param_len, |
| 262 | tSDP_UUID_SEQ* p_seq); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 263 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 264 | extern uint8_t* sdpu_get_len_from_type(uint8_t* p, uint8_t type, |
| 265 | uint32_t* p_len); |
| 266 | extern bool sdpu_is_base_uuid(uint8_t* p_uuid); |
| 267 | extern bool sdpu_compare_uuid_arrays(uint8_t* p_uuid1, uint32_t len1, |
| 268 | uint8_t* p_uuid2, uint16_t len2); |
| 269 | extern bool sdpu_compare_bt_uuids(tBT_UUID* p_uuid1, tBT_UUID* p_uuid2); |
| 270 | extern bool sdpu_compare_uuid_with_attr(tBT_UUID* p_btuuid, |
| 271 | tSDP_DISC_ATTR* p_attr); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 272 | |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 273 | extern void sdpu_sort_attr_list(uint16_t num_attr, tSDP_DISCOVERY_DB* p_db); |
| 274 | extern uint16_t sdpu_get_list_len(tSDP_UUID_SEQ* uid_seq, |
| 275 | tSDP_ATTR_SEQ* attr_seq); |
| 276 | extern uint16_t sdpu_get_attrib_seq_len(tSDP_RECORD* p_rec, |
| 277 | tSDP_ATTR_SEQ* attr_seq); |
| 278 | extern uint16_t sdpu_get_attrib_entry_len(tSDP_ATTRIBUTE* p_attr); |
| 279 | extern uint8_t* sdpu_build_partial_attrib_entry(uint8_t* p_out, |
| 280 | tSDP_ATTRIBUTE* p_attr, |
| 281 | uint16_t len, uint16_t* offset); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 282 | |
Pavlin Radoslavov | b2a292b | 2016-10-14 19:34:48 -0700 | [diff] [blame] | 283 | /* Functions provided by sdp_db.cc |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 284 | */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 285 | extern tSDP_RECORD* sdp_db_service_search(tSDP_RECORD* p_rec, |
| 286 | tSDP_UUID_SEQ* p_seq); |
| 287 | extern tSDP_RECORD* sdp_db_find_record(uint32_t handle); |
| 288 | extern tSDP_ATTRIBUTE* sdp_db_find_attr_in_rec(tSDP_RECORD* p_rec, |
| 289 | uint16_t start_attr, |
| 290 | uint16_t end_attr); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 291 | |
Pavlin Radoslavov | b2a292b | 2016-10-14 19:34:48 -0700 | [diff] [blame] | 292 | /* Functions provided by sdp_server.cc |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 293 | */ |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame] | 294 | #if (SDP_SERVER_ENABLED == TRUE) |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 295 | extern void sdp_server_handle_client_req(tCONN_CB* p_ccb, BT_HDR* p_msg); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 296 | #else |
| 297 | #define sdp_server_handle_client_req(p_ccb, p_msg) |
| 298 | #endif |
| 299 | |
Pavlin Radoslavov | b2a292b | 2016-10-14 19:34:48 -0700 | [diff] [blame] | 300 | /* Functions provided by sdp_discovery.cc |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 301 | */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 302 | extern void sdp_disc_connected(tCONN_CB* p_ccb); |
| 303 | extern void sdp_disc_server_rsp(tCONN_CB* p_ccb, BT_HDR* p_msg); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 304 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 305 | #endif |