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