sdp_api.h 28 KB

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