sdp_api.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  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. #ifndef SDP_API_H
  19. #define SDP_API_H
  20. #include "bt_target.h"
  21. #include "sdpdefs.h"
  22. #if (SDP_INCLUDED == TRUE)
  23. /*****************************************************************************
  24. ** Constants
  25. *****************************************************************************/
  26. /* Success code and error codes */
  27. #define SDP_SUCCESS 0x0000
  28. #define SDP_INVALID_VERSION 0x0001
  29. #define SDP_INVALID_SERV_REC_HDL 0x0002
  30. #define SDP_INVALID_REQ_SYNTAX 0x0003
  31. #define SDP_INVALID_PDU_SIZE 0x0004
  32. #define SDP_INVALID_CONT_STATE 0x0005
  33. #define SDP_NO_RESOURCES 0x0006
  34. #define SDP_DI_REG_FAILED 0x0007
  35. #define SDP_DI_DISC_FAILED 0x0008
  36. #define SDP_NO_DI_RECORD_FOUND 0x0009
  37. #define SDP_ERR_ATTR_NOT_PRESENT 0x000A
  38. #define SDP_ILLEGAL_PARAMETER 0x000B
  39. #define SDP_NO_RECS_MATCH 0xFFF0
  40. #define SDP_CONN_FAILED 0xFFF1
  41. #define SDP_CFG_FAILED 0xFFF2
  42. #define SDP_GENERIC_ERROR 0xFFF3
  43. #define SDP_DB_FULL 0xFFF4
  44. #define SDP_INVALID_PDU 0xFFF5
  45. #define SDP_SECURITY_ERR 0xFFF6
  46. #define SDP_CONN_REJECTED 0xFFF7
  47. #define SDP_CANCEL 0xFFF8
  48. /* Define the PSM that SDP uses */
  49. #define SDP_PSM 0x0001
  50. /* Legacy #define to avoid code changes - SDP UUID is same as BT UUID */
  51. #define tSDP_UUID tBT_UUID
  52. /* Masks for attr_value field of tSDP_DISC_ATTR */
  53. #define SDP_DISC_ATTR_LEN_MASK 0x0FFF
  54. #define SDP_DISC_ATTR_TYPE(len_type) (len_type >> 12)
  55. #define SDP_DISC_ATTR_LEN(len_type) (len_type & SDP_DISC_ATTR_LEN_MASK)
  56. /* Maximum number of protocol list items (list_elem in tSDP_PROTOCOL_ELEM) */
  57. #define SDP_MAX_LIST_ELEMS 3
  58. /*****************************************************************************
  59. ** Type Definitions
  60. *****************************************************************************/
  61. /* Define a callback function for when discovery is complete. */
  62. typedef void (tSDP_DISC_CMPL_CB) (UINT16 result);
  63. typedef void (tSDP_DISC_CMPL_CB2) (UINT16 result, void *user_data);
  64. typedef struct {
  65. BD_ADDR peer_addr;
  66. UINT16 peer_mtu;
  67. } tSDP_DR_OPEN;
  68. typedef struct {
  69. UINT8 *p_data;
  70. UINT16 data_len;
  71. } tSDP_DR_DATA;
  72. typedef union {
  73. tSDP_DR_OPEN open;
  74. tSDP_DR_DATA data;
  75. } tSDP_DATA;
  76. /* Define a callback function for when discovery result is received. */
  77. typedef void (tSDP_DISC_RES_CB) (UINT16 event, tSDP_DATA *p_data);
  78. /* Define a structure to hold the discovered service information. */
  79. typedef struct {
  80. union {
  81. UINT8 u8; /* 8-bit integer */
  82. UINT16 u16; /* 16-bit integer */
  83. UINT32 u32; /* 32-bit integer */
  84. UINT8 array[4]; /* Variable length field */
  85. struct t_sdp_disc_attr *p_sub_attr; /* Addr of first sub-attr (list)*/
  86. } v;
  87. } tSDP_DISC_ATVAL;
  88. typedef struct t_sdp_disc_attr {
  89. struct t_sdp_disc_attr *p_next_attr; /* Addr of next linked attr */
  90. UINT16 attr_id; /* Attribute ID */
  91. UINT16 attr_len_type; /* Length and type fields */
  92. tSDP_DISC_ATVAL attr_value; /* Variable length entry data */
  93. } tSDP_DISC_ATTR;
  94. typedef struct t_sdp_disc_rec {
  95. tSDP_DISC_ATTR *p_first_attr; /* First attribute of record */
  96. struct t_sdp_disc_rec *p_next_rec; /* Addr of next linked record */
  97. UINT32 time_read; /* The time the record was read */
  98. BD_ADDR remote_bd_addr; /* Remote BD address */
  99. } tSDP_DISC_REC;
  100. typedef struct {
  101. UINT32 mem_size; /* Memory size of the DB */
  102. UINT32 mem_free; /* Memory still available */
  103. tSDP_DISC_REC *p_first_rec; /* Addr of first record in DB */
  104. UINT16 num_uuid_filters; /* Number of UUIds to filter */
  105. tSDP_UUID uuid_filters[SDP_MAX_UUID_FILTERS]; /* UUIDs to filter */
  106. UINT16 num_attr_filters; /* Number of attribute filters */
  107. UINT16 attr_filters[SDP_MAX_ATTR_FILTERS]; /* Attributes to filter */
  108. UINT8 *p_free_mem; /* Pointer to free memory */
  109. #if (SDP_RAW_DATA_INCLUDED == TRUE)
  110. UINT8 *raw_data; /* Received record from server. allocated/released by client */
  111. UINT32 raw_size; /* size of raw_data */
  112. UINT32 raw_used; /* length of raw_data used */
  113. #endif
  114. } tSDP_DISCOVERY_DB;
  115. /* This structure is used to add protocol lists and find protocol elements */
  116. typedef struct {
  117. UINT16 protocol_uuid;
  118. UINT16 num_params;
  119. UINT16 params[SDP_MAX_PROTOCOL_PARAMS];
  120. } tSDP_PROTOCOL_ELEM;
  121. typedef struct {
  122. UINT16 num_elems;
  123. tSDP_PROTOCOL_ELEM list_elem[SDP_MAX_LIST_ELEMS];
  124. } tSDP_PROTO_LIST_ELEM;
  125. /* Device Identification (DI) data structure
  126. */
  127. /* Used to set the DI record */
  128. typedef struct t_sdp_di_record {
  129. UINT16 vendor;
  130. UINT16 vendor_id_source;
  131. UINT16 product;
  132. UINT16 version;
  133. BOOLEAN primary_record;
  134. char client_executable_url[SDP_MAX_ATTR_LEN]; /* optional */
  135. char service_description[SDP_MAX_ATTR_LEN]; /* optional */
  136. char documentation_url[SDP_MAX_ATTR_LEN]; /* optional */
  137. } tSDP_DI_RECORD;
  138. /* Used to get the DI record */
  139. typedef struct t_sdp_di_get_record {
  140. UINT16 spec_id;
  141. tSDP_DI_RECORD rec;
  142. } tSDP_DI_GET_RECORD;
  143. /*****************************************************************************
  144. ** External Function Declarations
  145. *****************************************************************************/
  146. #ifdef __cplusplus
  147. extern "C"
  148. {
  149. #endif
  150. /* API into the SDP layer for service discovery. */
  151. /*******************************************************************************
  152. **
  153. ** Function SDP_InitDiscoveryDb
  154. **
  155. ** Description This function is called to initialize a discovery database.
  156. **
  157. ** Returns TRUE if successful, FALSE if one or more parameters are bad
  158. **
  159. *******************************************************************************/
  160. extern BOOLEAN SDP_InitDiscoveryDb (tSDP_DISCOVERY_DB *p_db, UINT32 len,
  161. UINT16 num_uuid,
  162. tSDP_UUID *p_uuid_list,
  163. UINT16 num_attr,
  164. UINT16 *p_attr_list);
  165. /*******************************************************************************
  166. **
  167. ** Function SDP_CancelServiceSearch
  168. **
  169. ** Description This function cancels an active query to an SDP server.
  170. **
  171. ** Returns TRUE if discovery cancelled, FALSE if a matching activity is not found.
  172. **
  173. *******************************************************************************/
  174. extern BOOLEAN SDP_CancelServiceSearch (tSDP_DISCOVERY_DB *p_db);
  175. /*******************************************************************************
  176. **
  177. ** Function SDP_ServiceSearchRequest
  178. **
  179. ** Description This function queries an SDP server for information.
  180. **
  181. ** Returns TRUE if discovery started, FALSE if failed.
  182. **
  183. *******************************************************************************/
  184. extern BOOLEAN SDP_ServiceSearchRequest (UINT8 *p_bd_addr,
  185. tSDP_DISCOVERY_DB *p_db,
  186. tSDP_DISC_CMPL_CB *p_cb);
  187. /*******************************************************************************
  188. **
  189. ** Function SDP_ServiceSearchAttributeRequest
  190. **
  191. ** Description This function queries an SDP server for information.
  192. **
  193. ** The difference between this API function and the function
  194. ** SDP_ServiceSearchRequest is that this one does a
  195. ** combined ServiceSearchAttributeRequest SDP function.
  196. **
  197. ** Returns TRUE if discovery started, FALSE if failed.
  198. **
  199. *******************************************************************************/
  200. extern BOOLEAN SDP_ServiceSearchAttributeRequest (UINT8 *p_bd_addr,
  201. tSDP_DISCOVERY_DB *p_db,
  202. tSDP_DISC_CMPL_CB *p_cb);
  203. /*******************************************************************************
  204. **
  205. ** Function SDP_ServiceSearchAttributeRequest2
  206. **
  207. ** Description This function queries an SDP server for information.
  208. **
  209. ** The difference between this API function and the function
  210. ** SDP_ServiceSearchRequest is that this one does a
  211. ** combined ServiceSearchAttributeRequest SDP function with the
  212. ** user data piggyback
  213. **
  214. ** Returns TRUE if discovery started, FALSE if failed.
  215. **
  216. *******************************************************************************/
  217. extern BOOLEAN SDP_ServiceSearchAttributeRequest2 (UINT8 *p_bd_addr,
  218. tSDP_DISCOVERY_DB *p_db,
  219. tSDP_DISC_CMPL_CB2 *p_cb, void *user_data);
  220. /* API of utilities to find data in the local discovery database */
  221. /*******************************************************************************
  222. **
  223. ** Function SDP_FindAttributeInDb
  224. **
  225. ** Description This function queries an SDP database for a specific attribute.
  226. ** If the p_start_rec pointer is NULL, it looks from the beginning
  227. ** of the database, else it continues from the next record after
  228. ** p_start_rec.
  229. **
  230. ** Returns Pointer to matching record, or NULL
  231. **
  232. *******************************************************************************/
  233. extern tSDP_DISC_REC *SDP_FindAttributeInDb (tSDP_DISCOVERY_DB *p_db,
  234. UINT16 attr_id,
  235. tSDP_DISC_REC *p_start_rec);
  236. /*******************************************************************************
  237. **
  238. ** Function SDP_FindAttributeInRec
  239. **
  240. ** Description This function searches an SDP discovery record for a
  241. ** specific attribute.
  242. **
  243. ** Returns Pointer to matching attribute entry, or NULL
  244. **
  245. *******************************************************************************/
  246. extern tSDP_DISC_ATTR *SDP_FindAttributeInRec (tSDP_DISC_REC *p_rec,
  247. UINT16 attr_id);
  248. /*******************************************************************************
  249. **
  250. ** Function SDP_FindServiceInDb
  251. **
  252. ** Description This function queries an SDP database for a specific service.
  253. ** If the p_start_rec pointer is NULL, it looks from the beginning
  254. ** of the database, else it continues from the next record after
  255. ** p_start_rec.
  256. **
  257. ** Returns Pointer to record containing service class, or NULL
  258. **
  259. *******************************************************************************/
  260. extern tSDP_DISC_REC *SDP_FindServiceInDb (tSDP_DISCOVERY_DB *p_db,
  261. UINT16 service_uuid,
  262. tSDP_DISC_REC *p_start_rec);
  263. /*******************************************************************************
  264. **
  265. ** Function SDP_FindServiceUUIDInDb
  266. **
  267. ** Description This function queries an SDP database for a specific service.
  268. ** If the p_start_rec pointer is NULL, it looks from the beginning
  269. ** of the database, else it continues from the next record after
  270. ** p_start_rec.
  271. **
  272. ** NOTE the only difference between this function and the previous
  273. ** function "SDP_FindServiceInDb()" is that this function takes
  274. ** a tBT_UUID input.
  275. **
  276. ** Returns Pointer to record containing service class, or NULL
  277. **
  278. *******************************************************************************/
  279. extern tSDP_DISC_REC *SDP_FindServiceUUIDInDb (tSDP_DISCOVERY_DB *p_db,
  280. tBT_UUID *p_uuid,
  281. tSDP_DISC_REC *p_start_rec);
  282. /*******************************************************************************
  283. **
  284. ** Function SDP_FindServiceUUIDInRec_128bit
  285. **
  286. ** Description This function is called to read the 128-bit service UUID within a record
  287. ** if there is any.
  288. **
  289. ** Parameters: p_rec - pointer to a SDP record.
  290. ** p_uuid - output parameter to save the UUID found.
  291. **
  292. ** Returns TRUE if found, otherwise FALSE.
  293. **
  294. *******************************************************************************/
  295. extern BOOLEAN SDP_FindServiceUUIDInRec_128bit(tSDP_DISC_REC *p_rec, tBT_UUID *p_uuid);
  296. /*******************************************************************************
  297. **
  298. ** Function SDP_FindServiceInDb_128bit
  299. **
  300. ** Description This function queries an SDP database for a specific service.
  301. ** If the p_start_rec pointer is NULL, it looks from the beginning
  302. ** of the database, else it continues from the next record after
  303. ** p_start_rec.
  304. **
  305. ** Returns Pointer to record containing service class, or NULL
  306. **
  307. *******************************************************************************/
  308. extern tSDP_DISC_REC *SDP_FindServiceInDb_128bit(tSDP_DISCOVERY_DB *p_db,
  309. tSDP_DISC_REC *p_start_rec);
  310. /*******************************************************************************
  311. **
  312. ** Function SDP_FindProtocolListElemInRec
  313. **
  314. ** Description This function looks at a specific discovery record for a
  315. ** protocol list element.
  316. **
  317. ** Returns TRUE if found, FALSE if not
  318. ** If found, the passed protocol list element is filled in.
  319. **
  320. *******************************************************************************/
  321. extern BOOLEAN SDP_FindProtocolListElemInRec (tSDP_DISC_REC *p_rec,
  322. UINT16 layer_uuid,
  323. tSDP_PROTOCOL_ELEM *p_elem);
  324. /*******************************************************************************
  325. **
  326. ** Function SDP_FindAddProtoListsElemInRec
  327. **
  328. ** Description This function looks at a specific discovery record for a
  329. ** protocol list element.
  330. **
  331. ** Returns TRUE if found, FALSE if not
  332. ** If found, the passed protocol list element is filled in.
  333. **
  334. *******************************************************************************/
  335. extern BOOLEAN SDP_FindAddProtoListsElemInRec (tSDP_DISC_REC *p_rec,
  336. UINT16 layer_uuid,
  337. tSDP_PROTOCOL_ELEM *p_elem);
  338. /*******************************************************************************
  339. **
  340. ** Function SDP_FindProfileVersionInRec
  341. **
  342. ** Description This function looks at a specific discovery record for the
  343. ** Profile list descriptor, and pulls out the version number.
  344. ** The version number consists of an 8-bit major version and
  345. ** an 8-bit minor version.
  346. **
  347. ** Returns TRUE if found, FALSE if not
  348. ** If found, the major and minor version numbers that were passed
  349. ** in are filled in.
  350. **
  351. *******************************************************************************/
  352. extern BOOLEAN SDP_FindProfileVersionInRec (tSDP_DISC_REC *p_rec,
  353. UINT16 profile_uuid,
  354. UINT16 *p_version);
  355. /* API into SDP for local service database updates */
  356. /*******************************************************************************
  357. **
  358. ** Function SDP_CreateRecord
  359. **
  360. ** Description This function is called to create a record in the database.
  361. ** This would be through the SDP database maintenance API. The
  362. ** record is created empty, teh application should then call
  363. ** "add_attribute" to add the record's attributes.
  364. **
  365. ** Returns Record handle if OK, else 0.
  366. **
  367. *******************************************************************************/
  368. extern UINT32 SDP_CreateRecord (void);
  369. /*******************************************************************************
  370. **
  371. ** Function SDP_DeleteRecord
  372. **
  373. ** Description This function is called to add a record (or all records)
  374. ** from the database. This would be through the SDP database
  375. ** maintenance API.
  376. **
  377. ** If a record handle of 0 is passed, all records are deleted.
  378. **
  379. ** Returns TRUE if succeeded, else FALSE
  380. **
  381. *******************************************************************************/
  382. extern BOOLEAN SDP_DeleteRecord (UINT32 handle);
  383. /*******************************************************************************
  384. **
  385. ** Function SDP_ReadRecord
  386. **
  387. ** Description This function is called to get the raw data of the record
  388. ** with the given handle from the database.
  389. **
  390. ** Returns -1, if the record is not found.
  391. ** Otherwise, the offset (0 or 1) to start of data in p_data.
  392. **
  393. ** The size of data copied into p_data is in *p_data_len.
  394. **
  395. *******************************************************************************/
  396. extern INT32 SDP_ReadRecord(UINT32 handle, UINT8 *p_data, INT32 *p_data_len);
  397. /*******************************************************************************
  398. **
  399. ** Function SDP_AddAttribute
  400. **
  401. ** Description This function is called to add an attribute to a record.
  402. ** This would be through the SDP database maintenance API.
  403. ** If the attribute already exists in the record, it is replaced
  404. ** with the new value.
  405. **
  406. ** NOTE Attribute values must be passed as a Big Endian stream.
  407. **
  408. ** Returns TRUE if added OK, else FALSE
  409. **
  410. *******************************************************************************/
  411. extern BOOLEAN SDP_AddAttribute (UINT32 handle, UINT16 attr_id,
  412. UINT8 attr_type, UINT32 attr_len,
  413. UINT8 *p_val);
  414. /*******************************************************************************
  415. **
  416. ** Function SDP_AddSequence
  417. **
  418. ** Description This function is called to add a sequence to a record.
  419. ** This would be through the SDP database maintenance API.
  420. ** If the sequence already exists in the record, it is replaced
  421. ** with the new sequence.
  422. **
  423. ** NOTE Element values must be passed as a Big Endian stream.
  424. **
  425. ** Returns TRUE if added OK, else FALSE
  426. **
  427. *******************************************************************************/
  428. extern BOOLEAN SDP_AddSequence (UINT32 handle, UINT16 attr_id,
  429. UINT16 num_elem, UINT8 type[],
  430. UINT8 len[], UINT8 *p_val[]);
  431. /*******************************************************************************
  432. **
  433. ** Function SDP_AddUuidSequence
  434. **
  435. ** Description This function is called to add a UUID sequence to a record.
  436. ** This would be through the SDP database maintenance API.
  437. ** If the sequence already exists in the record, it is replaced
  438. ** with the new sequence.
  439. **
  440. ** Returns TRUE if added OK, else FALSE
  441. **
  442. *******************************************************************************/
  443. extern BOOLEAN SDP_AddUuidSequence (UINT32 handle, UINT16 attr_id,
  444. UINT16 num_uuids, UINT16 *p_uuids);
  445. /*******************************************************************************
  446. **
  447. ** Function SDP_AddProtocolList
  448. **
  449. ** Description This function is called to add a protocol descriptor list to
  450. ** a record. This would be through the SDP database maintenance API.
  451. ** If the protocol list already exists in the record, it is replaced
  452. ** with the new list.
  453. **
  454. ** Returns TRUE if added OK, else FALSE
  455. **
  456. *******************************************************************************/
  457. extern BOOLEAN SDP_AddProtocolList (UINT32 handle, UINT16 num_elem,
  458. tSDP_PROTOCOL_ELEM *p_elem_list);
  459. /*******************************************************************************
  460. **
  461. ** Function SDP_AddAdditionProtoLists
  462. **
  463. ** Description This function is called to add a protocol descriptor list to
  464. ** a record. This would be through the SDP database maintenance API.
  465. ** If the protocol list already exists in the record, it is replaced
  466. ** with the new list.
  467. **
  468. ** Returns TRUE if added OK, else FALSE
  469. **
  470. *******************************************************************************/
  471. extern BOOLEAN SDP_AddAdditionProtoLists (UINT32 handle, UINT16 num_elem,
  472. tSDP_PROTO_LIST_ELEM *p_proto_list);
  473. /*******************************************************************************
  474. **
  475. ** Function SDP_AddProfileDescriptorList
  476. **
  477. ** Description This function is called to add a profile descriptor list to
  478. ** a record. This would be through the SDP database maintenance API.
  479. ** If the version already exists in the record, it is replaced
  480. ** with the new one.
  481. **
  482. ** Returns TRUE if added OK, else FALSE
  483. **
  484. *******************************************************************************/
  485. extern BOOLEAN SDP_AddProfileDescriptorList (UINT32 handle,
  486. UINT16 profile_uuid,
  487. UINT16 version);
  488. /*******************************************************************************
  489. **
  490. ** Function SDP_AddLanguageBaseAttrIDList
  491. **
  492. ** Description This function is called to add a language base attr list to
  493. ** a record. This would be through the SDP database maintenance API.
  494. ** If the version already exists in the record, it is replaced
  495. ** with the new one.
  496. **
  497. ** Returns TRUE if added OK, else FALSE
  498. **
  499. *******************************************************************************/
  500. extern BOOLEAN SDP_AddLanguageBaseAttrIDList (UINT32 handle,
  501. UINT16 lang, UINT16 char_enc,
  502. UINT16 base_id);
  503. /*******************************************************************************
  504. **
  505. ** Function SDP_AddServiceClassIdList
  506. **
  507. ** Description This function is called to add a service list to a record.
  508. ** This would be through the SDP database maintenance API.
  509. ** If the service list already exists in the record, it is replaced
  510. ** with the new list.
  511. **
  512. ** Returns TRUE if added OK, else FALSE
  513. **
  514. *******************************************************************************/
  515. extern BOOLEAN SDP_AddServiceClassIdList (UINT32 handle,
  516. UINT16 num_services,
  517. UINT16 *p_service_uuids);
  518. /*******************************************************************************
  519. **
  520. ** Function SDP_DeleteAttribute
  521. **
  522. ** Description This function is called to delete an attribute from a record.
  523. ** This would be through the SDP database maintenance API.
  524. **
  525. ** Returns TRUE if deleted OK, else FALSE if not found
  526. **
  527. *******************************************************************************/
  528. extern BOOLEAN SDP_DeleteAttribute (UINT32 handle, UINT16 attr_id);
  529. /* Device Identification APIs */
  530. /*******************************************************************************
  531. **
  532. ** Function SDP_SetLocalDiRecord
  533. **
  534. ** Description This function adds a DI record to the local SDP database.
  535. **
  536. ** Returns Returns SDP_SUCCESS if record added successfully, else error
  537. **
  538. *******************************************************************************/
  539. extern UINT16 SDP_SetLocalDiRecord (tSDP_DI_RECORD *device_info,
  540. UINT32 *p_handle);
  541. /*******************************************************************************
  542. **
  543. ** Function SDP_DiDiscover
  544. **
  545. ** Description This function queries a remote device for DI information.
  546. **
  547. ** Returns SDP_SUCCESS if query started successfully, else error
  548. **
  549. *******************************************************************************/
  550. extern UINT16 SDP_DiDiscover (BD_ADDR remote_device,
  551. tSDP_DISCOVERY_DB *p_db, UINT32 len,
  552. tSDP_DISC_CMPL_CB *p_cb);
  553. /*******************************************************************************
  554. **
  555. ** Function SDP_GetNumDiRecords
  556. **
  557. ** Description Searches specified database for DI records
  558. **
  559. ** Returns number of DI records found
  560. **
  561. *******************************************************************************/
  562. extern UINT8 SDP_GetNumDiRecords (tSDP_DISCOVERY_DB *p_db);
  563. /*******************************************************************************
  564. **
  565. ** Function SDP_GetDiRecord
  566. **
  567. ** Description This function retrieves a remote device's DI record from
  568. ** the specified database.
  569. **
  570. ** Returns SDP_SUCCESS if record retrieved, else error
  571. **
  572. *******************************************************************************/
  573. extern UINT16 SDP_GetDiRecord (UINT8 getRecordIndex,
  574. tSDP_DI_GET_RECORD *device_info,
  575. tSDP_DISCOVERY_DB *p_db);
  576. /*******************************************************************************
  577. **
  578. ** Function SDP_SetTraceLevel
  579. **
  580. ** Description This function sets the trace level for SDP. If called with
  581. ** a value of 0xFF, it simply reads the current trace level.
  582. **
  583. ** Returns the new (current) trace level
  584. **
  585. *******************************************************************************/
  586. extern UINT8 SDP_SetTraceLevel (UINT8 new_level);
  587. /*******************************************************************************
  588. **
  589. ** Function SDP_ConnOpen
  590. **
  591. ** Description This function creates a connection to the SDP server on the
  592. ** given device.
  593. **
  594. ** Returns 0, if failed to initiate connection. Otherwise, the handle.
  595. **
  596. *******************************************************************************/
  597. UINT32 SDP_ConnOpen (UINT8 *p_bd_addr, tSDP_DISC_RES_CB *p_rcb,
  598. tSDP_DISC_CMPL_CB *p_cb);
  599. /*******************************************************************************
  600. **
  601. ** Function SDP_WriteData
  602. **
  603. ** Description This function sends data to the connected SDP server.
  604. **
  605. ** Returns TRUE if data is sent, FALSE if failed.
  606. **
  607. *******************************************************************************/
  608. BOOLEAN SDP_WriteData (UINT32 handle, BT_HDR *p_msg);
  609. /*******************************************************************************
  610. **
  611. ** Function SDP_ConnClose
  612. **
  613. ** Description This function is called to close a SDP connection.
  614. **
  615. ** Parameters: handle - Handle of the connection returned by SDP_ConnOpen
  616. **
  617. ** Returns TRUE if connection is closed, FALSE if failed to find the handle.
  618. **
  619. *******************************************************************************/
  620. BOOLEAN SDP_ConnClose (UINT32 handle);
  621. /*******************************************************************************
  622. **
  623. ** Function SDP_FindServiceUUIDInRec
  624. **
  625. ** Description This function is called to read the service UUID within a record
  626. ** if there is any.
  627. **
  628. ** Parameters: p_rec - pointer to a SDP record.
  629. **
  630. ** Returns TRUE if found, otherwise FALSE.
  631. **
  632. *******************************************************************************/
  633. BOOLEAN SDP_FindServiceUUIDInRec(tSDP_DISC_REC *p_rec, tBT_UUID *p_uuid);
  634. #ifdef __cplusplus
  635. }
  636. #endif
  637. #endif ///SDP_INCLUDED == TRUE
  638. #endif /* SDP_API_H */