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:72
20 */
21
22 #include <map>
23 #include <string>
24
25 extern std::map<std::string, int> mock_function_count_map;
26
27 #include <cstdint>
28 #include "stack/include/bt_types.h"
29 #include "stack/l2cap/l2c_int.h"
30 #include "types/raw_address.h"
31
32 #ifndef UNUSED_ATTR
33 #define UNUSED_ATTR
34 #endif
35
l2cu_build_header(tL2C_LCB * p_lcb,uint16_t len,uint8_t cmd,uint8_t signal_id)36 BT_HDR* l2cu_build_header(tL2C_LCB* p_lcb, uint16_t len, uint8_t cmd,
37 uint8_t signal_id) {
38 mock_function_count_map[__func__]++;
39 return nullptr;
40 }
l2c_is_cmd_rejected(uint8_t cmd_code,uint8_t signal_id,tL2C_LCB * p_lcb)41 bool l2c_is_cmd_rejected(uint8_t cmd_code, uint8_t signal_id, tL2C_LCB* p_lcb) {
42 mock_function_count_map[__func__]++;
43 return false;
44 }
l2cu_create_conn_le(tL2C_LCB * p_lcb)45 bool l2cu_create_conn_le(tL2C_LCB* p_lcb) {
46 mock_function_count_map[__func__]++;
47 return false;
48 }
l2cu_create_conn_le(tL2C_LCB * p_lcb,uint8_t initiating_phys)49 bool l2cu_create_conn_le(tL2C_LCB* p_lcb, uint8_t initiating_phys) {
50 mock_function_count_map[__func__]++;
51 return false;
52 }
l2cu_initialize_fixed_ccb(tL2C_LCB * p_lcb,uint16_t fixed_cid)53 bool l2cu_initialize_fixed_ccb(tL2C_LCB* p_lcb, uint16_t fixed_cid) {
54 mock_function_count_map[__func__]++;
55 return false;
56 }
l2cu_is_ccb_active(tL2C_CCB * p_ccb)57 bool l2cu_is_ccb_active(tL2C_CCB* p_ccb) {
58 mock_function_count_map[__func__]++;
59 return false;
60 }
l2cu_lcb_disconnecting(void)61 bool l2cu_lcb_disconnecting(void) {
62 mock_function_count_map[__func__]++;
63 return false;
64 }
l2cu_set_acl_priority(const RawAddress & bd_addr,tL2CAP_PRIORITY priority,bool reset_after_rs)65 bool l2cu_set_acl_priority(const RawAddress& bd_addr, tL2CAP_PRIORITY priority,
66 bool reset_after_rs) {
67 mock_function_count_map[__func__]++;
68 return false;
69 }
l2cu_start_post_bond_timer(uint16_t handle)70 bool l2cu_start_post_bond_timer(uint16_t handle) {
71 mock_function_count_map[__func__]++;
72 return false;
73 }
l2cu_allocate_ccb(tL2C_LCB * p_lcb,uint16_t cid)74 tL2C_CCB* l2cu_allocate_ccb(tL2C_LCB* p_lcb, uint16_t cid) {
75 mock_function_count_map[__func__]++;
76 return nullptr;
77 }
l2cu_find_ccb_by_cid(tL2C_LCB * p_lcb,uint16_t local_cid)78 tL2C_CCB* l2cu_find_ccb_by_cid(tL2C_LCB* p_lcb, uint16_t local_cid) {
79 mock_function_count_map[__func__]++;
80 return nullptr;
81 }
l2cu_find_ccb_by_remote_cid(tL2C_LCB * p_lcb,uint16_t remote_cid)82 tL2C_CCB* l2cu_find_ccb_by_remote_cid(tL2C_LCB* p_lcb, uint16_t remote_cid) {
83 mock_function_count_map[__func__]++;
84 return nullptr;
85 }
l2cu_allocate_lcb(const RawAddress & p_bd_addr,bool is_bonding,tBT_TRANSPORT transport)86 tL2C_LCB* l2cu_allocate_lcb(const RawAddress& p_bd_addr, bool is_bonding,
87 tBT_TRANSPORT transport) {
88 mock_function_count_map[__func__]++;
89 return nullptr;
90 }
l2cu_find_lcb_by_bd_addr(const RawAddress & p_bd_addr,tBT_TRANSPORT transport)91 tL2C_LCB* l2cu_find_lcb_by_bd_addr(const RawAddress& p_bd_addr,
92 tBT_TRANSPORT transport) {
93 mock_function_count_map[__func__]++;
94 return nullptr;
95 }
l2cu_find_lcb_by_handle(uint16_t handle)96 tL2C_LCB* l2cu_find_lcb_by_handle(uint16_t handle) {
97 mock_function_count_map[__func__]++;
98 return nullptr;
99 }
l2cu_find_lcb_by_state(tL2C_LINK_STATE state)100 tL2C_LCB* l2cu_find_lcb_by_state(tL2C_LINK_STATE state) {
101 mock_function_count_map[__func__]++;
102 return nullptr;
103 }
l2cu_allocate_ble_rcb(uint16_t psm)104 tL2C_RCB* l2cu_allocate_ble_rcb(uint16_t psm) {
105 mock_function_count_map[__func__]++;
106 return nullptr;
107 }
l2cu_allocate_rcb(uint16_t psm)108 tL2C_RCB* l2cu_allocate_rcb(uint16_t psm) {
109 mock_function_count_map[__func__]++;
110 return nullptr;
111 }
l2cu_find_ble_rcb_by_psm(uint16_t psm)112 tL2C_RCB* l2cu_find_ble_rcb_by_psm(uint16_t psm) {
113 mock_function_count_map[__func__]++;
114 return nullptr;
115 }
l2cu_find_rcb_by_psm(uint16_t psm)116 tL2C_RCB* l2cu_find_rcb_by_psm(uint16_t psm) {
117 mock_function_count_map[__func__]++;
118 return nullptr;
119 }
l2cu_get_num_hi_priority(void)120 uint8_t l2cu_get_num_hi_priority(void) {
121 mock_function_count_map[__func__]++;
122 return 0;
123 }
l2cu_process_peer_cfg_req(tL2C_CCB * p_ccb,tL2CAP_CFG_INFO * p_cfg)124 uint8_t l2cu_process_peer_cfg_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) {
125 mock_function_count_map[__func__]++;
126 return 0;
127 }
l2cu_adj_id(tL2C_LCB * p_lcb)128 void l2cu_adj_id(tL2C_LCB* p_lcb) { mock_function_count_map[__func__]++; }
l2cu_adjust_out_mps(tL2C_CCB * p_ccb)129 void l2cu_adjust_out_mps(tL2C_CCB* p_ccb) {
130 mock_function_count_map[__func__]++;
131 }
l2cu_change_pri_ccb(tL2C_CCB * p_ccb,tL2CAP_CHNL_PRIORITY priority)132 void l2cu_change_pri_ccb(tL2C_CCB* p_ccb, tL2CAP_CHNL_PRIORITY priority) {
133 mock_function_count_map[__func__]++;
134 }
l2cu_check_channel_congestion(tL2C_CCB * p_ccb)135 void l2cu_check_channel_congestion(tL2C_CCB* p_ccb) {
136 mock_function_count_map[__func__]++;
137 }
l2cu_create_conn_after_switch(tL2C_LCB * p_lcb)138 void l2cu_create_conn_after_switch(tL2C_LCB* p_lcb) {
139 mock_function_count_map[__func__]++;
140 }
l2cu_create_conn_br_edr(tL2C_LCB * p_lcb)141 void l2cu_create_conn_br_edr(tL2C_LCB* p_lcb) {
142 mock_function_count_map[__func__]++;
143 }
l2cu_dequeue_ccb(tL2C_CCB * p_ccb)144 void l2cu_dequeue_ccb(tL2C_CCB* p_ccb) { mock_function_count_map[__func__]++; }
l2cu_device_reset(void)145 void l2cu_device_reset(void) { mock_function_count_map[__func__]++; }
l2cu_disconnect_chnl(tL2C_CCB * p_ccb)146 void l2cu_disconnect_chnl(tL2C_CCB* p_ccb) {
147 mock_function_count_map[__func__]++;
148 }
l2cu_enqueue_ccb(tL2C_CCB * p_ccb)149 void l2cu_enqueue_ccb(tL2C_CCB* p_ccb) { mock_function_count_map[__func__]++; }
l2cu_no_dynamic_ccbs(tL2C_LCB * p_lcb)150 void l2cu_no_dynamic_ccbs(tL2C_LCB* p_lcb) {
151 mock_function_count_map[__func__]++;
152 }
l2cu_process_fixed_chnl_resp(tL2C_LCB * p_lcb)153 void l2cu_process_fixed_chnl_resp(tL2C_LCB* p_lcb) {
154 mock_function_count_map[__func__]++;
155 }
l2cu_process_fixed_disc_cback(tL2C_LCB * p_lcb)156 void l2cu_process_fixed_disc_cback(tL2C_LCB* p_lcb) {
157 mock_function_count_map[__func__]++;
158 }
l2cu_process_our_cfg_req(tL2C_CCB * p_ccb,tL2CAP_CFG_INFO * p_cfg)159 void l2cu_process_our_cfg_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) {
160 mock_function_count_map[__func__]++;
161 }
l2cu_process_our_cfg_rsp(tL2C_CCB * p_ccb,tL2CAP_CFG_INFO * p_cfg)162 void l2cu_process_our_cfg_rsp(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) {
163 mock_function_count_map[__func__]++;
164 }
l2cu_process_peer_cfg_rsp(tL2C_CCB * p_ccb,tL2CAP_CFG_INFO * p_cfg)165 void l2cu_process_peer_cfg_rsp(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) {
166 mock_function_count_map[__func__]++;
167 }
l2cu_reject_ble_coc_connection(tL2C_LCB * p_lcb,uint8_t rem_id,uint16_t result)168 void l2cu_reject_ble_coc_connection(tL2C_LCB* p_lcb, uint8_t rem_id,
169 uint16_t result) {
170 mock_function_count_map[__func__]++;
171 }
l2cu_reject_ble_connection(tL2C_CCB * p_ccb,uint8_t rem_id,uint16_t result)172 void l2cu_reject_ble_connection(tL2C_CCB* p_ccb, uint8_t rem_id,
173 uint16_t result) {
174 mock_function_count_map[__func__]++;
175 }
l2cu_reject_connection(tL2C_LCB * p_lcb,uint16_t remote_cid,uint8_t rem_id,uint16_t result)176 void l2cu_reject_connection(tL2C_LCB* p_lcb, uint16_t remote_cid,
177 uint8_t rem_id, uint16_t result) {
178 mock_function_count_map[__func__]++;
179 }
l2cu_reject_credit_based_conn_req(tL2C_LCB * p_lcb,uint8_t rem_id,uint8_t num_of_channels,uint16_t result)180 void l2cu_reject_credit_based_conn_req(tL2C_LCB* p_lcb, uint8_t rem_id,
181 uint8_t num_of_channels,
182 uint16_t result) {
183 mock_function_count_map[__func__]++;
184 }
l2cu_release_ble_rcb(tL2C_RCB * p_rcb)185 void l2cu_release_ble_rcb(tL2C_RCB* p_rcb) {
186 mock_function_count_map[__func__]++;
187 }
l2cu_release_ccb(tL2C_CCB * p_ccb)188 void l2cu_release_ccb(tL2C_CCB* p_ccb) { mock_function_count_map[__func__]++; }
l2cu_release_lcb(tL2C_LCB * p_lcb)189 void l2cu_release_lcb(tL2C_LCB* p_lcb) { mock_function_count_map[__func__]++; }
l2cu_release_rcb(tL2C_RCB * p_rcb)190 void l2cu_release_rcb(tL2C_RCB* p_rcb) { mock_function_count_map[__func__]++; }
l2cu_resubmit_pending_sec_req(const RawAddress * p_bda)191 void l2cu_resubmit_pending_sec_req(const RawAddress* p_bda) {
192 mock_function_count_map[__func__]++;
193 }
l2cu_send_ble_reconfig_rsp(tL2C_LCB * p_lcb,uint8_t rem_id,uint16_t result)194 void l2cu_send_ble_reconfig_rsp(tL2C_LCB* p_lcb, uint8_t rem_id,
195 uint16_t result) {
196 mock_function_count_map[__func__]++;
197 }
l2cu_send_credit_based_reconfig_req(tL2C_CCB * p_ccb,tL2CAP_LE_CFG_INFO * p_cfg)198 void l2cu_send_credit_based_reconfig_req(tL2C_CCB* p_ccb,
199 tL2CAP_LE_CFG_INFO* p_cfg) {
200 mock_function_count_map[__func__]++;
201 }
l2cu_send_peer_ble_credit_based_conn_req(tL2C_CCB * p_ccb)202 void l2cu_send_peer_ble_credit_based_conn_req(tL2C_CCB* p_ccb) {
203 mock_function_count_map[__func__]++;
204 }
l2cu_send_peer_ble_credit_based_conn_res(tL2C_CCB * p_ccb,uint16_t result)205 void l2cu_send_peer_ble_credit_based_conn_res(tL2C_CCB* p_ccb,
206 uint16_t result) {
207 mock_function_count_map[__func__]++;
208 }
l2cu_send_peer_ble_credit_based_disconn_req(tL2C_CCB * p_ccb)209 void l2cu_send_peer_ble_credit_based_disconn_req(tL2C_CCB* p_ccb) {
210 mock_function_count_map[__func__]++;
211 }
l2cu_send_peer_ble_flow_control_credit(tL2C_CCB * p_ccb,uint16_t credit_value)212 void l2cu_send_peer_ble_flow_control_credit(tL2C_CCB* p_ccb,
213 uint16_t credit_value) {
214 mock_function_count_map[__func__]++;
215 }
l2cu_send_peer_ble_par_req(tL2C_LCB * p_lcb,uint16_t min_int,uint16_t max_int,uint16_t latency,uint16_t timeout)216 void l2cu_send_peer_ble_par_req(tL2C_LCB* p_lcb, uint16_t min_int,
217 uint16_t max_int, uint16_t latency,
218 uint16_t timeout) {
219 mock_function_count_map[__func__]++;
220 }
l2cu_send_peer_ble_par_rsp(tL2C_LCB * p_lcb,uint16_t reason,uint8_t rem_id)221 void l2cu_send_peer_ble_par_rsp(tL2C_LCB* p_lcb, uint16_t reason,
222 uint8_t rem_id) {
223 mock_function_count_map[__func__]++;
224 }
l2cu_send_peer_cmd_reject(tL2C_LCB * p_lcb,uint16_t reason,uint8_t rem_id,uint16_t p1,uint16_t p2)225 void l2cu_send_peer_cmd_reject(tL2C_LCB* p_lcb, uint16_t reason, uint8_t rem_id,
226 uint16_t p1, uint16_t p2) {
227 mock_function_count_map[__func__]++;
228 }
l2cu_send_peer_config_rej(tL2C_CCB * p_ccb,uint8_t * p_data,uint16_t data_len,uint16_t rej_len)229 void l2cu_send_peer_config_rej(tL2C_CCB* p_ccb, uint8_t* p_data,
230 uint16_t data_len, uint16_t rej_len) {
231 mock_function_count_map[__func__]++;
232 }
l2cu_send_peer_config_req(tL2C_CCB * p_ccb,tL2CAP_CFG_INFO * p_cfg)233 void l2cu_send_peer_config_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) {
234 mock_function_count_map[__func__]++;
235 }
l2cu_send_peer_config_rsp(tL2C_CCB * p_ccb,tL2CAP_CFG_INFO * p_cfg)236 void l2cu_send_peer_config_rsp(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) {
237 mock_function_count_map[__func__]++;
238 }
l2cu_send_peer_connect_req(tL2C_CCB * p_ccb)239 void l2cu_send_peer_connect_req(tL2C_CCB* p_ccb) {
240 mock_function_count_map[__func__]++;
241 }
l2cu_send_peer_connect_rsp(tL2C_CCB * p_ccb,uint16_t result,uint16_t status)242 void l2cu_send_peer_connect_rsp(tL2C_CCB* p_ccb, uint16_t result,
243 uint16_t status) {
244 mock_function_count_map[__func__]++;
245 }
l2cu_send_peer_credit_based_conn_req(tL2C_CCB * p_ccb)246 void l2cu_send_peer_credit_based_conn_req(tL2C_CCB* p_ccb) {
247 mock_function_count_map[__func__]++;
248 }
l2cu_send_peer_credit_based_conn_res(tL2C_CCB * p_ccb,std::vector<uint16_t> & accepted_cids,uint16_t result)249 void l2cu_send_peer_credit_based_conn_res(tL2C_CCB* p_ccb,
250 std::vector<uint16_t>& accepted_cids,
251 uint16_t result) {
252 mock_function_count_map[__func__]++;
253 }
l2cu_send_peer_disc_req(tL2C_CCB * p_ccb)254 void l2cu_send_peer_disc_req(tL2C_CCB* p_ccb) {
255 mock_function_count_map[__func__]++;
256 }
l2cu_send_peer_disc_rsp(tL2C_LCB * p_lcb,uint8_t remote_id,uint16_t local_cid,uint16_t remote_cid)257 void l2cu_send_peer_disc_rsp(tL2C_LCB* p_lcb, uint8_t remote_id,
258 uint16_t local_cid, uint16_t remote_cid) {
259 mock_function_count_map[__func__]++;
260 }
l2cu_send_peer_echo_rsp(tL2C_LCB * p_lcb,uint8_t signal_id,uint8_t * p_data,uint16_t data_len)261 void l2cu_send_peer_echo_rsp(tL2C_LCB* p_lcb, uint8_t signal_id,
262 uint8_t* p_data, uint16_t data_len) {
263 mock_function_count_map[__func__]++;
264 }
l2cu_send_peer_info_req(tL2C_LCB * p_lcb,uint16_t info_type)265 void l2cu_send_peer_info_req(tL2C_LCB* p_lcb, uint16_t info_type) {
266 mock_function_count_map[__func__]++;
267 }
l2cu_send_peer_info_rsp(tL2C_LCB * p_lcb,uint8_t remote_id,uint16_t info_type)268 void l2cu_send_peer_info_rsp(tL2C_LCB* p_lcb, uint8_t remote_id,
269 uint16_t info_type) {
270 mock_function_count_map[__func__]++;
271 }
l2cu_set_acl_hci_header(BT_HDR * p_buf,tL2C_CCB * p_ccb)272 void l2cu_set_acl_hci_header(BT_HDR* p_buf, tL2C_CCB* p_ccb) {
273 mock_function_count_map[__func__]++;
274 }
l2cu_set_lcb_handle(struct t_l2c_linkcb & p_lcb,uint16_t handle)275 void l2cu_set_lcb_handle(struct t_l2c_linkcb& p_lcb, uint16_t handle) {
276 mock_function_count_map[__func__]++;
277 }
l2cu_set_non_flushable_pbf(bool is_supported)278 void l2cu_set_non_flushable_pbf(bool is_supported) {
279 mock_function_count_map[__func__]++;
280 }
l2cu_update_lcb_4_bonding(const RawAddress & p_bd_addr,bool is_bonding)281 void l2cu_update_lcb_4_bonding(const RawAddress& p_bd_addr, bool is_bonding) {
282 mock_function_count_map[__func__]++;
283 }
284