The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 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 */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 33 | #define AVDTC_EVT_BEGIN 0x80 |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 34 | |
Myles Watson | 9ca0709 | 2016-11-28 16:41:53 -0800 | [diff] [blame] | 35 | /* Discover indication */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 36 | #define AVDTC_DISCOVER_IND_EVT (0 + AVDTC_EVT_BEGIN) |
Myles Watson | 9ca0709 | 2016-11-28 16:41:53 -0800 | [diff] [blame] | 37 | /* Get capabilities indication */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 38 | #define AVDTC_GETCAP_IND_EVT (1 + AVDTC_EVT_BEGIN) |
Myles Watson | 9ca0709 | 2016-11-28 16:41:53 -0800 | [diff] [blame] | 39 | /* Set configuration confirm */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 40 | #define AVDTC_SETCONFIG_CFM_EVT (2 + AVDTC_EVT_BEGIN) |
Myles Watson | 9ca0709 | 2016-11-28 16:41:53 -0800 | [diff] [blame] | 41 | /* Get configuration indication */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 42 | #define AVDTC_GETCONFIG_IND_EVT (3 + AVDTC_EVT_BEGIN) |
Myles Watson | 9ca0709 | 2016-11-28 16:41:53 -0800 | [diff] [blame] | 43 | /* Get configuration confirm */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 44 | #define AVDTC_GETCONFIG_CFM_EVT (4 + AVDTC_EVT_BEGIN) |
Myles Watson | 9ca0709 | 2016-11-28 16:41:53 -0800 | [diff] [blame] | 45 | /* Open indication */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 46 | #define AVDTC_OPEN_IND_EVT (5 + AVDTC_EVT_BEGIN) |
Myles Watson | 9ca0709 | 2016-11-28 16:41:53 -0800 | [diff] [blame] | 47 | /* Start indication */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 48 | #define AVDTC_START_IND_EVT (6 + AVDTC_EVT_BEGIN) |
Myles Watson | 9ca0709 | 2016-11-28 16:41:53 -0800 | [diff] [blame] | 49 | /* Close indication */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 50 | #define AVDTC_CLOSE_IND_EVT (7 + AVDTC_EVT_BEGIN) |
Myles Watson | 9ca0709 | 2016-11-28 16:41:53 -0800 | [diff] [blame] | 51 | /* Suspend indication */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 52 | #define AVDTC_SUSPEND_IND_EVT (8 + AVDTC_EVT_BEGIN) |
Myles Watson | 9ca0709 | 2016-11-28 16:41:53 -0800 | [diff] [blame] | 53 | /* Abort indication */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 54 | #define AVDTC_ABORT_IND_EVT (9 + AVDTC_EVT_BEGIN) |
Myles Watson | 9ca0709 | 2016-11-28 16:41:53 -0800 | [diff] [blame] | 55 | /* Abort confirm */ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 56 | #define AVDTC_ABORT_CFM_EVT (10 + AVDTC_EVT_BEGIN) |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 57 | |
| 58 | typedef struct { |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 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 */ |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 62 | } tAVDT_MULTI; |
| 63 | |
| 64 | /* Union of all control callback event data structures */ |
| 65 | typedef union { |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 66 | tAVDT_EVT_HDR hdr; |
| 67 | tAVDT_CONFIG getconfig_cfm; |
| 68 | tAVDT_MULTI start_ind; |
| 69 | tAVDT_MULTI suspend_ind; |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 70 | } tAVDTC_CTRL; |
| 71 | |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame^] | 72 | typedef void tAVDTC_CTRL_CBACK(uint8_t handle, const RawAddress& bd_addr, |
Jakub Pawlowski | b8a477e | 2017-06-16 15:16:15 -0700 | [diff] [blame] | 73 | uint8_t event, tAVDTC_CTRL* p_data); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 74 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 75 | /******************************************************************************* |
Myles Watson | ee96a3c | 2016-11-23 14:49:54 -0800 | [diff] [blame] | 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 | ******************************************************************************/ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 86 | extern void AVDTC_Init(tAVDTC_CTRL_CBACK* p_cback); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 87 | |
| 88 | /******************************************************************************* |
Myles Watson | ee96a3c | 2016-11-23 14:49:54 -0800 | [diff] [blame] | 89 | * |
| 90 | * Function AVDTC_DiscoverRsp |
| 91 | * |
| 92 | * Description Send a discover response. |
| 93 | * |
| 94 | * Returns void |
| 95 | * |
| 96 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame^] | 97 | extern void AVDTC_DiscoverRsp(const RawAddress& bd_addr, uint8_t label, |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame] | 98 | tAVDT_SEP_INFO sep_info[], uint8_t num_seps); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 99 | |
| 100 | /******************************************************************************* |
Myles Watson | ee96a3c | 2016-11-23 14:49:54 -0800 | [diff] [blame] | 101 | * |
| 102 | * Function AVDTC_GetCapRsp |
| 103 | * |
| 104 | * Description Send a get capabilities response. |
| 105 | * |
| 106 | * Returns void |
| 107 | * |
| 108 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame^] | 109 | extern void AVDTC_GetCapRsp(const RawAddress& bd_addr, uint8_t label, |
Jakub Pawlowski | b8a477e | 2017-06-16 15:16:15 -0700 | [diff] [blame] | 110 | tAVDT_CFG* p_cap); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 111 | |
| 112 | /******************************************************************************* |
Myles Watson | ee96a3c | 2016-11-23 14:49:54 -0800 | [diff] [blame] | 113 | * |
| 114 | * Function AVDTC_GetAllCapRsp |
| 115 | * |
| 116 | * Description Send a get all capabilities response. |
| 117 | * |
| 118 | * Returns void |
| 119 | * |
| 120 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame^] | 121 | extern void AVDTC_GetAllCapRsp(const RawAddress& bd_addr, uint8_t label, |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 122 | tAVDT_CFG* p_cap); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 123 | |
| 124 | /******************************************************************************* |
Myles Watson | ee96a3c | 2016-11-23 14:49:54 -0800 | [diff] [blame] | 125 | * |
| 126 | * Function AVDTC_GetConfigReq |
| 127 | * |
| 128 | * Description Send a get configuration request. |
| 129 | * |
| 130 | * Returns void |
| 131 | * |
| 132 | ******************************************************************************/ |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame] | 133 | extern void AVDTC_GetConfigReq(uint8_t handle); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 134 | |
| 135 | /******************************************************************************* |
Myles Watson | ee96a3c | 2016-11-23 14:49:54 -0800 | [diff] [blame] | 136 | * |
| 137 | * Function AVDTC_GetConfigRsp |
| 138 | * |
| 139 | * Description Send a get configuration response. |
| 140 | * |
| 141 | * Returns void |
| 142 | * |
| 143 | ******************************************************************************/ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 144 | extern void AVDTC_GetConfigRsp(uint8_t handle, uint8_t label, tAVDT_CFG* p_cfg); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 145 | |
| 146 | /******************************************************************************* |
Myles Watson | ee96a3c | 2016-11-23 14:49:54 -0800 | [diff] [blame] | 147 | * |
| 148 | * Function AVDTC_OpenReq |
| 149 | * |
| 150 | * Description Send an open request. |
| 151 | * |
| 152 | * Returns void |
| 153 | * |
| 154 | ******************************************************************************/ |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame] | 155 | extern void AVDTC_OpenReq(uint8_t handle); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 156 | |
| 157 | /******************************************************************************* |
Myles Watson | ee96a3c | 2016-11-23 14:49:54 -0800 | [diff] [blame] | 158 | * |
| 159 | * Function AVDTC_OpenRsp |
| 160 | * |
| 161 | * Description Send an open response. |
| 162 | * |
| 163 | * Returns void |
| 164 | * |
| 165 | ******************************************************************************/ |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame] | 166 | extern void AVDTC_OpenRsp(uint8_t handle, uint8_t label); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 167 | |
| 168 | /******************************************************************************* |
Myles Watson | ee96a3c | 2016-11-23 14:49:54 -0800 | [diff] [blame] | 169 | * |
| 170 | * Function AVDTC_StartRsp |
| 171 | * |
| 172 | * Description Send a start response. |
| 173 | * |
| 174 | * Returns void |
| 175 | * |
| 176 | ******************************************************************************/ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 177 | extern void AVDTC_StartRsp(uint8_t* p_handles, uint8_t num_handles, |
| 178 | uint8_t label); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 179 | |
| 180 | /******************************************************************************* |
Myles Watson | ee96a3c | 2016-11-23 14:49:54 -0800 | [diff] [blame] | 181 | * |
| 182 | * Function AVDTC_CloseRsp |
| 183 | * |
| 184 | * Description Send a close response. |
| 185 | * |
| 186 | * Returns void |
| 187 | * |
| 188 | ******************************************************************************/ |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame] | 189 | extern void AVDTC_CloseRsp(uint8_t handle, uint8_t label); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 190 | |
| 191 | /******************************************************************************* |
Myles Watson | ee96a3c | 2016-11-23 14:49:54 -0800 | [diff] [blame] | 192 | * |
| 193 | * Function AVDTC_SuspendRsp |
| 194 | * |
| 195 | * Description Send a suspend response. |
| 196 | * |
| 197 | * Returns void |
| 198 | * |
| 199 | ******************************************************************************/ |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 200 | extern void AVDTC_SuspendRsp(uint8_t* p_handles, uint8_t num_handles, |
| 201 | uint8_t label); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 202 | |
| 203 | /******************************************************************************* |
Myles Watson | ee96a3c | 2016-11-23 14:49:54 -0800 | [diff] [blame] | 204 | * |
| 205 | * Function AVDTC_AbortReq |
| 206 | * |
| 207 | * Description Send an abort request. |
| 208 | * |
| 209 | * Returns void |
| 210 | * |
| 211 | ******************************************************************************/ |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame] | 212 | extern void AVDTC_AbortReq(uint8_t handle); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 213 | |
| 214 | /******************************************************************************* |
Myles Watson | ee96a3c | 2016-11-23 14:49:54 -0800 | [diff] [blame] | 215 | * |
| 216 | * Function AVDTC_AbortRsp |
| 217 | * |
| 218 | * Description Send an abort response. |
| 219 | * |
| 220 | * Returns void |
| 221 | * |
| 222 | ******************************************************************************/ |
Marie Janssen | d19e078 | 2016-07-15 12:48:27 -0700 | [diff] [blame] | 223 | extern void AVDTC_AbortRsp(uint8_t handle, uint8_t label); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 224 | |
| 225 | /******************************************************************************* |
Myles Watson | ee96a3c | 2016-11-23 14:49:54 -0800 | [diff] [blame] | 226 | * |
| 227 | * Function AVDTC_Rej |
| 228 | * |
| 229 | * Description Send a reject message. |
| 230 | * |
| 231 | * Returns void |
| 232 | * |
| 233 | ******************************************************************************/ |
Jakub Pawlowski | a484a88 | 2017-06-24 17:30:18 -0700 | [diff] [blame^] | 234 | extern void AVDTC_Rej(uint8_t handle, const RawAddress& bd_addr, uint8_t cmd, |
Myles Watson | 911d1ae | 2016-11-28 16:44:40 -0800 | [diff] [blame] | 235 | uint8_t label, uint8_t err_code, uint8_t err_param); |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 236 | |
The Android Open Source Project | 5738f83 | 2012-12-12 16:00:35 -0800 | [diff] [blame] | 237 | #endif /* AVDT_CAPI_H */ |