1 /*
2  * Copyright 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 /*
19  * Generated mock file from original source file
20  *   Functions generated:24
21  *
22  *  mockcify.pl ver 0.6.3
23  */
24 
25 #include <cstdint>
26 #include <functional>
27 
28 // Original included files, if any
29 // NOTE: Since this is a mock file with mock definitions some number of
30 //       include files may not be required.  The include-what-you-use
31 //       still applies, but crafting proper inclusion is out of scope
32 //       for this effort.  This compilation unit may compile as-is, or
33 //       may need attention to prune from (or add to ) the inclusion set.
34 #include "bta/av/bta_av_int.h"
35 #include "btif/include/btif_av.h"
36 #include "os/log.h"
37 #include "osi/include/allocator.h"
38 #include "osi/include/compat.h"
39 #include "stack/include/bt_hdr.h"
40 #include "stack/include/bt_uuid16.h"
41 #include "types/raw_address.h"
42 
43 // Original usings
44 
45 // Mocked compile conditionals, if any
46 
47 namespace test {
48 namespace mock {
49 namespace bta_av_api {
50 
51 // Shared state between mocked functions and tests
52 // Name: BTA_AvClose
53 // Params: tBTA_AV_HNDL handle
54 // Return: void
55 struct BTA_AvClose {
56   std::function<void(tBTA_AV_HNDL handle)> body{
57       [](tBTA_AV_HNDL /* handle */) {}};
operatorBTA_AvClose58   void operator()(tBTA_AV_HNDL handle) { body(handle); };
59 };
60 extern struct BTA_AvClose BTA_AvClose;
61 
62 // Name: BTA_AvCloseRc
63 // Params: uint8_t rc_handle
64 // Return: void
65 struct BTA_AvCloseRc {
66   std::function<void(uint8_t rc_handle)> body{[](uint8_t /* rc_handle */) {}};
operatorBTA_AvCloseRc67   void operator()(uint8_t rc_handle) { body(rc_handle); };
68 };
69 extern struct BTA_AvCloseRc BTA_AvCloseRc;
70 
71 // Name: BTA_AvDeregister
72 // Params: tBTA_AV_HNDL hndl
73 // Return: void
74 struct BTA_AvDeregister {
75   std::function<void(tBTA_AV_HNDL hndl)> body{[](tBTA_AV_HNDL /* hndl */) {}};
operatorBTA_AvDeregister76   void operator()(tBTA_AV_HNDL hndl) { body(hndl); };
77 };
78 extern struct BTA_AvDeregister BTA_AvDeregister;
79 
80 // Name: BTA_AvDisable
81 // Params: void
82 // Return: void
83 struct BTA_AvDisable {
84   std::function<void(void)> body{[](void) {}};
operatorBTA_AvDisable85   void operator()(void) { body(); };
86 };
87 extern struct BTA_AvDisable BTA_AvDisable;
88 
89 // Name: BTA_AvDisconnect
90 // Params: tBTA_AV_HNDL handle
91 // Return: void
92 struct BTA_AvDisconnect {
93   std::function<void(tBTA_AV_HNDL handle)> body{
94       [](tBTA_AV_HNDL /* handle */) {}};
operatorBTA_AvDisconnect95   void operator()(tBTA_AV_HNDL handle) { body(handle); };
96 };
97 extern struct BTA_AvDisconnect BTA_AvDisconnect;
98 
99 // Name: BTA_AvEnable
100 // Params: tBTA_AV_FEAT features, tBTA_AV_CBACK* p_cback
101 // Return: void
102 struct BTA_AvEnable {
103   std::function<void(tBTA_AV_FEAT features, tBTA_AV_CBACK* p_cback)> body{
104       [](tBTA_AV_FEAT /* features */, tBTA_AV_CBACK* /* p_cback */) {}};
operatorBTA_AvEnable105   void operator()(tBTA_AV_FEAT features, tBTA_AV_CBACK* p_cback) {
106     body(features, p_cback);
107   };
108 };
109 extern struct BTA_AvEnable BTA_AvEnable;
110 
111 // Name: BTA_AvMetaCmd
112 // Params: uint8_t rc_handle, uint8_t label, tBTA_AV_CMD cmd_code, BT_HDR* p_pkt
113 // Return: void
114 struct BTA_AvMetaCmd {
115   std::function<void(uint8_t rc_handle, uint8_t label, tBTA_AV_CMD cmd_code,
116                      BT_HDR* p_pkt)>
117       body{[](uint8_t /* rc_handle */, uint8_t /* label */,
118               tBTA_AV_CMD /* cmd_code */, BT_HDR* /* p_pkt */) {}};
operatorBTA_AvMetaCmd119   void operator()(uint8_t rc_handle, uint8_t label, tBTA_AV_CMD cmd_code,
120                   BT_HDR* p_pkt) {
121     body(rc_handle, label, cmd_code, p_pkt);
122   };
123 };
124 extern struct BTA_AvMetaCmd BTA_AvMetaCmd;
125 
126 // Name: BTA_AvMetaRsp
127 // Params: uint8_t rc_handle, uint8_t label, tBTA_AV_CODE rsp_code, BT_HDR*
128 // p_pkt Return: void
129 struct BTA_AvMetaRsp {
130   std::function<void(uint8_t rc_handle, uint8_t label, tBTA_AV_CODE rsp_code,
131                      BT_HDR* p_pkt)>
132       body{[](uint8_t /* rc_handle */, uint8_t /* label */,
133               tBTA_AV_CODE /* rsp_code */, BT_HDR* /* p_pkt */) {}};
operatorBTA_AvMetaRsp134   void operator()(uint8_t rc_handle, uint8_t label, tBTA_AV_CODE rsp_code,
135                   BT_HDR* p_pkt) {
136     body(rc_handle, label, rsp_code, p_pkt);
137   };
138 };
139 extern struct BTA_AvMetaRsp BTA_AvMetaRsp;
140 
141 // Name: BTA_AvOffloadStart
142 // Params: tBTA_AV_HNDL hndl
143 // Return: void
144 struct BTA_AvOffloadStart {
145   std::function<void(tBTA_AV_HNDL hndl)> body{[](tBTA_AV_HNDL /* hndl */) {}};
operatorBTA_AvOffloadStart146   void operator()(tBTA_AV_HNDL hndl) { body(hndl); };
147 };
148 extern struct BTA_AvOffloadStart BTA_AvOffloadStart;
149 
150 // Name: BTA_AvOpen
151 // Params: const RawAddress& bd_addr, tBTA_AV_HNDL handle, bool use_rc, uint16_t
152 // uuid Return: void
153 struct BTA_AvOpen {
154   std::function<void(const RawAddress& bd_addr, tBTA_AV_HNDL handle,
155                      bool use_rc, uint16_t uuid)>
156       body{[](const RawAddress& /* bd_addr */, tBTA_AV_HNDL /* handle */,
157               bool /* use_rc */, uint16_t /* uuid */) {}};
operatorBTA_AvOpen158   void operator()(const RawAddress& bd_addr, tBTA_AV_HNDL handle, bool use_rc,
159                   uint16_t uuid) {
160     body(bd_addr, handle, use_rc, uuid);
161   };
162 };
163 extern struct BTA_AvOpen BTA_AvOpen;
164 
165 // Name: BTA_AvOpenRc
166 // Params: tBTA_AV_HNDL handle
167 // Return: void
168 struct BTA_AvOpenRc {
169   std::function<void(tBTA_AV_HNDL handle)> body{
170       [](tBTA_AV_HNDL /* handle */) {}};
operatorBTA_AvOpenRc171   void operator()(tBTA_AV_HNDL handle) { body(handle); };
172 };
173 extern struct BTA_AvOpenRc BTA_AvOpenRc;
174 
175 // Name: BTA_AvProtectReq
176 // Params: tBTA_AV_HNDL hndl, uint8_t* p_data, uint16_t len
177 // Return: void
178 struct BTA_AvProtectReq {
179   std::function<void(tBTA_AV_HNDL hndl, uint8_t* p_data, uint16_t len)> body{
180       [](tBTA_AV_HNDL /* hndl */, uint8_t* /* p_data */, uint16_t /* len */) {
181       }};
operatorBTA_AvProtectReq182   void operator()(tBTA_AV_HNDL hndl, uint8_t* p_data, uint16_t len) {
183     body(hndl, p_data, len);
184   };
185 };
186 extern struct BTA_AvProtectReq BTA_AvProtectReq;
187 
188 // Name: BTA_AvProtectRsp
189 // Params: tBTA_AV_HNDL hndl, uint8_t error_code, uint8_t* p_data, uint16_t len
190 // Return: void
191 struct BTA_AvProtectRsp {
192   std::function<void(tBTA_AV_HNDL hndl, uint8_t error_code, uint8_t* p_data,
193                      uint16_t len)>
194       body{[](tBTA_AV_HNDL /* hndl */, uint8_t /* error_code */,
195               uint8_t* /* p_data */, uint16_t /* len */) {}};
operatorBTA_AvProtectRsp196   void operator()(tBTA_AV_HNDL hndl, uint8_t error_code, uint8_t* p_data,
197                   uint16_t len) {
198     body(hndl, error_code, p_data, len);
199   };
200 };
201 extern struct BTA_AvProtectRsp BTA_AvProtectRsp;
202 
203 // Name: BTA_AvReconfig
204 // Params: tBTA_AV_HNDL hndl, bool suspend, uint8_t sep_info_idx, uint8_t*
205 // p_codec_info, uint8_t num_protect, const uint8_t* p_protect_info Return: void
206 struct BTA_AvReconfig {
207   std::function<void(tBTA_AV_HNDL hndl, bool suspend, uint8_t sep_info_idx,
208                      uint8_t* p_codec_info, uint8_t num_protect,
209                      const uint8_t* p_protect_info)>
210       body{[](tBTA_AV_HNDL /* hndl */, bool /* suspend */,
211               uint8_t /* sep_info_idx */, uint8_t* /* p_codec_info */,
212               uint8_t /* num_protect */,
213               const uint8_t* /* p_protect_info */) {}};
operatorBTA_AvReconfig214   void operator()(tBTA_AV_HNDL hndl, bool suspend, uint8_t sep_info_idx,
215                   uint8_t* p_codec_info, uint8_t num_protect,
216                   const uint8_t* p_protect_info) {
217     body(hndl, suspend, sep_info_idx, p_codec_info, num_protect,
218          p_protect_info);
219   };
220 };
221 extern struct BTA_AvReconfig BTA_AvReconfig;
222 
223 // Name: BTA_AvRegister
224 // Params: tBTA_AV_CHNL chnl, const char* p_service_name, uint8_t app_id,
225 // tBTA_AV_SINK_DATA_CBACK* p_sink_data_cback, uint16_t service_uuid Return:
226 // void
227 struct BTA_AvRegister {
228   std::function<void(tBTA_AV_CHNL chnl, const char* p_service_name,
229                      uint8_t app_id, tBTA_AV_SINK_DATA_CBACK* p_sink_data_cback,
230                      uint16_t service_uuid)>
231       body{[](tBTA_AV_CHNL /* chnl */, const char* /* p_service_name */,
232               uint8_t /* app_id */,
233               tBTA_AV_SINK_DATA_CBACK* /* p_sink_data_cback */,
234               uint16_t /* service_uuid */) {}};
operatorBTA_AvRegister235   void operator()(tBTA_AV_CHNL chnl, const char* p_service_name, uint8_t app_id,
236                   tBTA_AV_SINK_DATA_CBACK* p_sink_data_cback,
237                   uint16_t service_uuid) {
238     body(chnl, p_service_name, app_id, p_sink_data_cback, service_uuid);
239   };
240 };
241 extern struct BTA_AvRegister BTA_AvRegister;
242 
243 // Name: BTA_AvRemoteCmd
244 // Params: uint8_t rc_handle, uint8_t label, tBTA_AV_RC rc_id, tBTA_AV_STATE
245 // key_state Return: void
246 struct BTA_AvRemoteCmd {
247   std::function<void(uint8_t rc_handle, uint8_t label, tBTA_AV_RC rc_id,
248                      tBTA_AV_STATE key_state)>
249       body{[](uint8_t /* rc_handle */, uint8_t /* label */,
250               tBTA_AV_RC /* rc_id */, tBTA_AV_STATE /* key_state */) {}};
operatorBTA_AvRemoteCmd251   void operator()(uint8_t rc_handle, uint8_t label, tBTA_AV_RC rc_id,
252                   tBTA_AV_STATE key_state) {
253     body(rc_handle, label, rc_id, key_state);
254   };
255 };
256 extern struct BTA_AvRemoteCmd BTA_AvRemoteCmd;
257 
258 // Name: BTA_AvRemoteVendorUniqueCmd
259 // Params: uint8_t rc_handle, uint8_t label, tBTA_AV_STATE key_state, uint8_t*
260 // p_msg, uint8_t buf_len Return: void
261 struct BTA_AvRemoteVendorUniqueCmd {
262   std::function<void(uint8_t rc_handle, uint8_t label, tBTA_AV_STATE key_state,
263                      uint8_t* p_msg, uint8_t buf_len)>
264       body{[](uint8_t /* rc_handle */, uint8_t /* label */,
265               tBTA_AV_STATE /* key_state */, uint8_t* /* p_msg */,
266               uint8_t /* buf_len */) {}};
operatorBTA_AvRemoteVendorUniqueCmd267   void operator()(uint8_t rc_handle, uint8_t label, tBTA_AV_STATE key_state,
268                   uint8_t* p_msg, uint8_t buf_len) {
269     body(rc_handle, label, key_state, p_msg, buf_len);
270   };
271 };
272 extern struct BTA_AvRemoteVendorUniqueCmd BTA_AvRemoteVendorUniqueCmd;
273 
274 // Name: BTA_AvSetLatency
275 // Params: tBTA_AV_HNDL handle, bool is_low_latency
276 // Return: void
277 struct BTA_AvSetLatency {
278   std::function<void(tBTA_AV_HNDL handle, bool is_low_latency)> body{
279       [](tBTA_AV_HNDL /* handle */, bool /* is_low_latency */) {}};
operatorBTA_AvSetLatency280   void operator()(tBTA_AV_HNDL handle, bool is_low_latency) {
281     body(handle, is_low_latency);
282   };
283 };
284 extern struct BTA_AvSetLatency BTA_AvSetLatency;
285 
286 // Name: BTA_AvSetPeerSep
287 // Params: const RawAddress& bdaddr, uint8_t sep
288 // Return: void
289 struct BTA_AvSetPeerSep {
290   std::function<void(const RawAddress& bdaddr, uint8_t sep)> body{
291       [](const RawAddress& /* bdaddr */, uint8_t /* sep */) {}};
operatorBTA_AvSetPeerSep292   void operator()(const RawAddress& bdaddr, uint8_t sep) { body(bdaddr, sep); };
293 };
294 extern struct BTA_AvSetPeerSep BTA_AvSetPeerSep;
295 
296 // Name: BTA_AvStart
297 // Params: tBTA_AV_HNDL handle, bool use_latency_mode
298 // Return: void
299 struct BTA_AvStart {
300   std::function<void(tBTA_AV_HNDL handle, bool use_latency_mode)> body{
301       [](tBTA_AV_HNDL /* handle */, bool /* use_latency_mode */) {}};
operatorBTA_AvStart302   void operator()(tBTA_AV_HNDL handle, bool use_latency_mode) {
303     body(handle, use_latency_mode);
304   };
305 };
306 extern struct BTA_AvStart BTA_AvStart;
307 
308 // Name: BTA_AvStop
309 // Params: tBTA_AV_HNDL handle, bool suspend
310 // Return: void
311 struct BTA_AvStop {
312   std::function<void(tBTA_AV_HNDL handle, bool suspend)> body{
313       [](tBTA_AV_HNDL /* handle */, bool /* suspend */) {}};
operatorBTA_AvStop314   void operator()(tBTA_AV_HNDL handle, bool suspend) { body(handle, suspend); };
315 };
316 extern struct BTA_AvStop BTA_AvStop;
317 
318 // Name: BTA_AvVendorCmd
319 // Params: uint8_t rc_handle, uint8_t label, tBTA_AV_CODE cmd_code, uint8_t*
320 // p_data, uint16_t len Return: void
321 struct BTA_AvVendorCmd {
322   std::function<void(uint8_t rc_handle, uint8_t label, tBTA_AV_CODE cmd_code,
323                      uint8_t* p_data, uint16_t len)>
324       body{[](uint8_t /* rc_handle */, uint8_t /* label */,
325               tBTA_AV_CODE /* cmd_code */, uint8_t* /* p_data */,
326               uint16_t /* len */) {}};
operatorBTA_AvVendorCmd327   void operator()(uint8_t rc_handle, uint8_t label, tBTA_AV_CODE cmd_code,
328                   uint8_t* p_data, uint16_t len) {
329     body(rc_handle, label, cmd_code, p_data, len);
330   };
331 };
332 extern struct BTA_AvVendorCmd BTA_AvVendorCmd;
333 
334 // Name: BTA_AvVendorRsp
335 // Params: uint8_t rc_handle, uint8_t label, tBTA_AV_CODE rsp_code, uint8_t*
336 // p_data, uint16_t len, uint32_t company_id Return: void
337 struct BTA_AvVendorRsp {
338   std::function<void(uint8_t rc_handle, uint8_t label, tBTA_AV_CODE rsp_code,
339                      uint8_t* p_data, uint16_t len, uint32_t company_id)>
340       body{[](uint8_t /* rc_handle */, uint8_t /* label */,
341               tBTA_AV_CODE /* rsp_code */, uint8_t* /* p_data */,
342               uint16_t /* len */, uint32_t /* company_id */) {}};
operatorBTA_AvVendorRsp343   void operator()(uint8_t rc_handle, uint8_t label, tBTA_AV_CODE rsp_code,
344                   uint8_t* p_data, uint16_t len, uint32_t company_id) {
345     body(rc_handle, label, rsp_code, p_data, len, company_id);
346   };
347 };
348 extern struct BTA_AvVendorRsp BTA_AvVendorRsp;
349 
350 }  // namespace bta_av_api
351 }  // namespace mock
352 }  // namespace test
353 
354 // END mockcify generation
355