1 /******************************************************************************
2  *
3  *  Copyright (C) 2002-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 
19 /******************************************************************************
20  *
21  *  This interface file contains the interface AVDTP conformance API.  These
22  *  additional API functions and callback events are provided for
23  *  conformance testing purposes only.  They are not intended to be used by
24  *  an application.
25  *
26  ******************************************************************************/
27 #ifndef AVDT_CAPI_H
28 #define AVDT_CAPI_H
29 
30 #include "avdt_api.h"
31 
32 /* start AVDTC events here to distinguish from AVDT events */
33 #define AVDTC_EVT_BEGIN 0x80
34 
35 /* Discover indication */
36 #define AVDTC_DISCOVER_IND_EVT (0 + AVDTC_EVT_BEGIN)
37 /* Get capabilities indication */
38 #define AVDTC_GETCAP_IND_EVT (1 + AVDTC_EVT_BEGIN)
39 /* Set configuration confirm */
40 #define AVDTC_SETCONFIG_CFM_EVT (2 + AVDTC_EVT_BEGIN)
41 /* Get configuration indication */
42 #define AVDTC_GETCONFIG_IND_EVT (3 + AVDTC_EVT_BEGIN)
43 /* Get configuration confirm */
44 #define AVDTC_GETCONFIG_CFM_EVT (4 + AVDTC_EVT_BEGIN)
45 /* Open indication */
46 #define AVDTC_OPEN_IND_EVT (5 + AVDTC_EVT_BEGIN)
47 /* Start indication */
48 #define AVDTC_START_IND_EVT (6 + AVDTC_EVT_BEGIN)
49 /* Close indication */
50 #define AVDTC_CLOSE_IND_EVT (7 + AVDTC_EVT_BEGIN)
51 /* Suspend indication */
52 #define AVDTC_SUSPEND_IND_EVT (8 + AVDTC_EVT_BEGIN)
53 /* Abort indication */
54 #define AVDTC_ABORT_IND_EVT (9 + AVDTC_EVT_BEGIN)
55 /* Abort confirm */
56 #define AVDTC_ABORT_CFM_EVT (10 + AVDTC_EVT_BEGIN)
57 
58 typedef struct {
59   tAVDT_EVT_HDR hdr;                /* Event header */
60   uint8_t seid_list[AVDT_NUM_SEPS]; /* Array of SEID values */
61   uint8_t num_seps;                 /* Number of values in array */
62 } tAVDT_MULTI;
63 
64 /* Union of all control callback event data structures */
65 typedef union {
66   tAVDT_EVT_HDR hdr;
67   tAVDT_CONFIG getconfig_cfm;
68   tAVDT_MULTI start_ind;
69   tAVDT_MULTI suspend_ind;
70 } tAVDTC_CTRL;
71 
72 typedef void tAVDTC_CTRL_CBACK(uint8_t handle, BD_ADDR bd_addr, uint8_t event,
73                                tAVDTC_CTRL* p_data);
74 
75 /*******************************************************************************
76  *
77  * Function         AVDTC_Init
78  *
79  * Description      This function is called to begin using the conformance API.
80  *                  It must be called after AVDT_Register() and before any
81  *                  other API or conformance API functions are called.
82  *
83  * Returns          void
84  *
85  ******************************************************************************/
86 extern void AVDTC_Init(tAVDTC_CTRL_CBACK* p_cback);
87 
88 /*******************************************************************************
89  *
90  * Function         AVDTC_DiscoverRsp
91  *
92  * Description      Send a discover response.
93  *
94  * Returns          void
95  *
96  ******************************************************************************/
97 extern void AVDTC_DiscoverRsp(BD_ADDR bd_addr, uint8_t label,
98                               tAVDT_SEP_INFO sep_info[], uint8_t num_seps);
99 
100 /*******************************************************************************
101  *
102  * Function         AVDTC_GetCapRsp
103  *
104  * Description     Send a get capabilities response.
105  *
106  * Returns          void
107  *
108  ******************************************************************************/
109 extern void AVDTC_GetCapRsp(BD_ADDR bd_addr, uint8_t label, tAVDT_CFG* p_cap);
110 
111 /*******************************************************************************
112  *
113  * Function         AVDTC_GetAllCapRsp
114  *
115  * Description     Send a get all capabilities response.
116  *
117  * Returns          void
118  *
119  ******************************************************************************/
120 extern void AVDTC_GetAllCapRsp(BD_ADDR bd_addr, uint8_t label,
121                                tAVDT_CFG* p_cap);
122 
123 /*******************************************************************************
124  *
125  * Function         AVDTC_GetConfigReq
126  *
127  * Description      Send a get configuration request.
128  *
129  * Returns          void
130  *
131  ******************************************************************************/
132 extern void AVDTC_GetConfigReq(uint8_t handle);
133 
134 /*******************************************************************************
135  *
136  * Function         AVDTC_GetConfigRsp
137  *
138  * Description      Send a get configuration response.
139  *
140  * Returns          void
141  *
142  ******************************************************************************/
143 extern void AVDTC_GetConfigRsp(uint8_t handle, uint8_t label, tAVDT_CFG* p_cfg);
144 
145 /*******************************************************************************
146  *
147  * Function         AVDTC_OpenReq
148  *
149  * Description      Send an open request.
150  *
151  * Returns          void
152  *
153  ******************************************************************************/
154 extern void AVDTC_OpenReq(uint8_t handle);
155 
156 /*******************************************************************************
157  *
158  * Function         AVDTC_OpenRsp
159  *
160  * Description      Send an open response.
161  *
162  * Returns          void
163  *
164  ******************************************************************************/
165 extern void AVDTC_OpenRsp(uint8_t handle, uint8_t label);
166 
167 /*******************************************************************************
168  *
169  * Function         AVDTC_StartRsp
170  *
171  * Description      Send a start response.
172  *
173  * Returns          void
174  *
175  ******************************************************************************/
176 extern void AVDTC_StartRsp(uint8_t* p_handles, uint8_t num_handles,
177                            uint8_t label);
178 
179 /*******************************************************************************
180  *
181  * Function         AVDTC_CloseRsp
182  *
183  * Description      Send a close response.
184  *
185  * Returns          void
186  *
187  ******************************************************************************/
188 extern void AVDTC_CloseRsp(uint8_t handle, uint8_t label);
189 
190 /*******************************************************************************
191  *
192  * Function         AVDTC_SuspendRsp
193  *
194  * Description      Send a suspend response.
195  *
196  * Returns          void
197  *
198  ******************************************************************************/
199 extern void AVDTC_SuspendRsp(uint8_t* p_handles, uint8_t num_handles,
200                              uint8_t label);
201 
202 /*******************************************************************************
203  *
204  * Function         AVDTC_AbortReq
205  *
206  * Description      Send an abort request.
207  *
208  * Returns          void
209  *
210  ******************************************************************************/
211 extern void AVDTC_AbortReq(uint8_t handle);
212 
213 /*******************************************************************************
214  *
215  * Function         AVDTC_AbortRsp
216  *
217  * Description      Send an abort response.
218  *
219  * Returns          void
220  *
221  ******************************************************************************/
222 extern void AVDTC_AbortRsp(uint8_t handle, uint8_t label);
223 
224 /*******************************************************************************
225  *
226  * Function         AVDTC_Rej
227  *
228  * Description      Send a reject message.
229  *
230  * Returns          void
231  *
232  ******************************************************************************/
233 extern void AVDTC_Rej(uint8_t handle, BD_ADDR bd_addr, uint8_t cmd,
234                       uint8_t label, uint8_t err_code, uint8_t err_param);
235 
236 #endif /* AVDT_CAPI_H */
237