1 /*
2  * Copyright 2020 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:54
20  */
21 
22 #include <map>
23 #include <string>
24 
25 extern std::map<std::string, int> mock_function_count_map;
26 
27 #include "main/shim/l2c_api.h"
28 
29 #ifndef UNUSED_ATTR
30 #define UNUSED_ATTR
31 #endif
32 
L2CA_RegisterFixedChannel(uint16_t cid,tL2CAP_FIXED_CHNL_REG * p_freg)33 bool bluetooth::shim::L2CA_RegisterFixedChannel(uint16_t cid,
34                                                 tL2CAP_FIXED_CHNL_REG* p_freg) {
35   mock_function_count_map[__func__]++;
36   return false;
37 }
L2CA_ConnectCreditBasedRsp(const RawAddress & bd_addr,uint8_t id,std::vector<uint16_t> & accepted_lcids,uint16_t result,tL2CAP_LE_CFG_INFO * p_cfg)38 bool bluetooth::shim::L2CA_ConnectCreditBasedRsp(
39     const RawAddress& bd_addr, uint8_t id,
40     std::vector<uint16_t>& accepted_lcids, uint16_t result,
41     tL2CAP_LE_CFG_INFO* p_cfg) {
42   mock_function_count_map[__func__]++;
43   return false;
44 }
L2CA_ConnectFixedChnl(uint16_t cid,const RawAddress & rem_bda)45 bool bluetooth::shim::L2CA_ConnectFixedChnl(uint16_t cid,
46                                             const RawAddress& rem_bda) {
47   mock_function_count_map[__func__]++;
48   return false;
49 }
50 
L2CA_DisconnectLECocReq(uint16_t cid)51 bool bluetooth::shim::L2CA_DisconnectLECocReq(uint16_t cid) {
52   mock_function_count_map[__func__]++;
53   return false;
54 }
L2CA_DisconnectReq(uint16_t cid)55 bool bluetooth::shim::L2CA_DisconnectReq(uint16_t cid) {
56   mock_function_count_map[__func__]++;
57   return false;
58 }
L2CA_GetPeerFeatures(const RawAddress & bd_addr,uint32_t * p_ext_feat,uint8_t * p_chnl_mask)59 bool bluetooth::shim::L2CA_GetPeerFeatures(const RawAddress& bd_addr,
60                                            uint32_t* p_ext_feat,
61                                            uint8_t* p_chnl_mask) {
62   mock_function_count_map[__func__]++;
63   return false;
64 }
L2CA_GetPeerLECocConfig(uint16_t cid,tL2CAP_LE_CFG_INFO * peer_cfg)65 bool bluetooth::shim::L2CA_GetPeerLECocConfig(uint16_t cid,
66                                               tL2CAP_LE_CFG_INFO* peer_cfg) {
67   mock_function_count_map[__func__]++;
68   return false;
69 }
L2CA_GetRemoteCid(uint16_t lcid,uint16_t * rcid)70 bool bluetooth::shim::L2CA_GetRemoteCid(uint16_t lcid, uint16_t* rcid) {
71   mock_function_count_map[__func__]++;
72   return false;
73 }
L2CA_IsLinkEstablished(const RawAddress & bd_addr,tBT_TRANSPORT transport)74 bool bluetooth::shim::L2CA_IsLinkEstablished(const RawAddress& bd_addr,
75                                              tBT_TRANSPORT transport) {
76   mock_function_count_map[__func__]++;
77   return false;
78 }
L2CA_GetLeHandle(const RawAddress & bd_addr)79 uint16_t bluetooth::shim::L2CA_GetLeHandle(const RawAddress& bd_addr) {
80   mock_function_count_map[__func__]++;
81   return 0;
82 }
L2CA_IsLeLink(uint16_t)83 bool bluetooth::shim::L2CA_IsLeLink(uint16_t) {
84   mock_function_count_map[__func__]++;
85   return false;
86 }
L2CA_ReadConnectionAddr(const RawAddress & pseudo_addr,RawAddress & conn_addr,uint8_t * p_addr_type)87 void bluetooth::shim::L2CA_ReadConnectionAddr(const RawAddress& pseudo_addr,
88                                               RawAddress& conn_addr,
89                                               uint8_t* p_addr_type) {
90   mock_function_count_map[__func__]++;
91 }
L2CA_ReadRemoteConnectionAddr(const RawAddress & pseudo_addr,RawAddress & conn_addr,uint8_t * p_addr_type)92 bool bluetooth::shim::L2CA_ReadRemoteConnectionAddr(
93     const RawAddress& pseudo_addr, RawAddress& conn_addr,
94     uint8_t* p_addr_type) {
95   mock_function_count_map[__func__]++;
96   return false;
97 }
L2CA_ReconfigCreditBasedConnsReq(const RawAddress & bd_addr,std::vector<uint16_t> & lcids,tL2CAP_LE_CFG_INFO * p_cfg)98 bool bluetooth::shim::L2CA_ReconfigCreditBasedConnsReq(
99     const RawAddress& bd_addr, std::vector<uint16_t>& lcids,
100     tL2CAP_LE_CFG_INFO* p_cfg) {
101   mock_function_count_map[__func__]++;
102   return false;
103 }
L2CA_RemoveFixedChnl(uint16_t cid,const RawAddress & rem_bda)104 bool bluetooth::shim::L2CA_RemoveFixedChnl(uint16_t cid,
105                                            const RawAddress& rem_bda) {
106   mock_function_count_map[__func__]++;
107   return false;
108 }
L2CA_SetAclPriority(const RawAddress & bd_addr,tL2CAP_PRIORITY priority)109 bool bluetooth::shim::L2CA_SetAclPriority(const RawAddress& bd_addr,
110                                           tL2CAP_PRIORITY priority) {
111   mock_function_count_map[__func__]++;
112   return false;
113 }
L2CA_SetChnlFlushability(uint16_t cid,bool is_flushable)114 bool bluetooth::shim::L2CA_SetChnlFlushability(uint16_t cid,
115                                                bool is_flushable) {
116   mock_function_count_map[__func__]++;
117   return false;
118 }
L2CA_SetLeGattTimeout(const RawAddress & rem_bda,uint16_t idle_tout)119 bool bluetooth::shim::L2CA_SetLeGattTimeout(const RawAddress& rem_bda,
120                                             uint16_t idle_tout) {
121   mock_function_count_map[__func__]++;
122   return false;
123 }
L2CA_SetIdleTimeoutByBdAddr(const RawAddress & bd_addr,uint16_t timeout,tBT_TRANSPORT transport)124 bool bluetooth::shim::L2CA_SetIdleTimeoutByBdAddr(const RawAddress& bd_addr,
125                                                   uint16_t timeout,
126                                                   tBT_TRANSPORT transport) {
127   mock_function_count_map[__func__]++;
128   return false;
129 }
L2CA_SetTxPriority(uint16_t cid,tL2CAP_CHNL_PRIORITY priority)130 bool bluetooth::shim::L2CA_SetTxPriority(uint16_t cid,
131                                          tL2CAP_CHNL_PRIORITY priority) {
132   mock_function_count_map[__func__]++;
133   return false;
134 }
L2CA_AllocateLePSM(void)135 uint16_t bluetooth::shim::L2CA_AllocateLePSM(void) {
136   mock_function_count_map[__func__]++;
137   return 0;
138 }
L2CA_ConnectLECocReq(uint16_t psm,const RawAddress & p_bd_addr,tL2CAP_LE_CFG_INFO * p_cfg)139 uint16_t bluetooth::shim::L2CA_ConnectLECocReq(uint16_t psm,
140                                                const RawAddress& p_bd_addr,
141                                                tL2CAP_LE_CFG_INFO* p_cfg) {
142   mock_function_count_map[__func__]++;
143   return 0;
144 }
L2CA_ConnectReq(uint16_t psm,const RawAddress & raw_address)145 uint16_t bluetooth::shim::L2CA_ConnectReq(uint16_t psm,
146                                           const RawAddress& raw_address) {
147   mock_function_count_map[__func__]++;
148   return 0;
149 }
L2CA_FlushChannel(uint16_t lcid,uint16_t num_to_flush)150 uint16_t bluetooth::shim::L2CA_FlushChannel(uint16_t lcid,
151                                             uint16_t num_to_flush) {
152   mock_function_count_map[__func__]++;
153   return 0;
154 }
L2CA_Register(uint16_t client_psm,const tL2CAP_APPL_INFO & callbacks,bool enable_snoop,tL2CAP_ERTM_INFO * p_ertm_info,uint16_t my_mtu,uint16_t required_remote_mtu,uint16_t sec_level)155 uint16_t bluetooth::shim::L2CA_Register(
156     uint16_t client_psm, const tL2CAP_APPL_INFO& callbacks, bool enable_snoop,
157     tL2CAP_ERTM_INFO* p_ertm_info, uint16_t my_mtu,
158     uint16_t required_remote_mtu, uint16_t sec_level) {
159   mock_function_count_map[__func__]++;
160   return 0;
161 }
L2CA_SendFixedChnlData(uint16_t cid,const RawAddress & rem_bda,BT_HDR * p_buf)162 uint16_t bluetooth::shim::L2CA_SendFixedChnlData(uint16_t cid,
163                                                  const RawAddress& rem_bda,
164                                                  BT_HDR* p_buf) {
165   mock_function_count_map[__func__]++;
166   return 0;
167 }
find_classic_cid_token_by_psm_address(uint16_t psm,RawAddress remote)168 uint16_t find_classic_cid_token_by_psm_address(uint16_t psm,
169                                                RawAddress remote) {
170   mock_function_count_map[__func__]++;
171   return 0;
172 }
find_le_cid_token_by_psm_address(uint16_t psm,RawAddress remote)173 uint16_t find_le_cid_token_by_psm_address(uint16_t psm, RawAddress remote) {
174   mock_function_count_map[__func__]++;
175   return 0;
176 }
L2CA_DataWrite(uint16_t cid,BT_HDR * p_data)177 uint8_t bluetooth::shim::L2CA_DataWrite(uint16_t cid, BT_HDR* p_data) {
178   mock_function_count_map[__func__]++;
179   return 0;
180 }
L2CA_LECocDataWrite(uint16_t cid,BT_HDR * p_data)181 uint8_t bluetooth::shim::L2CA_LECocDataWrite(uint16_t cid, BT_HDR* p_data) {
182   mock_function_count_map[__func__]++;
183   return 0;
184 }
L2CA_ConnectForSecurity(const RawAddress & bd_addr)185 void bluetooth::shim::L2CA_ConnectForSecurity(const RawAddress& bd_addr) {
186   mock_function_count_map[__func__]++;
187 }
L2CA_Deregister(uint16_t client_psm)188 void bluetooth::shim::L2CA_Deregister(uint16_t client_psm) {
189   mock_function_count_map[__func__]++;
190 }
L2CA_DeregisterLECoc(uint16_t psm)191 void bluetooth::shim::L2CA_DeregisterLECoc(uint16_t psm) {
192   mock_function_count_map[__func__]++;
193 }
L2CA_FreeLePSM(uint16_t psm)194 void bluetooth::shim::L2CA_FreeLePSM(uint16_t psm) {
195   mock_function_count_map[__func__]++;
196 }
L2CA_SetBondingState(const RawAddress & bd_addr,bool is_bonding)197 void bluetooth::shim::L2CA_SetBondingState(const RawAddress& bd_addr,
198                                            bool is_bonding) {
199   mock_function_count_map[__func__]++;
200 }
L2CA_SwitchRoleToCentral(const RawAddress & addr)201 void bluetooth::shim::L2CA_SwitchRoleToCentral(const RawAddress& addr) {
202   mock_function_count_map[__func__]++;
203 }
L2CA_UseLegacySecurityModule()204 void bluetooth::shim::L2CA_UseLegacySecurityModule() {
205   mock_function_count_map[__func__]++;
206 }
remove_classic_cid_token_entry(uint16_t cid_token)207 void remove_classic_cid_token_entry(uint16_t cid_token) {
208   mock_function_count_map[__func__]++;
209 }
remove_le_cid_token_entry(uint16_t cid_token)210 void remove_le_cid_token_entry(uint16_t cid_token) {
211   mock_function_count_map[__func__]++;
212 }
L2CA_ReadRemoteVersion(const RawAddress & addr,uint8_t * lmp_version,uint16_t * manufacturer,uint16_t * lmp_sub_version)213 bool bluetooth::shim::L2CA_ReadRemoteVersion(const RawAddress& addr,
214                                              uint8_t* lmp_version,
215                                              uint16_t* manufacturer,
216                                              uint16_t* lmp_sub_version) {
217   mock_function_count_map[__func__]++;
218   return false;
219 }
L2CA_ReadRemoteFeatures(const RawAddress & remote)220 uint8_t* bluetooth::shim::L2CA_ReadRemoteFeatures(const RawAddress& remote) {
221   mock_function_count_map[__func__]++;
222   return 0;
223 }
L2CA_DisconnectLink(const RawAddress & remote)224 void bluetooth::shim::L2CA_DisconnectLink(const RawAddress& remote) {
225   mock_function_count_map[__func__]++;
226 }
L2CA_GetNumLinks()227 uint16_t bluetooth::shim::L2CA_GetNumLinks() {
228   mock_function_count_map[__func__]++;
229   return 0;
230 }
231