1 /*
2  * Copyright 2021 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 
17 /*
18  * Generated mock file from original source file
19  *   Functions generated:45
20  *
21  *  mockcify.pl ver 0.2
22  */
23 
24 #include <cstdint>
25 #include <functional>
26 #include <map>
27 #include <string>
28 
29 extern std::map<std::string, int> mock_function_count_map;
30 
31 // Original included files, if any
32 // NOTE: Since this is a mock file with mock definitions some number of
33 //       include files may not be required.  The include-what-you-use
34 //       still applies, but crafting proper inclusion is out of scope
35 //       for this effort.  This compilation unit may compile as-is, or
36 //       may need attention to prune the inclusion set.
37 #include "gd/module.h"
38 
39 #include <future>
40 #include <unordered_map>
41 #include <unordered_set>
42 #include "bta/include/bta_dm_acl.h"
43 #include "gd/l2cap/classic/l2cap_classic_module.h"
44 #include "gd/l2cap/le/l2cap_le_module.h"
45 #include "gd/os/log.h"
46 #include "gd/os/queue.h"
47 #include "main/shim/acl_api.h"
48 #include "main/shim/btm.h"
49 #include "main/shim/entry.h"
50 #include "main/shim/helpers.h"
51 #include "main/shim/l2c_api.h"
52 #include "main/shim/stack.h"
53 #include "osi/include/allocator.h"
54 #include "stack/btm/btm_ble_int.h"
55 #include "stack/btm/btm_sec.h"
56 #include "stack/include/acl_hci_link_interface.h"
57 #include "stack/include/ble_acl_interface.h"
58 #include "stack/include/btm_api.h"
59 #include "stack/include/btu.h"
60 #include "stack/include/gatt_api.h"
61 #include "stack/include/sco_hci_link_interface.h"
62 
63 // Mocked compile conditionals, if any
64 #ifndef UNUSED_ATTR
65 #define UNUSED_ATTR
66 #endif
67 
68 namespace test {
69 namespace mock {
70 namespace main_shim_l2cap_api {
71 
72 // Shared state between mocked functions and tests
73 // Name: L2CA_ReadRemoteVersion
74 // Params: const RawAddress& addr, uint8_t* lmp_version, uint16_t* manufacturer,
75 // uint16_t* lmp_sub_version Returns: bool
76 struct L2CA_ReadRemoteVersion {
77   std::function<bool(const RawAddress& addr, uint8_t* lmp_version,
78                      uint16_t* manufacturer, uint16_t* lmp_sub_version)>
79       body{[](const RawAddress& addr, uint8_t* lmp_version,
80               uint16_t* manufacturer,
81               uint16_t* lmp_sub_version) { return false; }};
operatorL2CA_ReadRemoteVersion82   bool operator()(const RawAddress& addr, uint8_t* lmp_version,
83                   uint16_t* manufacturer, uint16_t* lmp_sub_version) {
84     return body(addr, lmp_version, manufacturer, lmp_sub_version);
85   };
86 };
87 extern struct L2CA_ReadRemoteVersion L2CA_ReadRemoteVersion;
88 // Name: L2CA_ReadRemoteFeatures
89 // Params: const RawAddress& addr
90 // Returns: uint8_t*
91 struct L2CA_ReadRemoteFeatures {
92   std::function<uint8_t*(const RawAddress& addr)> body{
93       [](const RawAddress& addr) { return nullptr; }};
operatorL2CA_ReadRemoteFeatures94   uint8_t* operator()(const RawAddress& addr) { return body(addr); };
95 };
96 extern struct L2CA_ReadRemoteFeatures L2CA_ReadRemoteFeatures;
97 // Name: L2CA_UseLegacySecurityModule
98 // Params:
99 // Returns: void
100 struct L2CA_UseLegacySecurityModule {
101   std::function<void()> body{[]() {}};
operatorL2CA_UseLegacySecurityModule102   void operator()() { body(); };
103 };
104 extern struct L2CA_UseLegacySecurityModule L2CA_UseLegacySecurityModule;
105 // Name: L2CA_Register
106 // Params: uint16_t client_psm, const tL2CAP_APPL_INFO& callbacks, bool
107 // enable_snoop, tL2CAP_ERTM_INFO* p_ertm_info, uint16_t my_mtu, uint16_t
108 // required_remote_mtu, uint16_t sec_level Returns: uint16_t
109 struct L2CA_Register {
110   std::function<uint16_t(uint16_t client_psm, const tL2CAP_APPL_INFO& callbacks,
111                          bool enable_snoop, tL2CAP_ERTM_INFO* p_ertm_info,
112                          uint16_t my_mtu, uint16_t required_remote_mtu,
113                          uint16_t sec_level)>
114       body{[](uint16_t client_psm, const tL2CAP_APPL_INFO& callbacks,
115               bool enable_snoop, tL2CAP_ERTM_INFO* p_ertm_info, uint16_t my_mtu,
116               uint16_t required_remote_mtu, uint16_t sec_level) { return 0; }};
operatorL2CA_Register117   uint16_t operator()(uint16_t client_psm, const tL2CAP_APPL_INFO& callbacks,
118                       bool enable_snoop, tL2CAP_ERTM_INFO* p_ertm_info,
119                       uint16_t my_mtu, uint16_t required_remote_mtu,
120                       uint16_t sec_level) {
121     return body(client_psm, callbacks, enable_snoop, p_ertm_info, my_mtu,
122                 required_remote_mtu, sec_level);
123   };
124 };
125 extern struct L2CA_Register L2CA_Register;
126 // Name: L2CA_Deregister
127 // Params: uint16_t psm
128 // Returns: void
129 struct L2CA_Deregister {
130   std::function<void(uint16_t psm)> body{[](uint16_t psm) {}};
operatorL2CA_Deregister131   void operator()(uint16_t psm) { body(psm); };
132 };
133 extern struct L2CA_Deregister L2CA_Deregister;
134 // Name: L2CA_ConnectReq
135 // Params: uint16_t psm, const RawAddress& raw_address
136 // Returns: uint16_t
137 struct L2CA_ConnectReq {
138   std::function<uint16_t(uint16_t psm, const RawAddress& raw_address)> body{
139       [](uint16_t psm, const RawAddress& raw_address) { return 0; }};
operatorL2CA_ConnectReq140   uint16_t operator()(uint16_t psm, const RawAddress& raw_address) {
141     return body(psm, raw_address);
142   };
143 };
144 extern struct L2CA_ConnectReq L2CA_ConnectReq;
145 // Name: L2CA_DisconnectReq
146 // Params: uint16_t cid
147 // Returns: bool
148 struct L2CA_DisconnectReq {
149   std::function<bool(uint16_t cid)> body{[](uint16_t cid) { return false; }};
operatorL2CA_DisconnectReq150   bool operator()(uint16_t cid) { return body(cid); };
151 };
152 extern struct L2CA_DisconnectReq L2CA_DisconnectReq;
153 // Name: L2CA_DataWrite
154 // Params: uint16_t cid, BT_HDR* p_data
155 // Returns: uint8_t
156 struct L2CA_DataWrite {
157   std::function<uint8_t(uint16_t cid, BT_HDR* p_data)> body{
158       [](uint16_t cid, BT_HDR* p_data) { return 0; }};
operatorL2CA_DataWrite159   uint8_t operator()(uint16_t cid, BT_HDR* p_data) {
160     return body(cid, p_data);
161   };
162 };
163 extern struct L2CA_DataWrite L2CA_DataWrite;
164 // Name: L2CA_ReconfigCreditBasedConnsReq
165 // Params: const RawAddress& bd_addr, std::vector<uint16_t>& lcids,
166 // tL2CAP_LE_CFG_INFO* p_cfg Returns: bool
167 struct L2CA_ReconfigCreditBasedConnsReq {
168   std::function<bool(const RawAddress& bd_addr, std::vector<uint16_t>& lcids,
169                      tL2CAP_LE_CFG_INFO* p_cfg)>
170       body{[](const RawAddress& bd_addr, std::vector<uint16_t>& lcids,
171               tL2CAP_LE_CFG_INFO* p_cfg) { return false; }};
operatorL2CA_ReconfigCreditBasedConnsReq172   bool operator()(const RawAddress& bd_addr, std::vector<uint16_t>& lcids,
173                   tL2CAP_LE_CFG_INFO* p_cfg) {
174     return body(bd_addr, lcids, p_cfg);
175   };
176 };
177 extern struct L2CA_ReconfigCreditBasedConnsReq L2CA_ReconfigCreditBasedConnsReq;
178 // Name: L2CA_ConnectCreditBasedReq
179 // Params: uint16_t psm, const RawAddress& p_bd_addr, tL2CAP_LE_CFG_INFO* p_cfg
180 // Returns: std::vector<uint16_t>
181 struct L2CA_ConnectCreditBasedReq {
182   std::vector<uint16_t> cids;
183   std::function<std::vector<uint16_t>(uint16_t psm, const RawAddress& p_bd_addr,
184                                       tL2CAP_LE_CFG_INFO* p_cfg)>
185       body{[this](uint16_t psm, const RawAddress& p_bd_addr,
186                   tL2CAP_LE_CFG_INFO* p_cfg) { return cids; }};
operatorL2CA_ConnectCreditBasedReq187   std::vector<uint16_t> operator()(uint16_t psm, const RawAddress& p_bd_addr,
188                                    tL2CAP_LE_CFG_INFO* p_cfg) {
189     return body(psm, p_bd_addr, p_cfg);
190   };
191 };
192 extern struct L2CA_ConnectCreditBasedReq L2CA_ConnectCreditBasedReq;
193 // Name: L2CA_ConnectCreditBasedRsp
194 // Params: const RawAddress& bd_addr, uint8_t id, std::vector<uint16_t>&
195 // accepted_lcids, uint16_t result, tL2CAP_LE_CFG_INFO* p_cfg Returns: bool
196 struct L2CA_ConnectCreditBasedRsp {
197   std::function<bool(const RawAddress& bd_addr, uint8_t id,
198                      std::vector<uint16_t>& accepted_lcids, uint16_t result,
199                      tL2CAP_LE_CFG_INFO* p_cfg)>
200       body{[](const RawAddress& bd_addr, uint8_t id,
201               std::vector<uint16_t>& accepted_lcids, uint16_t result,
202               tL2CAP_LE_CFG_INFO* p_cfg) { return false; }};
operatorL2CA_ConnectCreditBasedRsp203   bool operator()(const RawAddress& bd_addr, uint8_t id,
204                   std::vector<uint16_t>& accepted_lcids, uint16_t result,
205                   tL2CAP_LE_CFG_INFO* p_cfg) {
206     return body(bd_addr, id, accepted_lcids, result, p_cfg);
207   };
208 };
209 extern struct L2CA_ConnectCreditBasedRsp L2CA_ConnectCreditBasedRsp;
210 // Name: L2CA_SetIdleTimeoutByBdAddr
211 // Params: const RawAddress& bd_addr, uint16_t timeout, tBT_TRANSPORT transport
212 // Returns: bool
213 struct L2CA_SetIdleTimeoutByBdAddr {
214   std::function<bool(const RawAddress& bd_addr, uint16_t timeout,
215                      tBT_TRANSPORT transport)>
216       body{[](const RawAddress& bd_addr, uint16_t timeout,
217               tBT_TRANSPORT transport) { return false; }};
operatorL2CA_SetIdleTimeoutByBdAddr218   bool operator()(const RawAddress& bd_addr, uint16_t timeout,
219                   tBT_TRANSPORT transport) {
220     return body(bd_addr, timeout, transport);
221   };
222 };
223 extern struct L2CA_SetIdleTimeoutByBdAddr L2CA_SetIdleTimeoutByBdAddr;
224 // Name: L2CA_SetAclPriority
225 // Params: uint16_t handle, bool high_priority
226 // Returns: bool
227 struct L2CA_SetAclPriority {
228   std::function<bool(uint16_t handle, bool high_priority)> body{
229       [](uint16_t handle, bool high_priority) { return false; }};
operatorL2CA_SetAclPriority230   bool operator()(uint16_t handle, bool high_priority) {
231     return body(handle, high_priority);
232   };
233 };
234 extern struct L2CA_SetAclPriority L2CA_SetAclPriority;
235 // Name: L2CA_SetAclPriority
236 // Params: const RawAddress& bd_addr, tL2CAP_PRIORITY priority
237 // Returns: bool
238 struct L2CA_SetAclPriority2 {
239   std::function<bool(const RawAddress& bd_addr, tL2CAP_PRIORITY priority)> body{
240       [](const RawAddress& bd_addr, tL2CAP_PRIORITY priority) {
241         return false;
242       }};
operatorL2CA_SetAclPriority2243   bool operator()(const RawAddress& bd_addr, tL2CAP_PRIORITY priority) {
244     return body(bd_addr, priority);
245   };
246 };
247 extern struct L2CA_SetAclPriority2 L2CA_SetAclPriority2;
248 // Name: L2CA_GetPeerFeatures
249 // Params: const RawAddress& bd_addr, uint32_t* p_ext_feat, uint8_t* p_chnl_mask
250 // Returns: bool
251 struct L2CA_GetPeerFeatures {
252   std::function<bool(const RawAddress& bd_addr, uint32_t* p_ext_feat,
253                      uint8_t* p_chnl_mask)>
254       body{[](const RawAddress& bd_addr, uint32_t* p_ext_feat,
255               uint8_t* p_chnl_mask) { return false; }};
operatorL2CA_GetPeerFeatures256   bool operator()(const RawAddress& bd_addr, uint32_t* p_ext_feat,
257                   uint8_t* p_chnl_mask) {
258     return body(bd_addr, p_ext_feat, p_chnl_mask);
259   };
260 };
261 extern struct L2CA_GetPeerFeatures L2CA_GetPeerFeatures;
262 // Name: L2CA_RegisterFixedChannel
263 // Params: uint16_t cid, tL2CAP_FIXED_CHNL_REG* p_freg
264 // Returns: bool
265 struct L2CA_RegisterFixedChannel {
266   std::function<bool(uint16_t cid, tL2CAP_FIXED_CHNL_REG* p_freg)> body{
267       [](uint16_t cid, tL2CAP_FIXED_CHNL_REG* p_freg) { return false; }};
operatorL2CA_RegisterFixedChannel268   bool operator()(uint16_t cid, tL2CAP_FIXED_CHNL_REG* p_freg) {
269     return body(cid, p_freg);
270   };
271 };
272 extern struct L2CA_RegisterFixedChannel L2CA_RegisterFixedChannel;
273 // Name: L2CA_ConnectFixedChnl
274 // Params: uint16_t cid, const RawAddress& rem_bda
275 // Returns: bool
276 struct L2CA_ConnectFixedChnl {
277   std::function<bool(uint16_t cid, const RawAddress& rem_bda)> body{
278       [](uint16_t cid, const RawAddress& rem_bda) { return false; }};
operatorL2CA_ConnectFixedChnl279   bool operator()(uint16_t cid, const RawAddress& rem_bda) {
280     return body(cid, rem_bda);
281   };
282 };
283 extern struct L2CA_ConnectFixedChnl L2CA_ConnectFixedChnl;
284 // Name: L2CA_SendFixedChnlData
285 // Params: uint16_t cid, const RawAddress& rem_bda, BT_HDR* p_buf
286 // Returns: uint16_t
287 struct L2CA_SendFixedChnlData {
288   std::function<uint16_t(uint16_t cid, const RawAddress& rem_bda,
289                          BT_HDR* p_buf)>
290       body{[](uint16_t cid, const RawAddress& rem_bda, BT_HDR* p_buf) {
291         return 0;
292       }};
operatorL2CA_SendFixedChnlData293   uint16_t operator()(uint16_t cid, const RawAddress& rem_bda, BT_HDR* p_buf) {
294     return body(cid, rem_bda, p_buf);
295   };
296 };
297 extern struct L2CA_SendFixedChnlData L2CA_SendFixedChnlData;
298 // Name: L2CA_RemoveFixedChnl
299 // Params: uint16_t cid, const RawAddress& rem_bda
300 // Returns: bool
301 struct L2CA_RemoveFixedChnl {
302   std::function<bool(uint16_t cid, const RawAddress& rem_bda)> body{
303       [](uint16_t cid, const RawAddress& rem_bda) { return false; }};
operatorL2CA_RemoveFixedChnl304   bool operator()(uint16_t cid, const RawAddress& rem_bda) {
305     return body(cid, rem_bda);
306   };
307 };
308 extern struct L2CA_RemoveFixedChnl L2CA_RemoveFixedChnl;
309 // Name: L2CA_GetLeHandle
310 // Params: const RawAddress& rem_bda
311 // Returns: uint16_t
312 struct L2CA_GetLeHandle {
313   std::function<uint16_t(const RawAddress& rem_bda)> body{
314       [](const RawAddress& rem_bda) { return 0; }};
operatorL2CA_GetLeHandle315   uint16_t operator()(const RawAddress& rem_bda) { return body(rem_bda); };
316 };
317 extern struct L2CA_GetLeHandle L2CA_GetLeHandle;
318 // Name: L2CA_LeConnectionUpdate
319 // Params: const RawAddress& rem_bda, uint16_t min_int, uint16_t max_int,
320 // uint16_t latency, uint16_t timeout, uint16_t min_ce_len, uint16_t max_ce_len
321 // Returns: void
322 struct L2CA_LeConnectionUpdate {
323   std::function<void(const RawAddress& rem_bda, uint16_t min_int,
324                      uint16_t max_int, uint16_t latency, uint16_t timeout,
325                      uint16_t min_ce_len, uint16_t max_ce_len)>
326       body{[](const RawAddress& rem_bda, uint16_t min_int, uint16_t max_int,
327               uint16_t latency, uint16_t timeout, uint16_t min_ce_len,
328               uint16_t max_ce_len) {}};
operatorL2CA_LeConnectionUpdate329   void operator()(const RawAddress& rem_bda, uint16_t min_int, uint16_t max_int,
330                   uint16_t latency, uint16_t timeout, uint16_t min_ce_len,
331                   uint16_t max_ce_len) {
332     body(rem_bda, min_int, max_int, latency, timeout, min_ce_len, max_ce_len);
333   };
334 };
335 extern struct L2CA_LeConnectionUpdate L2CA_LeConnectionUpdate;
336 // Name: L2CA_EnableUpdateBleConnParams
337 // Params: const RawAddress& rem_bda, bool enable
338 // Returns: bool
339 struct L2CA_EnableUpdateBleConnParams {
340   std::function<bool(const RawAddress& rem_bda, bool enable)> body{
341       [](const RawAddress& rem_bda, bool enable) { return false; }};
operatorL2CA_EnableUpdateBleConnParams342   bool operator()(const RawAddress& rem_bda, bool enable) {
343     return body(rem_bda, enable);
344   };
345 };
346 extern struct L2CA_EnableUpdateBleConnParams L2CA_EnableUpdateBleConnParams;
347 // Name: L2CA_GetRemoteCid
348 // Params: uint16_t lcid, uint16_t* rcid
349 // Returns: bool
350 struct L2CA_GetRemoteCid {
351   std::function<bool(uint16_t lcid, uint16_t* rcid)> body{
352       [](uint16_t lcid, uint16_t* rcid) { return false; }};
operatorL2CA_GetRemoteCid353   bool operator()(uint16_t lcid, uint16_t* rcid) { return body(lcid, rcid); };
354 };
355 extern struct L2CA_GetRemoteCid L2CA_GetRemoteCid;
356 // Name: L2CA_SetTxPriority
357 // Params: uint16_t cid, tL2CAP_CHNL_PRIORITY priority
358 // Returns: bool
359 struct L2CA_SetTxPriority {
360   std::function<bool(uint16_t cid, tL2CAP_CHNL_PRIORITY priority)> body{
361       [](uint16_t cid, tL2CAP_CHNL_PRIORITY priority) { return false; }};
operatorL2CA_SetTxPriority362   bool operator()(uint16_t cid, tL2CAP_CHNL_PRIORITY priority) {
363     return body(cid, priority);
364   };
365 };
366 extern struct L2CA_SetTxPriority L2CA_SetTxPriority;
367 // Name: L2CA_SetLeGattTimeout
368 // Params: const RawAddress& rem_bda, uint16_t idle_tout
369 // Returns: bool
370 struct L2CA_SetLeGattTimeout {
371   std::function<bool(const RawAddress& rem_bda, uint16_t idle_tout)> body{
372       [](const RawAddress& rem_bda, uint16_t idle_tout) { return false; }};
operatorL2CA_SetLeGattTimeout373   bool operator()(const RawAddress& rem_bda, uint16_t idle_tout) {
374     return body(rem_bda, idle_tout);
375   };
376 };
377 extern struct L2CA_SetLeGattTimeout L2CA_SetLeGattTimeout;
378 // Name: L2CA_SetChnlFlushability
379 // Params: uint16_t cid, bool is_flushable
380 // Returns: bool
381 struct L2CA_SetChnlFlushability {
382   std::function<bool(uint16_t cid, bool is_flushable)> body{
383       [](uint16_t cid, bool is_flushable) { return false; }};
operatorL2CA_SetChnlFlushability384   bool operator()(uint16_t cid, bool is_flushable) {
385     return body(cid, is_flushable);
386   };
387 };
388 extern struct L2CA_SetChnlFlushability L2CA_SetChnlFlushability;
389 // Name: L2CA_FlushChannel
390 // Params: uint16_t lcid, uint16_t num_to_flush
391 // Returns: uint16_t
392 struct L2CA_FlushChannel {
393   std::function<uint16_t(uint16_t lcid, uint16_t num_to_flush)> body{
394       [](uint16_t lcid, uint16_t num_to_flush) { return 0; }};
operatorL2CA_FlushChannel395   uint16_t operator()(uint16_t lcid, uint16_t num_to_flush) {
396     return body(lcid, num_to_flush);
397   };
398 };
399 extern struct L2CA_FlushChannel L2CA_FlushChannel;
400 // Name: L2CA_IsLinkEstablished
401 // Params: const RawAddress& bd_addr, tBT_TRANSPORT transport
402 // Returns: bool
403 struct L2CA_IsLinkEstablished {
404   std::function<bool(const RawAddress& bd_addr, tBT_TRANSPORT transport)> body{
405       [](const RawAddress& bd_addr, tBT_TRANSPORT transport) { return false; }};
operatorL2CA_IsLinkEstablished406   bool operator()(const RawAddress& bd_addr, tBT_TRANSPORT transport) {
407     return body(bd_addr, transport);
408   };
409 };
410 extern struct L2CA_IsLinkEstablished L2CA_IsLinkEstablished;
411 // Name: L2CA_IsLeLink
412 // Params: uint16_t acl_handle
413 // Returns: bool
414 struct L2CA_IsLeLink {
415   std::function<bool(uint16_t acl_handle)> body{
416       [](uint16_t acl_handle) { return false; }};
operatorL2CA_IsLeLink417   bool operator()(uint16_t acl_handle) { return body(acl_handle); };
418 };
419 extern struct L2CA_IsLeLink L2CA_IsLeLink;
420 // Name: L2CA_ReadConnectionAddr
421 // Params: const RawAddress& pseudo_addr, RawAddress& conn_addr, uint8_t*
422 // p_addr_type Returns: void
423 struct L2CA_ReadConnectionAddr {
424   std::function<void(const RawAddress& pseudo_addr, RawAddress& conn_addr,
425                      uint8_t* p_addr_type)>
426       body{[](const RawAddress& pseudo_addr, RawAddress& conn_addr,
427               uint8_t* p_addr_type) {}};
operatorL2CA_ReadConnectionAddr428   void operator()(const RawAddress& pseudo_addr, RawAddress& conn_addr,
429                   uint8_t* p_addr_type) {
430     body(pseudo_addr, conn_addr, p_addr_type);
431   };
432 };
433 extern struct L2CA_ReadConnectionAddr L2CA_ReadConnectionAddr;
434 // Name: L2CA_ReadRemoteConnectionAddr
435 // Params: const RawAddress& pseudo_addr, RawAddress& conn_addr, uint8_t*
436 // p_addr_type Returns: bool
437 struct L2CA_ReadRemoteConnectionAddr {
438   std::function<bool(const RawAddress& pseudo_addr, RawAddress& conn_addr,
439                      uint8_t* p_addr_type)>
440       body{[](const RawAddress& pseudo_addr, RawAddress& conn_addr,
441               uint8_t* p_addr_type) { return false; }};
operatorL2CA_ReadRemoteConnectionAddr442   bool operator()(const RawAddress& pseudo_addr, RawAddress& conn_addr,
443                   uint8_t* p_addr_type) {
444     return body(pseudo_addr, conn_addr, p_addr_type);
445   };
446 };
447 extern struct L2CA_ReadRemoteConnectionAddr L2CA_ReadRemoteConnectionAddr;
448 // Name: L2CA_GetBleConnRole
449 // Params: const RawAddress& bd_addr
450 // Returns: hci_role_t
451 struct L2CA_GetBleConnRole {
452   std::function<hci_role_t(const RawAddress& bd_addr)> body{
453       [](const RawAddress& bd_addr) { return HCI_ROLE_CENTRAL; }};
operatorL2CA_GetBleConnRole454   hci_role_t operator()(const RawAddress& bd_addr) { return body(bd_addr); };
455 };
456 extern struct L2CA_GetBleConnRole L2CA_GetBleConnRole;
457 // Name: L2CA_ConnectForSecurity
458 // Params: const RawAddress& bd_addr
459 // Returns: void
460 struct L2CA_ConnectForSecurity {
461   std::function<void(const RawAddress& bd_addr)> body{
462       [](const RawAddress& bd_addr) {}};
operatorL2CA_ConnectForSecurity463   void operator()(const RawAddress& bd_addr) { body(bd_addr); };
464 };
465 extern struct L2CA_ConnectForSecurity L2CA_ConnectForSecurity;
466 // Name: L2CA_SetBondingState
467 // Params: const RawAddress& bd_addr, bool is_bonding
468 // Returns: void
469 struct L2CA_SetBondingState {
470   std::function<void(const RawAddress& bd_addr, bool is_bonding)> body{
471       [](const RawAddress& bd_addr, bool is_bonding) {}};
operatorL2CA_SetBondingState472   void operator()(const RawAddress& bd_addr, bool is_bonding) {
473     body(bd_addr, is_bonding);
474   };
475 };
476 extern struct L2CA_SetBondingState L2CA_SetBondingState;
477 // Name: L2CA_DisconnectLink
478 // Params: const RawAddress& remote
479 // Returns: void
480 struct L2CA_DisconnectLink {
481   std::function<void(const RawAddress& remote)> body{
482       [](const RawAddress& remote) {}};
operatorL2CA_DisconnectLink483   void operator()(const RawAddress& remote) { body(remote); };
484 };
485 extern struct L2CA_DisconnectLink L2CA_DisconnectLink;
486 // Name: L2CA_GetNumLinks
487 // Params:
488 // Returns: uint16_t
489 struct L2CA_GetNumLinks {
490   std::function<uint16_t()> body{[]() { return 0; }};
operatorL2CA_GetNumLinks491   uint16_t operator()() { return body(); };
492 };
493 extern struct L2CA_GetNumLinks L2CA_GetNumLinks;
494 // Name: L2CA_AllocateLePSM
495 // Params:
496 // Returns: uint16_t
497 struct L2CA_AllocateLePSM {
498   std::function<uint16_t()> body{[]() { return 0; }};
operatorL2CA_AllocateLePSM499   uint16_t operator()() { return body(); };
500 };
501 extern struct L2CA_AllocateLePSM L2CA_AllocateLePSM;
502 // Name: L2CA_FreeLePSM
503 // Params: uint16_t psm
504 // Returns: void
505 struct L2CA_FreeLePSM {
506   std::function<void(uint16_t psm)> body{[](uint16_t psm) {}};
operatorL2CA_FreeLePSM507   void operator()(uint16_t psm) { body(psm); };
508 };
509 extern struct L2CA_FreeLePSM L2CA_FreeLePSM;
510 // Name: L2CA_RegisterLECoc
511 // Params: uint16_t psm, const tL2CAP_APPL_INFO& callbacks, uint16_t sec_level,
512 // tL2CAP_LE_CFG_INFO cfg Returns: uint16_t
513 struct L2CA_RegisterLECoc {
514   std::function<uint16_t(uint16_t psm, const tL2CAP_APPL_INFO& callbacks,
515                          uint16_t sec_level, tL2CAP_LE_CFG_INFO cfg)>
516       body{[](uint16_t psm, const tL2CAP_APPL_INFO& callbacks,
517               uint16_t sec_level, tL2CAP_LE_CFG_INFO cfg) { return 0; }};
operatorL2CA_RegisterLECoc518   uint16_t operator()(uint16_t psm, const tL2CAP_APPL_INFO& callbacks,
519                       uint16_t sec_level, tL2CAP_LE_CFG_INFO cfg) {
520     return body(psm, callbacks, sec_level, cfg);
521   };
522 };
523 extern struct L2CA_RegisterLECoc L2CA_RegisterLECoc;
524 // Name: L2CA_DeregisterLECoc
525 // Params: uint16_t psm
526 // Returns: void
527 struct L2CA_DeregisterLECoc {
528   std::function<void(uint16_t psm)> body{[](uint16_t psm) {}};
operatorL2CA_DeregisterLECoc529   void operator()(uint16_t psm) { body(psm); };
530 };
531 extern struct L2CA_DeregisterLECoc L2CA_DeregisterLECoc;
532 // Name: L2CA_ConnectLECocReq
533 // Params: uint16_t psm, const RawAddress& p_bd_addr, tL2CAP_LE_CFG_INFO* p_cfg
534 // Returns: uint16_t
535 struct L2CA_ConnectLECocReq {
536   std::function<uint16_t(uint16_t psm, const RawAddress& p_bd_addr,
537                          tL2CAP_LE_CFG_INFO* p_cfg)>
538       body{[](uint16_t psm, const RawAddress& p_bd_addr,
539               tL2CAP_LE_CFG_INFO* p_cfg) { return 0; }};
operatorL2CA_ConnectLECocReq540   uint16_t operator()(uint16_t psm, const RawAddress& p_bd_addr,
541                       tL2CAP_LE_CFG_INFO* p_cfg) {
542     return body(psm, p_bd_addr, p_cfg);
543   };
544 };
545 extern struct L2CA_ConnectLECocReq L2CA_ConnectLECocReq;
546 // Name: L2CA_GetPeerLECocConfig
547 // Params: uint16_t cid, tL2CAP_LE_CFG_INFO* peer_cfg
548 // Returns: bool
549 struct L2CA_GetPeerLECocConfig {
550   std::function<bool(uint16_t cid, tL2CAP_LE_CFG_INFO* peer_cfg)> body{
551       [](uint16_t cid, tL2CAP_LE_CFG_INFO* peer_cfg) { return false; }};
operatorL2CA_GetPeerLECocConfig552   bool operator()(uint16_t cid, tL2CAP_LE_CFG_INFO* peer_cfg) {
553     return body(cid, peer_cfg);
554   };
555 };
556 extern struct L2CA_GetPeerLECocConfig L2CA_GetPeerLECocConfig;
557 // Name: L2CA_DisconnectLECocReq
558 // Params: uint16_t cid
559 // Returns: bool
560 struct L2CA_DisconnectLECocReq {
561   std::function<bool(uint16_t cid)> body{[](uint16_t cid) { return false; }};
operatorL2CA_DisconnectLECocReq562   bool operator()(uint16_t cid) { return body(cid); };
563 };
564 extern struct L2CA_DisconnectLECocReq L2CA_DisconnectLECocReq;
565 // Name: L2CA_LECocDataWrite
566 // Params: uint16_t cid, BT_HDR* p_data
567 // Returns: uint8_t
568 struct L2CA_LECocDataWrite {
569   std::function<uint8_t(uint16_t cid, BT_HDR* p_data)> body{
570       [](uint16_t cid, BT_HDR* p_data) { return 0; }};
operatorL2CA_LECocDataWrite571   uint8_t operator()(uint16_t cid, BT_HDR* p_data) {
572     return body(cid, p_data);
573   };
574 };
575 extern struct L2CA_LECocDataWrite L2CA_LECocDataWrite;
576 // Name: L2CA_SwitchRoleToCentral
577 // Params: const RawAddress& addr
578 // Returns: void
579 struct L2CA_SwitchRoleToCentral {
580   std::function<void(const RawAddress& addr)> body{
581       [](const RawAddress& addr) {}};
operatorL2CA_SwitchRoleToCentral582   void operator()(const RawAddress& addr) { body(addr); };
583 };
584 extern struct L2CA_SwitchRoleToCentral L2CA_SwitchRoleToCentral;
585 
586 }  // namespace main_shim_l2cap_api
587 }  // namespace mock
588 }  // namespace test
589 
590 // END mockcify generation
591