• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 
3 /******************************************************************************
4  *
5  *  Copyright 2014 The Android Open Source Project
6  *  Copyright 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_api.h"
31 #include "bta_sdp_api.h"
32 #include "bta_sys.h"
33 
34 /*****************************************************************************
35  *  Constants
36  ****************************************************************************/
37 
38 enum {
39   /* these events are handled by the state machine */
40   BTA_SDP_API_ENABLE_EVT = BTA_SYS_EVT_START(BTA_ID_SDP),
41   BTA_SDP_API_SEARCH_EVT,
42   BTA_SDP_API_CREATE_RECORD_USER_EVT,
43   BTA_SDP_API_REMOVE_RECORD_USER_EVT,
44   BTA_SDP_MAX_INT_EVT
45 };
46 
47 enum {
48   BTA_SDP_ACTIVE_NONE = 0,
49   BTA_SDP_ACTIVE_YES /* waiting for SDP result */
50 };
51 
52 /* data type for BTA_SDP_API_ENABLE_EVT */
53 typedef struct {
54   BT_HDR hdr;
55   tBTA_SDP_DM_CBACK* p_cback;
56 } tBTA_SDP_API_ENABLE;
57 
58 /* data type for BTA_SDP_API_SEARCH_EVT */
59 typedef struct {
60   BT_HDR hdr;
61   RawAddress bd_addr;
62   bluetooth::Uuid uuid;
63 } tBTA_SDP_API_SEARCH;
64 
65 /* data type for BTA_SDP_API_SEARCH_EVT */
66 typedef struct {
67   BT_HDR hdr;
68   void* user_data;
69 } tBTA_SDP_API_RECORD_USER;
70 
71 /* union of all data types */
72 typedef union {
73   /* GKI event buffer header */
74   BT_HDR hdr;
75   tBTA_SDP_API_ENABLE enable;
76   tBTA_SDP_API_SEARCH get_search;
77   tBTA_SDP_API_RECORD_USER record;
78 } tBTA_SDP_MSG;
79 
80 /* SDP control block */
81 typedef struct {
82   uint8_t sdp_active; /* see BTA_SDP_SDP_ACT_* */
83   RawAddress remote_addr;
84   tBTA_SDP_DM_CBACK* p_dm_cback;
85 } tBTA_SDP_CB;
86 
87 /* SDP control block */
88 extern tBTA_SDP_CB bta_sdp_cb;
89 
90 /* config struct */
91 extern tBTA_SDP_CFG* p_bta_sdp_cfg;
92 
93 extern bool bta_sdp_sm_execute(BT_HDR* p_msg);
94 
95 extern void bta_sdp_enable(tBTA_SDP_MSG* p_data);
96 extern void bta_sdp_search(tBTA_SDP_MSG* p_data);
97 extern void bta_sdp_create_record(tBTA_SDP_MSG* p_data);
98 extern void bta_sdp_remove_record(tBTA_SDP_MSG* p_data);
99 
100 #endif /* BTA_SDP_INT_H */
101