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