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:22
20  *
21  *  mockcify.pl ver 0.2
22  */
23 
24 #pragma once
25 
26 #include <cstdint>
27 #include <functional>
28 
29 // Original included files, if any
30 #include "stack/l2cap/l2c_int.h"
31 #include "types/ble_address_with_type.h"
32 #include "types/hci_role.h"
33 #include "types/raw_address.h"
34 
35 // Mocked compile conditionals, if any
36 namespace test {
37 namespace mock {
38 namespace stack_l2cap_ble {
39 
40 // Shared state between mocked functions and tests
41 // Name: L2CA_UpdateBleConnParams
42 // Params: const RawAddress& rem_bda, uint16_t min_int, uint16_t max_int,
43 // uint16_t latency, uint16_t timeout, uint16_t min_ce_len, uint16_t max_ce_len
44 // Returns: bool
45 struct L2CA_UpdateBleConnParams {
46   std::function<bool(const RawAddress& rem_bda, uint16_t min_int, uint16_t max_int,
47                      uint16_t latency, uint16_t timeout, uint16_t min_ce_len, uint16_t max_ce_len)>
48           body{[](const RawAddress& /* rem_bda */, uint16_t /* min_int */, uint16_t /* max_int */,
49                   uint16_t /* latency */, uint16_t /* timeout */, uint16_t /* min_ce_len */,
50                   uint16_t /* max_ce_len */) { return false; }};
operatorL2CA_UpdateBleConnParams51   bool operator()(const RawAddress& rem_bda, uint16_t min_int, uint16_t max_int, uint16_t latency,
52                   uint16_t timeout, uint16_t min_ce_len, uint16_t max_ce_len) {
53     return body(rem_bda, min_int, max_int, latency, timeout, min_ce_len, max_ce_len);
54   }
55 };
56 extern struct L2CA_UpdateBleConnParams L2CA_UpdateBleConnParams;
57 // Name: L2CA_LockBleConnParamsForServiceDiscovery
58 // Params: const RawAddress& rem_bda, bool enable
59 // Returns: void
60 struct L2CA_LockBleConnParamsForServiceDiscovery {
61   std::function<void(const RawAddress& rem_bda, bool enable)> body{
62           [](const RawAddress& /* rem_bda */, bool /* enable */) { return false; }};
operatorL2CA_LockBleConnParamsForServiceDiscovery63   void operator()(const RawAddress& rem_bda, bool enable) { return body(rem_bda, enable); }
64 };
65 extern struct L2CA_LockBleConnParamsForServiceDiscovery L2CA_LockBleConnParamsForServiceDiscovery;
66 // Name: L2CA_LockBleConnParamsForProfileConnection
67 // Params: const RawAddress& rem_bda, bool enable
68 // Returns: void
69 struct L2CA_LockBleConnParamsForProfileConnection {
70   std::function<void(const RawAddress& rem_bda, bool enable)> body{
71           [](const RawAddress& /* rem_bda */, bool /* enable */) { return false; }};
operatorL2CA_LockBleConnParamsForProfileConnection72   void operator()(const RawAddress& rem_bda, bool enable) { return body(rem_bda, enable); }
73 };
74 extern struct L2CA_LockBleConnParamsForProfileConnection L2CA_LockBleConnParamsForProfileConnection;
75 struct L2CA_ConsolidateParams {
76   std::function<void(const RawAddress& identity_addr, const RawAddress& rpa)> body{
77           [](const RawAddress& /* identity_addr */, const RawAddress& /* rpa */) { return false; }};
operatorL2CA_ConsolidateParams78   void operator()(const RawAddress& identity_addr, const RawAddress& rpa) {
79     body(identity_addr, rpa);
80   }
81 };
82 extern struct L2CA_ConsolidateParams L2CA_ConsolidateParams;
83 // Name: L2CA_GetBleConnRole
84 // Params: const RawAddress& bd_addr
85 // Returns: hci_role_t
86 struct L2CA_GetBleConnRole {
87   std::function<hci_role_t(const RawAddress& bd_addr)> body{
88           [](const RawAddress& /* bd_addr */) { return HCI_ROLE_CENTRAL; }};
operatorL2CA_GetBleConnRole89   hci_role_t operator()(const RawAddress& bd_addr) { return body(bd_addr); }
90 };
91 extern struct L2CA_GetBleConnRole L2CA_GetBleConnRole;
92 // Name: l2cble_notify_le_connection
93 // Params: const RawAddress& bda
94 // Returns: void
95 struct l2cble_notify_le_connection {
96   std::function<void(const RawAddress& bda)> body{[](const RawAddress& /* bda */) {}};
operatorl2cble_notify_le_connection97   void operator()(const RawAddress& bda) { body(bda); }
98 };
99 extern struct l2cble_notify_le_connection l2cble_notify_le_connection;
100 // Name: l2cble_conn_comp
101 // Params: uint16_t handle, uint8_t role, const RawAddress& bda, tBLE_ADDR_TYPE
102 // type, uint16_t conn_interval, uint16_t conn_latency, uint16_t conn_timeout
103 // Returns: bool
104 struct l2cble_conn_comp {
105   std::function<bool(uint16_t handle, uint8_t role, const RawAddress& bda, tBLE_ADDR_TYPE type,
106                      uint16_t conn_interval, uint16_t conn_latency, uint16_t conn_timeout)>
107           body{[](uint16_t /* handle */, uint8_t /* role */, const RawAddress& /* bda */,
108                   tBLE_ADDR_TYPE /* type */, uint16_t /* conn_interval */,
109                   uint16_t /* conn_latency */, uint16_t /* conn_timeout */) { return false; }};
operatorl2cble_conn_comp110   bool operator()(uint16_t handle, uint8_t role, const RawAddress& bda, tBLE_ADDR_TYPE type,
111                   uint16_t conn_interval, uint16_t conn_latency, uint16_t conn_timeout) {
112     return body(handle, role, bda, type, conn_interval, conn_latency, conn_timeout);
113   }
114 };
115 extern struct l2cble_conn_comp l2cble_conn_comp;
116 // Name: l2cble_process_conn_update_evt
117 // Params: uint16_t handle, uint8_t status, uint16_t interval, uint16_t latency,
118 // uint16_t timeout Returns: void
119 struct l2cble_process_conn_update_evt {
120   std::function<void(uint16_t handle, uint8_t status, uint16_t interval, uint16_t latency,
121                      uint16_t timeout)>
122           body{[](uint16_t /* handle */, uint8_t /* status */, uint16_t /* interval */,
123                   uint16_t /* latency */, uint16_t /* timeout */) {}};
operatorl2cble_process_conn_update_evt124   void operator()(uint16_t handle, uint8_t status, uint16_t interval, uint16_t latency,
125                   uint16_t timeout) {
126     body(handle, status, interval, latency, timeout);
127   }
128 };
129 extern struct l2cble_process_conn_update_evt l2cble_process_conn_update_evt;
130 // Name: l2cble_process_sig_cmd
131 // Params: tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len
132 // Returns: void
133 struct l2cble_process_sig_cmd {
134   std::function<void(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len)> body{
135           [](tL2C_LCB* /* p_lcb */, uint8_t* /* p */, uint16_t /* pkt_len */) {}};
operatorl2cble_process_sig_cmd136   void operator()(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) { body(p_lcb, p, pkt_len); }
137 };
138 extern struct l2cble_process_sig_cmd l2cble_process_sig_cmd;
139 // Name: l2cble_create_conn
140 // Params: tL2C_LCB* p_lcb
141 // Returns: bool
142 struct l2cble_create_conn {
143   std::function<bool(tL2C_LCB* p_lcb)> body{[](tL2C_LCB* /* p_lcb */) { return false; }};
operatorl2cble_create_conn144   bool operator()(tL2C_LCB* p_lcb) { return body(p_lcb); }
145 };
146 extern struct l2cble_create_conn l2cble_create_conn;
147 // Name: l2c_link_process_ble_num_bufs
148 // Params: uint16_t num_lm_ble_bufs
149 // Returns: void
150 struct l2c_link_process_ble_num_bufs {
151   std::function<void(uint16_t num_lm_ble_bufs)> body{[](uint16_t /* num_lm_ble_bufs */) {}};
operatorl2c_link_process_ble_num_bufs152   void operator()(uint16_t num_lm_ble_bufs) { body(num_lm_ble_bufs); }
153 };
154 extern struct l2c_link_process_ble_num_bufs l2c_link_process_ble_num_bufs;
155 // Name: l2c_ble_link_adjust_allocation
156 // Params: void
157 // Returns: void
158 struct l2c_ble_link_adjust_allocation {
159   std::function<void(void)> body{[](void) {}};
operatorl2c_ble_link_adjust_allocation160   void operator()(void) { body(); }
161 };
162 extern struct l2c_ble_link_adjust_allocation l2c_ble_link_adjust_allocation;
163 // Name: l2cble_process_rc_param_request_evt
164 // Params: uint16_t handle, uint16_t int_min, uint16_t int_max, uint16_t
165 // latency, uint16_t timeout Returns: void
166 struct l2cble_process_rc_param_request_evt {
167   std::function<void(uint16_t handle, uint16_t int_min, uint16_t int_max, uint16_t latency,
168                      uint16_t timeout)>
169           body{[](uint16_t /* handle */, uint16_t /* int_min */, uint16_t /* int_max */,
170                   uint16_t /* latency */, uint16_t /* timeout */) {}};
operatorl2cble_process_rc_param_request_evt171   void operator()(uint16_t handle, uint16_t int_min, uint16_t int_max, uint16_t latency,
172                   uint16_t timeout) {
173     body(handle, int_min, int_max, latency, timeout);
174   }
175 };
176 extern struct l2cble_process_rc_param_request_evt l2cble_process_rc_param_request_evt;
177 // Name: l2cble_update_data_length
178 // Params: tL2C_LCB* p_lcb
179 // Returns: void
180 struct l2cble_update_data_length {
181   std::function<void(tL2C_LCB* p_lcb)> body{[](tL2C_LCB* /* p_lcb */) {}};
operatorl2cble_update_data_length182   void operator()(tL2C_LCB* p_lcb) { body(p_lcb); }
183 };
184 extern struct l2cble_update_data_length l2cble_update_data_length;
185 // Name: l2cble_process_data_length_change_event
186 // Params: uint16_t handle, uint16_t tx_data_len, uint16_t rx_data_len
187 // Returns: void
188 struct l2cble_process_data_length_change_event {
189   std::function<void(uint16_t handle, uint16_t tx_data_len, uint16_t rx_data_len)> body{
190           [](uint16_t /* handle */, uint16_t /* tx_data_len */, uint16_t /* rx_data_len */) {}};
operatorl2cble_process_data_length_change_event191   void operator()(uint16_t handle, uint16_t tx_data_len, uint16_t rx_data_len) {
192     body(handle, tx_data_len, rx_data_len);
193   }
194 };
195 extern struct l2cble_process_data_length_change_event l2cble_process_data_length_change_event;
196 // Name: l2cble_credit_based_conn_req
197 // Params: tL2C_CCB* p_ccb
198 // Returns: void
199 struct l2cble_credit_based_conn_req {
200   std::function<void(tL2C_CCB* p_ccb)> body{[](tL2C_CCB* /* p_ccb */) {}};
operatorl2cble_credit_based_conn_req201   void operator()(tL2C_CCB* p_ccb) { body(p_ccb); }
202 };
203 extern struct l2cble_credit_based_conn_req l2cble_credit_based_conn_req;
204 // Name: l2cble_credit_based_conn_res
205 // Params: tL2C_CCB* p_ccb, uint16_t result
206 // Returns: void
207 struct l2cble_credit_based_conn_res {
208   std::function<void(tL2C_CCB* p_ccb, tL2CAP_LE_RESULT_CODE result)> body{
209           [](tL2C_CCB* /* p_ccb */, tL2CAP_LE_RESULT_CODE /* result */) {}};
operatorl2cble_credit_based_conn_res210   void operator()(tL2C_CCB* p_ccb, tL2CAP_LE_RESULT_CODE result) { body(p_ccb, result); }
211 };
212 extern struct l2cble_credit_based_conn_res l2cble_credit_based_conn_res;
213 // Name: l2cble_send_flow_control_credit
214 // Params: tL2C_CCB* p_ccb, uint16_t credit_value
215 // Returns: void
216 struct l2cble_send_flow_control_credit {
217   std::function<void(tL2C_CCB* p_ccb, uint16_t credit_value)> body{
218           [](tL2C_CCB* /* p_ccb */, uint16_t /* credit_value */) {}};
operatorl2cble_send_flow_control_credit219   void operator()(tL2C_CCB* p_ccb, uint16_t credit_value) { body(p_ccb, credit_value); }
220 };
221 extern struct l2cble_send_flow_control_credit l2cble_send_flow_control_credit;
222 // Name: l2cble_send_peer_disc_req
223 // Params: tL2C_CCB* p_ccb
224 // Returns: void
225 struct l2cble_send_peer_disc_req {
226   std::function<void(tL2C_CCB* p_ccb)> body{[](tL2C_CCB* /* p_ccb */) {}};
operatorl2cble_send_peer_disc_req227   void operator()(tL2C_CCB* p_ccb) { body(p_ccb); }
228 };
229 extern struct l2cble_send_peer_disc_req l2cble_send_peer_disc_req;
230 // Name: l2ble_sec_access_req
231 // Params: const RawAddress& bd_addr, uint16_t psm, bool is_originator,
232 // tL2CAP_SEC_CBACK* p_callback, void* p_ref_data Returns: tL2CAP_LE_RESULT_CODE
233 struct l2ble_sec_access_req {
234   std::function<tL2CAP_LE_RESULT_CODE(const RawAddress& bd_addr, uint16_t psm, bool is_originator,
235                                       tBTM_SEC_CALLBACK* p_callback, void* p_ref_data)>
236           body{[](const RawAddress& /* bd_addr */, uint16_t /* psm */, bool /* is_originator */,
237                   tBTM_SEC_CALLBACK* /* p_callback */, void* /* p_ref_data */) {
238             return tL2CAP_LE_RESULT_CODE::L2CAP_LE_RESULT_CONN_OK;
239           }};
operatorl2ble_sec_access_req240   tL2CAP_LE_RESULT_CODE operator()(const RawAddress& bd_addr, uint16_t psm, bool is_originator,
241                                    tBTM_SEC_CALLBACK* p_callback, void* p_ref_data) {
242     return body(bd_addr, psm, is_originator, p_callback, p_ref_data);
243   }
244 };
245 extern struct l2ble_sec_access_req l2ble_sec_access_req;
246 // Name: L2CA_AdjustConnectionIntervals
247 // Params: uint16_t* min_interval, uint16_t* max_interval, uint16_t
248 // floor_interval Returns: void
249 struct L2CA_AdjustConnectionIntervals {
250   std::function<void(uint16_t* min_interval, uint16_t* max_interval, uint16_t floor_interval)> body{
251           [](uint16_t* /* min_interval */, uint16_t* /* max_interval */,
252              uint16_t /* floor_interval */) {}};
operatorL2CA_AdjustConnectionIntervals253   void operator()(uint16_t* min_interval, uint16_t* max_interval, uint16_t floor_interval) {
254     body(min_interval, max_interval, floor_interval);
255   }
256 };
257 extern struct L2CA_AdjustConnectionIntervals L2CA_AdjustConnectionIntervals;
258 // Name: L2CA_SetEcosystemBaseInterval
259 // Params: uint16_t* min_interval, uint16_t* max_interval, uint16_t
260 // floor_interval Returns: void
261 struct L2CA_SetEcosystemBaseInterval {
262   std::function<void(uint32_t base_interval)> body{[](uint32_t /* base_interval */) {}};
operatorL2CA_SetEcosystemBaseInterval263   void operator()(uint32_t base_interval) { body(base_interval); }
264 };
265 extern struct L2CA_SetEcosystemBaseInterval L2CA_SetEcosystemBaseInterval;
266 // Name: l2cble_use_preferred_conn_params
267 // Params: const RawAddress& bda
268 // Returns: void
269 struct l2cble_use_preferred_conn_params {
270   std::function<void(const RawAddress& bda)> body{[](const RawAddress& /* bda */) {}};
operatorl2cble_use_preferred_conn_params271   void operator()(const RawAddress& bda) { body(bda); }
272 };
273 extern struct l2cble_use_preferred_conn_params l2cble_use_preferred_conn_params;
274 // Name: L2CA_SubrateRequest
275 // Params:
276 // Returns: bool
277 struct L2CA_SubrateRequest {
278   std::function<bool(const RawAddress& rem_bda, uint16_t subrate_min, uint16_t subrate_max,
279                      uint16_t max_latency, uint16_t cont_num, uint16_t timeout)>
280           body{[](const RawAddress& /* rem_bda */, uint16_t /* subrate_min */,
281                   uint16_t /* subrate_max */, uint16_t /* max_latency */, uint16_t /* cont_num */,
282                   uint16_t /* timeout */) { return false; }};
operatorL2CA_SubrateRequest283   bool operator()(const RawAddress& rem_bda, uint16_t subrate_min, uint16_t subrate_max,
284                   uint16_t max_latency, uint16_t cont_num, uint16_t timeout) {
285     return body(rem_bda, subrate_min, subrate_max, max_latency, cont_num, timeout);
286   }
287 };
288 extern struct L2CA_SubrateRequest L2CA_SubrateRequest;
289 // Name: l2cble_process_subrate_change_evt
290 // Params: const RawAddress& bda
291 // Returns: void
292 struct l2cble_process_subrate_change_evt {
293   std::function<void(uint16_t handle, uint8_t status, uint16_t subrate_factor,
294                      uint16_t peripheral_latency, uint16_t cont_num, uint16_t timeout)>
295           body{[](uint16_t /* handle */, uint8_t /* status */, uint16_t /* subrate_factor */,
296                   uint16_t /* peripheral_latency */, uint16_t /* cont_num */,
297                   uint16_t /* timeout */) {}};
operatorl2cble_process_subrate_change_evt298   void operator()(uint16_t handle, uint8_t status, uint16_t subrate_factor,
299                   uint16_t peripheral_latency, uint16_t cont_num, uint16_t timeout) {
300     body(handle, status, subrate_factor, peripheral_latency, cont_num, timeout);
301   }
302 };
303 extern struct l2cble_process_subrate_change_evt l2cble_process_subrate_change_evt;
304 
305 }  // namespace stack_l2cap_ble
306 }  // namespace mock
307 }  // namespace test
308 
309 // END mockcify generation
310