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 // Mock include file to share data between tests and mock
24 #include "test/mock/mock_stack_l2cap_ble.h"
25
26 // Original included files, if any
27
28 #include "stack/include/l2cap_controller_interface.h"
29 #include "stack/include/l2cap_hci_link_interface.h"
30 #include "test/common/mock_functions.h"
31 #include "types/raw_address.h"
32
33 // Mocked compile conditionals, if any
34 // Mocked internal structures, if any
35
36 namespace test {
37 namespace mock {
38 namespace stack_l2cap_ble {
39
40 // Function state capture and return values, if needed
41 struct L2CA_UpdateBleConnParams L2CA_UpdateBleConnParams;
42 struct L2CA_LockBleConnParamsForServiceDiscovery L2CA_LockBleConnParamsForServiceDiscovery;
43 struct L2CA_LockBleConnParamsForProfileConnection L2CA_LockBleConnParamsForProfileConnection;
44 struct L2CA_ConsolidateParams L2CA_ConsolidateParams;
45 struct L2CA_GetBleConnRole L2CA_GetBleConnRole;
46 struct L2CA_GetBleConnInterval L2CA_GetBleConnInterval;
47 struct l2cble_notify_le_connection l2cble_notify_le_connection;
48 struct l2cble_conn_comp l2cble_conn_comp;
49 struct l2cble_process_conn_update_evt l2cble_process_conn_update_evt;
50 struct l2cble_process_sig_cmd l2cble_process_sig_cmd;
51 struct l2cble_create_conn l2cble_create_conn;
52 struct l2c_link_process_ble_num_bufs l2c_link_process_ble_num_bufs;
53 struct l2c_ble_link_adjust_allocation l2c_ble_link_adjust_allocation;
54 struct l2cble_process_rc_param_request_evt l2cble_process_rc_param_request_evt;
55 struct l2cble_update_data_length l2cble_update_data_length;
56 struct l2cble_process_data_length_change_event l2cble_process_data_length_change_event;
57 struct l2cble_credit_based_conn_req l2cble_credit_based_conn_req;
58 struct l2cble_credit_based_conn_res l2cble_credit_based_conn_res;
59 struct l2cble_send_flow_control_credit l2cble_send_flow_control_credit;
60 struct l2cble_send_peer_disc_req l2cble_send_peer_disc_req;
61 struct l2ble_sec_access_req l2ble_sec_access_req;
62 struct L2CA_AdjustConnectionIntervals L2CA_AdjustConnectionIntervals;
63 struct L2CA_SetEcosystemBaseInterval L2CA_SetEcosystemBaseInterval;
64 struct l2cble_use_preferred_conn_params l2cble_use_preferred_conn_params;
65 struct L2CA_SubrateRequest L2CA_SubrateRequest;
66 struct l2cble_process_subrate_change_evt l2cble_process_subrate_change_evt;
67
68 } // namespace stack_l2cap_ble
69 } // namespace mock
70 } // namespace test
71
72 // Mocked functions, if any
L2CA_UpdateBleConnParams(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)73 bool L2CA_UpdateBleConnParams(const RawAddress& rem_bda, uint16_t min_int, uint16_t max_int,
74 uint16_t latency, uint16_t timeout, uint16_t min_ce_len,
75 uint16_t max_ce_len) {
76 inc_func_call_count(__func__);
77 return test::mock::stack_l2cap_ble::L2CA_UpdateBleConnParams(rem_bda, min_int, max_int, latency,
78 timeout, min_ce_len, max_ce_len);
79 }
L2CA_LockBleConnParamsForServiceDiscovery(const RawAddress & rem_bda,bool enable)80 void L2CA_LockBleConnParamsForServiceDiscovery(const RawAddress& rem_bda, bool enable) {
81 inc_func_call_count(__func__);
82 return test::mock::stack_l2cap_ble::L2CA_LockBleConnParamsForServiceDiscovery(rem_bda, enable);
83 }
L2CA_LockBleConnParamsForProfileConnection(const RawAddress & rem_bda,bool enable)84 void L2CA_LockBleConnParamsForProfileConnection(const RawAddress& rem_bda, bool enable) {
85 inc_func_call_count(__func__);
86 return test::mock::stack_l2cap_ble::L2CA_LockBleConnParamsForProfileConnection(rem_bda, enable);
87 }
L2CA_Consolidate(const RawAddress & identity_addr,const RawAddress & rpa)88 void L2CA_Consolidate(const RawAddress& identity_addr, const RawAddress& rpa) {
89 inc_func_call_count(__func__);
90 test::mock::stack_l2cap_ble::L2CA_ConsolidateParams(identity_addr, rpa);
91 }
L2CA_GetBleConnRole(const RawAddress & bd_addr)92 hci_role_t L2CA_GetBleConnRole(const RawAddress& bd_addr) {
93 inc_func_call_count(__func__);
94 return test::mock::stack_l2cap_ble::L2CA_GetBleConnRole(bd_addr);
95 }
L2CA_GetBleConnInterval(const RawAddress & bd_addr)96 uint16_t L2CA_GetBleConnInterval(const RawAddress& bd_addr) {
97 inc_func_call_count(__func__);
98 return test::mock::stack_l2cap_ble::L2CA_GetBleConnInterval(bd_addr);
99 }
l2cble_notify_le_connection(const RawAddress & bda)100 void l2cble_notify_le_connection(const RawAddress& bda) {
101 inc_func_call_count(__func__);
102 test::mock::stack_l2cap_ble::l2cble_notify_le_connection(bda);
103 }
l2cble_conn_comp(uint16_t handle,tHCI_ROLE role,const RawAddress & bda,tBLE_ADDR_TYPE type,uint16_t conn_interval,uint16_t conn_latency,uint16_t conn_timeout)104 bool l2cble_conn_comp(uint16_t handle, tHCI_ROLE role, const RawAddress& bda, tBLE_ADDR_TYPE type,
105 uint16_t conn_interval, uint16_t conn_latency, uint16_t conn_timeout) {
106 inc_func_call_count(__func__);
107 return test::mock::stack_l2cap_ble::l2cble_conn_comp(handle, role, bda, type, conn_interval,
108 conn_latency, conn_timeout);
109 }
l2cble_process_conn_update_evt(uint16_t handle,uint8_t status,uint16_t interval,uint16_t latency,uint16_t timeout)110 void l2cble_process_conn_update_evt(uint16_t handle, uint8_t status, uint16_t interval,
111 uint16_t latency, uint16_t timeout) {
112 inc_func_call_count(__func__);
113 test::mock::stack_l2cap_ble::l2cble_process_conn_update_evt(handle, status, interval, latency,
114 timeout);
115 }
l2cble_process_sig_cmd(tL2C_LCB * p_lcb,uint8_t * p,uint16_t pkt_len)116 void l2cble_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) {
117 inc_func_call_count(__func__);
118 test::mock::stack_l2cap_ble::l2cble_process_sig_cmd(p_lcb, p, pkt_len);
119 }
l2cble_create_conn(tL2C_LCB * p_lcb)120 bool l2cble_create_conn(tL2C_LCB* p_lcb) {
121 inc_func_call_count(__func__);
122 return test::mock::stack_l2cap_ble::l2cble_create_conn(p_lcb);
123 }
l2c_link_process_ble_num_bufs(uint16_t num_lm_ble_bufs)124 void l2c_link_process_ble_num_bufs(uint16_t num_lm_ble_bufs) {
125 inc_func_call_count(__func__);
126 test::mock::stack_l2cap_ble::l2c_link_process_ble_num_bufs(num_lm_ble_bufs);
127 }
l2c_ble_link_adjust_allocation(void)128 void l2c_ble_link_adjust_allocation(void) {
129 inc_func_call_count(__func__);
130 test::mock::stack_l2cap_ble::l2c_ble_link_adjust_allocation();
131 }
l2cble_process_rc_param_request_evt(uint16_t handle,uint16_t int_min,uint16_t int_max,uint16_t latency,uint16_t timeout)132 void l2cble_process_rc_param_request_evt(uint16_t handle, uint16_t int_min, uint16_t int_max,
133 uint16_t latency, uint16_t timeout) {
134 inc_func_call_count(__func__);
135 test::mock::stack_l2cap_ble::l2cble_process_rc_param_request_evt(handle, int_min, int_max,
136 latency, timeout);
137 }
l2cble_update_data_length(tL2C_LCB * p_lcb)138 void l2cble_update_data_length(tL2C_LCB* p_lcb) {
139 inc_func_call_count(__func__);
140 test::mock::stack_l2cap_ble::l2cble_update_data_length(p_lcb);
141 }
l2cble_process_data_length_change_event(uint16_t handle,uint16_t tx_data_len,uint16_t rx_data_len)142 void l2cble_process_data_length_change_event(uint16_t handle, uint16_t tx_data_len,
143 uint16_t rx_data_len) {
144 inc_func_call_count(__func__);
145 test::mock::stack_l2cap_ble::l2cble_process_data_length_change_event(handle, tx_data_len,
146 rx_data_len);
147 }
l2cble_credit_based_conn_req(tL2C_CCB * p_ccb)148 void l2cble_credit_based_conn_req(tL2C_CCB* p_ccb) {
149 inc_func_call_count(__func__);
150 test::mock::stack_l2cap_ble::l2cble_credit_based_conn_req(p_ccb);
151 }
l2cble_credit_based_conn_res(tL2C_CCB * p_ccb,tL2CAP_LE_RESULT_CODE result)152 void l2cble_credit_based_conn_res(tL2C_CCB* p_ccb, tL2CAP_LE_RESULT_CODE result) {
153 inc_func_call_count(__func__);
154 test::mock::stack_l2cap_ble::l2cble_credit_based_conn_res(p_ccb, result);
155 }
l2cble_send_flow_control_credit(tL2C_CCB * p_ccb,uint16_t credit_value)156 void l2cble_send_flow_control_credit(tL2C_CCB* p_ccb, uint16_t credit_value) {
157 inc_func_call_count(__func__);
158 test::mock::stack_l2cap_ble::l2cble_send_flow_control_credit(p_ccb, credit_value);
159 }
l2cble_send_peer_disc_req(tL2C_CCB * p_ccb)160 void l2cble_send_peer_disc_req(tL2C_CCB* p_ccb) {
161 inc_func_call_count(__func__);
162 test::mock::stack_l2cap_ble::l2cble_send_peer_disc_req(p_ccb);
163 }
l2ble_sec_access_req(const RawAddress & bd_addr,uint16_t psm,bool is_originator,tBTM_SEC_CALLBACK * p_callback,void * p_ref_data)164 tL2CAP_LE_RESULT_CODE l2ble_sec_access_req(const RawAddress& bd_addr, uint16_t psm,
165 bool is_originator, tBTM_SEC_CALLBACK* p_callback,
166 void* p_ref_data) {
167 inc_func_call_count(__func__);
168 return test::mock::stack_l2cap_ble::l2ble_sec_access_req(bd_addr, psm, is_originator, p_callback,
169 p_ref_data);
170 }
L2CA_AdjustConnectionIntervals(uint16_t * min_interval,uint16_t * max_interval,uint16_t floor_interval)171 void L2CA_AdjustConnectionIntervals(uint16_t* min_interval, uint16_t* max_interval,
172 uint16_t floor_interval) {
173 inc_func_call_count(__func__);
174 test::mock::stack_l2cap_ble::L2CA_AdjustConnectionIntervals(min_interval, max_interval,
175 floor_interval);
176 }
L2CA_SetEcosystemBaseInterval(uint32_t base_interval)177 void L2CA_SetEcosystemBaseInterval(uint32_t base_interval) {
178 inc_func_call_count(__func__);
179 test::mock::stack_l2cap_ble::L2CA_SetEcosystemBaseInterval(base_interval);
180 }
l2cble_use_preferred_conn_params(const RawAddress & bda)181 void l2cble_use_preferred_conn_params(const RawAddress& bda) {
182 inc_func_call_count(__func__);
183 test::mock::stack_l2cap_ble::l2cble_use_preferred_conn_params(bda);
184 }
L2CA_SubrateRequest(const RawAddress & rem_bda,uint16_t subrate_min,uint16_t subrate_max,uint16_t max_latency,uint16_t cont_num,uint16_t timeout)185 bool L2CA_SubrateRequest(const RawAddress& rem_bda, uint16_t subrate_min, uint16_t subrate_max,
186 uint16_t max_latency, uint16_t cont_num, uint16_t timeout) {
187 inc_func_call_count(__func__);
188 return test::mock::stack_l2cap_ble::L2CA_SubrateRequest(rem_bda, subrate_min, subrate_max,
189 max_latency, cont_num, timeout);
190 }
l2cble_process_subrate_change_evt(uint16_t handle,uint8_t status,uint16_t subrate_factor,uint16_t peripheral_latency,uint16_t cont_num,uint16_t timeout)191 void l2cble_process_subrate_change_evt(uint16_t handle, uint8_t status, uint16_t subrate_factor,
192 uint16_t peripheral_latency, uint16_t cont_num,
193 uint16_t timeout) {
194 inc_func_call_count(__func__);
195 test::mock::stack_l2cap_ble::l2cble_process_subrate_change_evt(
196 handle, status, subrate_factor, peripheral_latency, cont_num, timeout);
197 }
198
199 // END mockcify generation
200