blob: 60a7c5f112484cf8d85cbee49f9e17c29e739c23 [file] [log] [blame]
The Android Open Source Project5738f832012-12-12 16:00:35 -08001/******************************************************************************
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 */
Myles Watson911d1ae2016-11-28 16:44:40 -080033#define AVDTC_EVT_BEGIN 0x80
The Android Open Source Project5738f832012-12-12 16:00:35 -080034
Myles Watson9ca07092016-11-28 16:41:53 -080035/* Discover indication */
Myles Watson911d1ae2016-11-28 16:44:40 -080036#define AVDTC_DISCOVER_IND_EVT (0 + AVDTC_EVT_BEGIN)
Myles Watson9ca07092016-11-28 16:41:53 -080037/* Get capabilities indication */
Myles Watson911d1ae2016-11-28 16:44:40 -080038#define AVDTC_GETCAP_IND_EVT (1 + AVDTC_EVT_BEGIN)
Myles Watson9ca07092016-11-28 16:41:53 -080039/* Set configuration confirm */
Myles Watson911d1ae2016-11-28 16:44:40 -080040#define AVDTC_SETCONFIG_CFM_EVT (2 + AVDTC_EVT_BEGIN)
Myles Watson9ca07092016-11-28 16:41:53 -080041/* Get configuration indication */
Myles Watson911d1ae2016-11-28 16:44:40 -080042#define AVDTC_GETCONFIG_IND_EVT (3 + AVDTC_EVT_BEGIN)
Myles Watson9ca07092016-11-28 16:41:53 -080043/* Get configuration confirm */
Myles Watson911d1ae2016-11-28 16:44:40 -080044#define AVDTC_GETCONFIG_CFM_EVT (4 + AVDTC_EVT_BEGIN)
Myles Watson9ca07092016-11-28 16:41:53 -080045/* Open indication */
Myles Watson911d1ae2016-11-28 16:44:40 -080046#define AVDTC_OPEN_IND_EVT (5 + AVDTC_EVT_BEGIN)
Myles Watson9ca07092016-11-28 16:41:53 -080047/* Start indication */
Myles Watson911d1ae2016-11-28 16:44:40 -080048#define AVDTC_START_IND_EVT (6 + AVDTC_EVT_BEGIN)
Myles Watson9ca07092016-11-28 16:41:53 -080049/* Close indication */
Myles Watson911d1ae2016-11-28 16:44:40 -080050#define AVDTC_CLOSE_IND_EVT (7 + AVDTC_EVT_BEGIN)
Myles Watson9ca07092016-11-28 16:41:53 -080051/* Suspend indication */
Myles Watson911d1ae2016-11-28 16:44:40 -080052#define AVDTC_SUSPEND_IND_EVT (8 + AVDTC_EVT_BEGIN)
Myles Watson9ca07092016-11-28 16:41:53 -080053/* Abort indication */
Myles Watson911d1ae2016-11-28 16:44:40 -080054#define AVDTC_ABORT_IND_EVT (9 + AVDTC_EVT_BEGIN)
Myles Watson9ca07092016-11-28 16:41:53 -080055/* Abort confirm */
Myles Watson911d1ae2016-11-28 16:44:40 -080056#define AVDTC_ABORT_CFM_EVT (10 + AVDTC_EVT_BEGIN)
The Android Open Source Project5738f832012-12-12 16:00:35 -080057
58typedef struct {
Myles Watson911d1ae2016-11-28 16:44:40 -080059 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 */
The Android Open Source Project5738f832012-12-12 16:00:35 -080062} tAVDT_MULTI;
63
64/* Union of all control callback event data structures */
65typedef union {
Myles Watson911d1ae2016-11-28 16:44:40 -080066 tAVDT_EVT_HDR hdr;
67 tAVDT_CONFIG getconfig_cfm;
68 tAVDT_MULTI start_ind;
69 tAVDT_MULTI suspend_ind;
The Android Open Source Project5738f832012-12-12 16:00:35 -080070} tAVDTC_CTRL;
71
Jakub Pawlowskia484a882017-06-24 17:30:18 -070072typedef void tAVDTC_CTRL_CBACK(uint8_t handle, const RawAddress& bd_addr,
Jakub Pawlowskib8a477e2017-06-16 15:16:15 -070073 uint8_t event, tAVDTC_CTRL* p_data);
The Android Open Source Project5738f832012-12-12 16:00:35 -080074
The Android Open Source Project5738f832012-12-12 16:00:35 -080075/*******************************************************************************
Myles Watsonee96a3c2016-11-23 14:49:54 -080076 *
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 ******************************************************************************/
Myles Watson911d1ae2016-11-28 16:44:40 -080086extern void AVDTC_Init(tAVDTC_CTRL_CBACK* p_cback);
The Android Open Source Project5738f832012-12-12 16:00:35 -080087
88/*******************************************************************************
Myles Watsonee96a3c2016-11-23 14:49:54 -080089 *
90 * Function AVDTC_DiscoverRsp
91 *
92 * Description Send a discover response.
93 *
94 * Returns void
95 *
96 ******************************************************************************/
Jakub Pawlowskia484a882017-06-24 17:30:18 -070097extern void AVDTC_DiscoverRsp(const RawAddress& bd_addr, uint8_t label,
Marie Janssend19e0782016-07-15 12:48:27 -070098 tAVDT_SEP_INFO sep_info[], uint8_t num_seps);
The Android Open Source Project5738f832012-12-12 16:00:35 -080099
100/*******************************************************************************
Myles Watsonee96a3c2016-11-23 14:49:54 -0800101 *
102 * Function AVDTC_GetCapRsp
103 *
104 * Description Send a get capabilities response.
105 *
106 * Returns void
107 *
108 ******************************************************************************/
Jakub Pawlowskia484a882017-06-24 17:30:18 -0700109extern void AVDTC_GetCapRsp(const RawAddress& bd_addr, uint8_t label,
Jakub Pawlowskib8a477e2017-06-16 15:16:15 -0700110 tAVDT_CFG* p_cap);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800111
112/*******************************************************************************
Myles Watsonee96a3c2016-11-23 14:49:54 -0800113 *
114 * Function AVDTC_GetAllCapRsp
115 *
116 * Description Send a get all capabilities response.
117 *
118 * Returns void
119 *
120 ******************************************************************************/
Jakub Pawlowskia484a882017-06-24 17:30:18 -0700121extern void AVDTC_GetAllCapRsp(const RawAddress& bd_addr, uint8_t label,
Myles Watson911d1ae2016-11-28 16:44:40 -0800122 tAVDT_CFG* p_cap);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800123
124/*******************************************************************************
Myles Watsonee96a3c2016-11-23 14:49:54 -0800125 *
126 * Function AVDTC_GetConfigReq
127 *
128 * Description Send a get configuration request.
129 *
130 * Returns void
131 *
132 ******************************************************************************/
Marie Janssend19e0782016-07-15 12:48:27 -0700133extern void AVDTC_GetConfigReq(uint8_t handle);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800134
135/*******************************************************************************
Myles Watsonee96a3c2016-11-23 14:49:54 -0800136 *
137 * Function AVDTC_GetConfigRsp
138 *
139 * Description Send a get configuration response.
140 *
141 * Returns void
142 *
143 ******************************************************************************/
Myles Watson911d1ae2016-11-28 16:44:40 -0800144extern void AVDTC_GetConfigRsp(uint8_t handle, uint8_t label, tAVDT_CFG* p_cfg);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800145
146/*******************************************************************************
Myles Watsonee96a3c2016-11-23 14:49:54 -0800147 *
148 * Function AVDTC_OpenReq
149 *
150 * Description Send an open request.
151 *
152 * Returns void
153 *
154 ******************************************************************************/
Marie Janssend19e0782016-07-15 12:48:27 -0700155extern void AVDTC_OpenReq(uint8_t handle);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800156
157/*******************************************************************************
Myles Watsonee96a3c2016-11-23 14:49:54 -0800158 *
159 * Function AVDTC_OpenRsp
160 *
161 * Description Send an open response.
162 *
163 * Returns void
164 *
165 ******************************************************************************/
Marie Janssend19e0782016-07-15 12:48:27 -0700166extern void AVDTC_OpenRsp(uint8_t handle, uint8_t label);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800167
168/*******************************************************************************
Myles Watsonee96a3c2016-11-23 14:49:54 -0800169 *
170 * Function AVDTC_StartRsp
171 *
172 * Description Send a start response.
173 *
174 * Returns void
175 *
176 ******************************************************************************/
Myles Watson911d1ae2016-11-28 16:44:40 -0800177extern void AVDTC_StartRsp(uint8_t* p_handles, uint8_t num_handles,
178 uint8_t label);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800179
180/*******************************************************************************
Myles Watsonee96a3c2016-11-23 14:49:54 -0800181 *
182 * Function AVDTC_CloseRsp
183 *
184 * Description Send a close response.
185 *
186 * Returns void
187 *
188 ******************************************************************************/
Marie Janssend19e0782016-07-15 12:48:27 -0700189extern void AVDTC_CloseRsp(uint8_t handle, uint8_t label);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800190
191/*******************************************************************************
Myles Watsonee96a3c2016-11-23 14:49:54 -0800192 *
193 * Function AVDTC_SuspendRsp
194 *
195 * Description Send a suspend response.
196 *
197 * Returns void
198 *
199 ******************************************************************************/
Myles Watson911d1ae2016-11-28 16:44:40 -0800200extern void AVDTC_SuspendRsp(uint8_t* p_handles, uint8_t num_handles,
201 uint8_t label);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800202
203/*******************************************************************************
Myles Watsonee96a3c2016-11-23 14:49:54 -0800204 *
205 * Function AVDTC_AbortReq
206 *
207 * Description Send an abort request.
208 *
209 * Returns void
210 *
211 ******************************************************************************/
Marie Janssend19e0782016-07-15 12:48:27 -0700212extern void AVDTC_AbortReq(uint8_t handle);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800213
214/*******************************************************************************
Myles Watsonee96a3c2016-11-23 14:49:54 -0800215 *
216 * Function AVDTC_AbortRsp
217 *
218 * Description Send an abort response.
219 *
220 * Returns void
221 *
222 ******************************************************************************/
Marie Janssend19e0782016-07-15 12:48:27 -0700223extern void AVDTC_AbortRsp(uint8_t handle, uint8_t label);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800224
225/*******************************************************************************
Myles Watsonee96a3c2016-11-23 14:49:54 -0800226 *
227 * Function AVDTC_Rej
228 *
229 * Description Send a reject message.
230 *
231 * Returns void
232 *
233 ******************************************************************************/
Jakub Pawlowskia484a882017-06-24 17:30:18 -0700234extern void AVDTC_Rej(uint8_t handle, const RawAddress& bd_addr, uint8_t cmd,
Myles Watson911d1ae2016-11-28 16:44:40 -0800235 uint8_t label, uint8_t err_code, uint8_t err_param);
The Android Open Source Project5738f832012-12-12 16:00:35 -0800236
The Android Open Source Project5738f832012-12-12 16:00:35 -0800237#endif /* AVDT_CAPI_H */