1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
|
/*
* Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Generated mock file from original source file
* Functions generated:22
*
* mockcify.pl ver 0.2
*/
#include <cstdint>
#include <functional>
#include <map>
#include <string>
extern std::map<std::string, int> mock_function_count_map;
// Original included files, if any
// NOTE: Since this is a mock file with mock definitions some number of
// include files may not be required. The include-what-you-use
// still applies, but crafting proper inclusion is out of scope
// for this effort. This compilation unit may compile as-is, or
// may need attention to prune the inclusion set.
#include "stack/include/l2c_api.h"
#include "stack/l2cap/l2c_int.h"
#include "types/ble_address_with_type.h"
#include "types/hci_role.h"
#include "types/raw_address.h"
// Mocked compile conditionals, if any
#ifndef UNUSED_ATTR
#define UNUSED_ATTR
#endif
namespace test {
namespace mock {
namespace stack_l2cap_ble {
// Shared state between mocked functions and tests
// Name: L2CA_UpdateBleConnParams
// Params: const RawAddress& rem_bda, uint16_t min_int, uint16_t max_int,
// uint16_t latency, uint16_t timeout, uint16_t min_ce_len, uint16_t max_ce_len
// Returns: bool
struct L2CA_UpdateBleConnParams {
std::function<bool(const RawAddress& rem_bda, uint16_t min_int,
uint16_t max_int, uint16_t latency, uint16_t timeout,
uint16_t min_ce_len, uint16_t max_ce_len)>
body{[](const RawAddress& rem_bda, uint16_t min_int, uint16_t max_int,
uint16_t latency, uint16_t timeout, uint16_t min_ce_len,
uint16_t max_ce_len) { return false; }};
bool operator()(const RawAddress& rem_bda, uint16_t min_int, uint16_t max_int,
uint16_t latency, uint16_t timeout, uint16_t min_ce_len,
uint16_t max_ce_len) {
return body(rem_bda, min_int, max_int, latency, timeout, min_ce_len,
max_ce_len);
};
};
extern struct L2CA_UpdateBleConnParams L2CA_UpdateBleConnParams;
// Name: L2CA_EnableUpdateBleConnParams
// Params: const RawAddress& rem_bda, bool enable
// Returns: bool
struct L2CA_EnableUpdateBleConnParams {
std::function<bool(const RawAddress& rem_bda, bool enable)> body{
[](const RawAddress& rem_bda, bool enable) { return false; }};
bool operator()(const RawAddress& rem_bda, bool enable) {
return body(rem_bda, enable);
};
};
extern struct L2CA_EnableUpdateBleConnParams L2CA_EnableUpdateBleConnParams;
// Name: L2CA_GetBleConnRole
// Params: const RawAddress& bd_addr
// Returns: hci_role_t
struct L2CA_GetBleConnRole {
std::function<hci_role_t(const RawAddress& bd_addr)> body{
[](const RawAddress& bd_addr) { return HCI_ROLE_CENTRAL; }};
hci_role_t operator()(const RawAddress& bd_addr) { return body(bd_addr); };
};
extern struct L2CA_GetBleConnRole L2CA_GetBleConnRole;
// Name: l2cble_notify_le_connection
// Params: const RawAddress& bda
// Returns: void
struct l2cble_notify_le_connection {
std::function<void(const RawAddress& bda)> body{[](const RawAddress& bda) {}};
void operator()(const RawAddress& bda) { body(bda); };
};
extern struct l2cble_notify_le_connection l2cble_notify_le_connection;
// Name: l2cble_conn_comp
// Params: uint16_t handle, uint8_t role, const RawAddress& bda, tBLE_ADDR_TYPE
// type, uint16_t conn_interval, uint16_t conn_latency, uint16_t conn_timeout
// Returns: bool
struct l2cble_conn_comp {
std::function<bool(uint16_t handle, uint8_t role, const RawAddress& bda,
tBLE_ADDR_TYPE type, uint16_t conn_interval,
uint16_t conn_latency, uint16_t conn_timeout)>
body{[](uint16_t handle, uint8_t role, const RawAddress& bda,
tBLE_ADDR_TYPE type, uint16_t conn_interval,
uint16_t conn_latency, uint16_t conn_timeout) { return false; }};
bool operator()(uint16_t handle, uint8_t role, const RawAddress& bda,
tBLE_ADDR_TYPE type, uint16_t conn_interval,
uint16_t conn_latency, uint16_t conn_timeout) {
return body(handle, role, bda, type, conn_interval, conn_latency,
conn_timeout);
};
};
extern struct l2cble_conn_comp l2cble_conn_comp;
// Name: l2cble_conn_comp_from_address_with_type
// Params: uint16_t handle, uint8_t role, const tBLE_BD_ADDR&
// address_with_type, uint16_t conn_interval, uint16_t conn_latency, uint16_t
// conn_timeout Returns: bool
struct l2cble_conn_comp_from_address_with_type {
std::function<bool(
uint16_t handle, uint8_t role, const tBLE_BD_ADDR& address_with_type,
uint16_t conn_interval, uint16_t conn_latency, uint16_t conn_timeout)>
body{[](uint16_t handle, uint8_t role,
const tBLE_BD_ADDR& address_with_type, uint16_t conn_interval,
uint16_t conn_latency, uint16_t conn_timeout) { return false; }};
bool operator()(uint16_t handle, uint8_t role,
const tBLE_BD_ADDR& address_with_type, uint16_t conn_interval,
uint16_t conn_latency, uint16_t conn_timeout) {
return body(handle, role, address_with_type, conn_interval, conn_latency,
conn_timeout);
};
};
extern struct l2cble_conn_comp_from_address_with_type
l2cble_conn_comp_from_address_with_type;
// Name: l2cble_process_conn_update_evt
// Params: uint16_t handle, uint8_t status, uint16_t interval, uint16_t latency,
// uint16_t timeout Returns: void
struct l2cble_process_conn_update_evt {
std::function<void(uint16_t handle, uint8_t status, uint16_t interval,
uint16_t latency, uint16_t timeout)>
body{[](uint16_t handle, uint8_t status, uint16_t interval,
uint16_t latency, uint16_t timeout) {}};
void operator()(uint16_t handle, uint8_t status, uint16_t interval,
uint16_t latency, uint16_t timeout) {
body(handle, status, interval, latency, timeout);
};
};
extern struct l2cble_process_conn_update_evt l2cble_process_conn_update_evt;
// Name: l2cble_process_sig_cmd
// Params: tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len
// Returns: void
struct l2cble_process_sig_cmd {
std::function<void(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len)> body{
[](tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) {}};
void operator()(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) {
body(p_lcb, p, pkt_len);
};
};
extern struct l2cble_process_sig_cmd l2cble_process_sig_cmd;
// Name: l2cble_create_conn
// Params: tL2C_LCB* p_lcb
// Returns: bool
struct l2cble_create_conn {
std::function<bool(tL2C_LCB* p_lcb)> body{
[](tL2C_LCB* p_lcb) { return false; }};
bool operator()(tL2C_LCB* p_lcb) { return body(p_lcb); };
};
extern struct l2cble_create_conn l2cble_create_conn;
// Name: l2c_link_processs_ble_num_bufs
// Params: uint16_t num_lm_ble_bufs
// Returns: void
struct l2c_link_processs_ble_num_bufs {
std::function<void(uint16_t num_lm_ble_bufs)> body{
[](uint16_t num_lm_ble_bufs) {}};
void operator()(uint16_t num_lm_ble_bufs) { body(num_lm_ble_bufs); };
};
extern struct l2c_link_processs_ble_num_bufs l2c_link_processs_ble_num_bufs;
// Name: l2c_ble_link_adjust_allocation
// Params: void
// Returns: void
struct l2c_ble_link_adjust_allocation {
std::function<void(void)> body{[](void) {}};
void operator()(void) { body(); };
};
extern struct l2c_ble_link_adjust_allocation l2c_ble_link_adjust_allocation;
// Name: l2cble_process_rc_param_request_evt
// Params: uint16_t handle, uint16_t int_min, uint16_t int_max, uint16_t
// latency, uint16_t timeout Returns: void
struct l2cble_process_rc_param_request_evt {
std::function<void(uint16_t handle, uint16_t int_min, uint16_t int_max,
uint16_t latency, uint16_t timeout)>
body{[](uint16_t handle, uint16_t int_min, uint16_t int_max,
uint16_t latency, uint16_t timeout) {}};
void operator()(uint16_t handle, uint16_t int_min, uint16_t int_max,
uint16_t latency, uint16_t timeout) {
body(handle, int_min, int_max, latency, timeout);
};
};
extern struct l2cble_process_rc_param_request_evt
l2cble_process_rc_param_request_evt;
// Name: l2cble_update_data_length
// Params: tL2C_LCB* p_lcb
// Returns: void
struct l2cble_update_data_length {
std::function<void(tL2C_LCB* p_lcb)> body{[](tL2C_LCB* p_lcb) {}};
void operator()(tL2C_LCB* p_lcb) { body(p_lcb); };
};
extern struct l2cble_update_data_length l2cble_update_data_length;
// Name: l2cble_process_data_length_change_event
// Params: uint16_t handle, uint16_t tx_data_len, uint16_t rx_data_len
// Returns: void
struct l2cble_process_data_length_change_event {
std::function<void(uint16_t handle, uint16_t tx_data_len,
uint16_t rx_data_len)>
body{[](uint16_t handle, uint16_t tx_data_len, uint16_t rx_data_len) {}};
void operator()(uint16_t handle, uint16_t tx_data_len, uint16_t rx_data_len) {
body(handle, tx_data_len, rx_data_len);
};
};
extern struct l2cble_process_data_length_change_event
l2cble_process_data_length_change_event;
// Name: l2cble_credit_based_conn_req
// Params: tL2C_CCB* p_ccb
// Returns: void
struct l2cble_credit_based_conn_req {
std::function<void(tL2C_CCB* p_ccb)> body{[](tL2C_CCB* p_ccb) {}};
void operator()(tL2C_CCB* p_ccb) { body(p_ccb); };
};
extern struct l2cble_credit_based_conn_req l2cble_credit_based_conn_req;
// Name: l2cble_credit_based_conn_res
// Params: tL2C_CCB* p_ccb, uint16_t result
// Returns: void
struct l2cble_credit_based_conn_res {
std::function<void(tL2C_CCB* p_ccb, uint16_t result)> body{
[](tL2C_CCB* p_ccb, uint16_t result) {}};
void operator()(tL2C_CCB* p_ccb, uint16_t result) { body(p_ccb, result); };
};
extern struct l2cble_credit_based_conn_res l2cble_credit_based_conn_res;
// Name: l2cble_send_flow_control_credit
// Params: tL2C_CCB* p_ccb, uint16_t credit_value
// Returns: void
struct l2cble_send_flow_control_credit {
std::function<void(tL2C_CCB* p_ccb, uint16_t credit_value)> body{
[](tL2C_CCB* p_ccb, uint16_t credit_value) {}};
void operator()(tL2C_CCB* p_ccb, uint16_t credit_value) {
body(p_ccb, credit_value);
};
};
extern struct l2cble_send_flow_control_credit l2cble_send_flow_control_credit;
// Name: l2cble_send_peer_disc_req
// Params: tL2C_CCB* p_ccb
// Returns: void
struct l2cble_send_peer_disc_req {
std::function<void(tL2C_CCB* p_ccb)> body{[](tL2C_CCB* p_ccb) {}};
void operator()(tL2C_CCB* p_ccb) { body(p_ccb); };
};
extern struct l2cble_send_peer_disc_req l2cble_send_peer_disc_req;
// Name: l2cble_sec_comp
// Params: const RawAddress* bda, tBT_TRANSPORT transport, void* p_ref_data,
// tBTM_STATUS status Returns: void
struct l2cble_sec_comp {
std::function<void(const RawAddress* bda, tBT_TRANSPORT transport,
void* p_ref_data, tBTM_STATUS status)>
body{[](const RawAddress* bda, tBT_TRANSPORT transport, void* p_ref_data,
tBTM_STATUS status) {}};
void operator()(const RawAddress* bda, tBT_TRANSPORT transport,
void* p_ref_data, tBTM_STATUS status) {
body(bda, transport, p_ref_data, status);
};
};
extern struct l2cble_sec_comp l2cble_sec_comp;
// Name: l2ble_sec_access_req
// Params: const RawAddress& bd_addr, uint16_t psm, bool is_originator,
// tL2CAP_SEC_CBACK* p_callback, void* p_ref_data Returns: tL2CAP_LE_RESULT_CODE
struct l2ble_sec_access_req {
std::function<tL2CAP_LE_RESULT_CODE(
const RawAddress& bd_addr, uint16_t psm, bool is_originator,
tL2CAP_SEC_CBACK* p_callback, void* p_ref_data)>
body{[](const RawAddress& bd_addr, uint16_t psm, bool is_originator,
tL2CAP_SEC_CBACK* p_callback,
void* p_ref_data) { return L2CAP_LE_RESULT_CONN_OK; }};
tL2CAP_LE_RESULT_CODE operator()(const RawAddress& bd_addr, uint16_t psm,
bool is_originator,
tL2CAP_SEC_CBACK* p_callback,
void* p_ref_data) {
return body(bd_addr, psm, is_originator, p_callback, p_ref_data);
};
};
extern struct l2ble_sec_access_req l2ble_sec_access_req;
// Name: L2CA_AdjustConnectionIntervals
// Params: uint16_t* min_interval, uint16_t* max_interval, uint16_t
// floor_interval Returns: void
struct L2CA_AdjustConnectionIntervals {
std::function<void(uint16_t* min_interval, uint16_t* max_interval,
uint16_t floor_interval)>
body{[](uint16_t* min_interval, uint16_t* max_interval,
uint16_t floor_interval) {}};
void operator()(uint16_t* min_interval, uint16_t* max_interval,
uint16_t floor_interval) {
body(min_interval, max_interval, floor_interval);
};
};
extern struct L2CA_AdjustConnectionIntervals L2CA_AdjustConnectionIntervals;
// Name: l2cble_use_preferred_conn_params
// Params: const RawAddress& bda
// Returns: void
struct l2cble_use_preferred_conn_params {
std::function<void(const RawAddress& bda)> body{[](const RawAddress& bda) {}};
void operator()(const RawAddress& bda) { body(bda); };
};
extern struct l2cble_use_preferred_conn_params l2cble_use_preferred_conn_params;
} // namespace stack_l2cap_ble
} // namespace mock
} // namespace test
// END mockcify generation
|