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