1 
2 
3 /******************************************************************************
4  *
5  *  Copyright (C) 2014 The Android Open Source Project
6  *  Copyright (C) 2003-2012 Broadcom Corporation
7  *
8  *  Licensed under the Apache License, Version 2.0 (the "License");
9  *  you may not use this file except in compliance with the License.
10  *  You may obtain a copy of the License at:
11  *
12  *  http://www.apache.org/licenses/LICENSE-2.0
13  *
14  *  Unless required by applicable law or agreed to in writing, software
15  *  distributed under the License is distributed on an "AS IS" BASIS,
16  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  *  See the License for the specific language governing permissions and
18  *  limitations under the License.
19  *
20  ******************************************************************************/
21 
22 /******************************************************************************
23  *
24  *  This is the private interface file for the BTA SDP I/F
25  *
26  ******************************************************************************/
27 #ifndef BTA_SDP_INT_H
28 #define BTA_SDP_INT_H
29 
30 #include "bta/bta_sys.h"
31 #include "bta/bta_api.h"
32 #include "bta/bta_sdp_api.h"
33 
34 #if (SDP_INCLUDED == TRUE)
35 /*****************************************************************************
36 **  Constants
37 *****************************************************************************/
38 
39 enum {
40     /* these events are handled by the state machine */
41     BTA_SDP_API_ENABLE_EVT = BTA_SYS_EVT_START(BTA_ID_SDP),
42     BTA_SDP_API_SEARCH_EVT,
43     BTA_SDP_API_CREATE_RECORD_USER_EVT,
44     BTA_SDP_API_REMOVE_RECORD_USER_EVT,
45     BTA_SDP_MAX_INT_EVT
46 };
47 
48 enum {
49     BTA_SDP_ACTIVE_NONE = 0,
50     BTA_SDP_ACTIVE_YES       /* waiting for SDP result */
51 };
52 
53 
54 
55 /* data type for BTA_SDP_API_ENABLE_EVT */
56 typedef struct {
57     BT_HDR             hdr;
58     tBTA_SDP_DM_CBACK  *p_cback;
59 } tBTA_SDP_API_ENABLE;
60 
61 /* data type for BTA_SDP_API_SEARCH_EVT */
62 typedef struct {
63     BT_HDR          hdr;
64     BD_ADDR         bd_addr;
65     tSDP_UUID       uuid;
66 } tBTA_SDP_API_SEARCH;
67 
68 /* data type for BTA_SDP_API_SEARCH_EVT */
69 typedef struct {
70     BT_HDR          hdr;
71     void           *user_data;
72 } tBTA_SDP_API_RECORD_USER;
73 
74 /* union of all data types */
75 typedef union {
76     /* event buffer header */
77     BT_HDR                                 hdr;
78     tBTA_SDP_API_ENABLE                    enable;
79     tBTA_SDP_API_SEARCH                    get_search;
80     tBTA_SDP_API_RECORD_USER               record;
81 } tBTA_SDP_MSG;
82 
83 /* SDP control block */
84 typedef struct {
85     UINT8              sdp_active;  /* see BTA_SDP_SDP_ACT_* */
86     BD_ADDR            remote_addr;
87     tBTA_SDP_DM_CBACK  *p_dm_cback;
88 } tBTA_SDP_CB;
89 
90 
91 /* SDP control block */
92 #if BTA_DYNAMIC_MEMORY == FALSE
93 extern tBTA_SDP_CB bta_sdp_cb;
94 #else
95 extern tBTA_SDP_CB *bta_sdp_cb_ptr;
96 #define bta_sdp_cb (*bta_sdp_cb_ptr)
97 #endif
98 
99 /* config struct */
100 extern tBTA_SDP_CFG *p_bta_sdp_cfg;
101 
102 extern BOOLEAN bta_sdp_sm_execute(BT_HDR *p_msg);
103 
104 extern void bta_sdp_enable (tBTA_SDP_MSG *p_data);
105 extern void bta_sdp_search (tBTA_SDP_MSG *p_data);
106 extern void bta_sdp_create_record(tBTA_SDP_MSG *p_data);
107 extern void bta_sdp_remove_record(tBTA_SDP_MSG *p_data);
108 
109 #endif  ///SDP_INCLUDED == TRUE
110 
111 #endif /* BTA_SDP_INT_H */
112