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