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 // TODO(b/369381361) Enfore -Wmissing-prototypes
35 #pragma GCC diagnostic ignored "-Wmissing-prototypes"
36 
37 namespace test {
38 namespace mock {
39 namespace stack_l2cap_ble {
40 
41 // Function state capture and return values, if needed
42 struct L2CA_UpdateBleConnParams L2CA_UpdateBleConnParams;
43 struct L2CA_LockBleConnParamsForServiceDiscovery L2CA_LockBleConnParamsForServiceDiscovery;
44 struct L2CA_LockBleConnParamsForProfileConnection L2CA_LockBleConnParamsForProfileConnection;
45 struct L2CA_ConsolidateParams L2CA_ConsolidateParams;
46 struct L2CA_GetBleConnRole L2CA_GetBleConnRole;
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 }
l2cble_notify_le_connection(const RawAddress & bda)96 void l2cble_notify_le_connection(const RawAddress& bda) {
97   inc_func_call_count(__func__);
98   test::mock::stack_l2cap_ble::l2cble_notify_le_connection(bda);
99 }
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)100 bool l2cble_conn_comp(uint16_t handle, tHCI_ROLE role, const RawAddress& bda, tBLE_ADDR_TYPE type,
101                       uint16_t conn_interval, uint16_t conn_latency, uint16_t conn_timeout) {
102   inc_func_call_count(__func__);
103   return test::mock::stack_l2cap_ble::l2cble_conn_comp(handle, role, bda, type, conn_interval,
104                                                        conn_latency, conn_timeout);
105 }
l2cble_process_conn_update_evt(uint16_t handle,uint8_t status,uint16_t interval,uint16_t latency,uint16_t timeout)106 void l2cble_process_conn_update_evt(uint16_t handle, uint8_t status, uint16_t interval,
107                                     uint16_t latency, uint16_t timeout) {
108   inc_func_call_count(__func__);
109   test::mock::stack_l2cap_ble::l2cble_process_conn_update_evt(handle, status, interval, latency,
110                                                               timeout);
111 }
l2cble_process_sig_cmd(tL2C_LCB * p_lcb,uint8_t * p,uint16_t pkt_len)112 void l2cble_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) {
113   inc_func_call_count(__func__);
114   test::mock::stack_l2cap_ble::l2cble_process_sig_cmd(p_lcb, p, pkt_len);
115 }
l2cble_create_conn(tL2C_LCB * p_lcb)116 bool l2cble_create_conn(tL2C_LCB* p_lcb) {
117   inc_func_call_count(__func__);
118   return test::mock::stack_l2cap_ble::l2cble_create_conn(p_lcb);
119 }
l2c_link_process_ble_num_bufs(uint16_t num_lm_ble_bufs)120 void l2c_link_process_ble_num_bufs(uint16_t num_lm_ble_bufs) {
121   inc_func_call_count(__func__);
122   test::mock::stack_l2cap_ble::l2c_link_process_ble_num_bufs(num_lm_ble_bufs);
123 }
l2c_ble_link_adjust_allocation(void)124 void l2c_ble_link_adjust_allocation(void) {
125   inc_func_call_count(__func__);
126   test::mock::stack_l2cap_ble::l2c_ble_link_adjust_allocation();
127 }
l2cble_process_rc_param_request_evt(uint16_t handle,uint16_t int_min,uint16_t int_max,uint16_t latency,uint16_t timeout)128 void l2cble_process_rc_param_request_evt(uint16_t handle, uint16_t int_min, uint16_t int_max,
129                                          uint16_t latency, uint16_t timeout) {
130   inc_func_call_count(__func__);
131   test::mock::stack_l2cap_ble::l2cble_process_rc_param_request_evt(handle, int_min, int_max,
132                                                                    latency, timeout);
133 }
l2cble_update_data_length(tL2C_LCB * p_lcb)134 void l2cble_update_data_length(tL2C_LCB* p_lcb) {
135   inc_func_call_count(__func__);
136   test::mock::stack_l2cap_ble::l2cble_update_data_length(p_lcb);
137 }
l2cble_process_data_length_change_event(uint16_t handle,uint16_t tx_data_len,uint16_t rx_data_len)138 void l2cble_process_data_length_change_event(uint16_t handle, uint16_t tx_data_len,
139                                              uint16_t rx_data_len) {
140   inc_func_call_count(__func__);
141   test::mock::stack_l2cap_ble::l2cble_process_data_length_change_event(handle, tx_data_len,
142                                                                        rx_data_len);
143 }
l2cble_credit_based_conn_req(tL2C_CCB * p_ccb)144 void l2cble_credit_based_conn_req(tL2C_CCB* p_ccb) {
145   inc_func_call_count(__func__);
146   test::mock::stack_l2cap_ble::l2cble_credit_based_conn_req(p_ccb);
147 }
l2cble_credit_based_conn_res(tL2C_CCB * p_ccb,tL2CAP_LE_RESULT_CODE result)148 void l2cble_credit_based_conn_res(tL2C_CCB* p_ccb, tL2CAP_LE_RESULT_CODE result) {
149   inc_func_call_count(__func__);
150   test::mock::stack_l2cap_ble::l2cble_credit_based_conn_res(p_ccb, result);
151 }
l2cble_send_flow_control_credit(tL2C_CCB * p_ccb,uint16_t credit_value)152 void l2cble_send_flow_control_credit(tL2C_CCB* p_ccb, uint16_t credit_value) {
153   inc_func_call_count(__func__);
154   test::mock::stack_l2cap_ble::l2cble_send_flow_control_credit(p_ccb, credit_value);
155 }
l2cble_send_peer_disc_req(tL2C_CCB * p_ccb)156 void l2cble_send_peer_disc_req(tL2C_CCB* p_ccb) {
157   inc_func_call_count(__func__);
158   test::mock::stack_l2cap_ble::l2cble_send_peer_disc_req(p_ccb);
159 }
l2ble_sec_access_req(const RawAddress & bd_addr,uint16_t psm,bool is_originator,tBTM_SEC_CALLBACK * p_callback,void * p_ref_data)160 tL2CAP_LE_RESULT_CODE l2ble_sec_access_req(const RawAddress& bd_addr, uint16_t psm,
161                                            bool is_originator, tBTM_SEC_CALLBACK* p_callback,
162                                            void* p_ref_data) {
163   inc_func_call_count(__func__);
164   return test::mock::stack_l2cap_ble::l2ble_sec_access_req(bd_addr, psm, is_originator, p_callback,
165                                                            p_ref_data);
166 }
L2CA_AdjustConnectionIntervals(uint16_t * min_interval,uint16_t * max_interval,uint16_t floor_interval)167 void L2CA_AdjustConnectionIntervals(uint16_t* min_interval, uint16_t* max_interval,
168                                     uint16_t floor_interval) {
169   inc_func_call_count(__func__);
170   test::mock::stack_l2cap_ble::L2CA_AdjustConnectionIntervals(min_interval, max_interval,
171                                                               floor_interval);
172 }
L2CA_SetEcosystemBaseInterval(uint32_t base_interval)173 void L2CA_SetEcosystemBaseInterval(uint32_t base_interval) {
174   inc_func_call_count(__func__);
175   test::mock::stack_l2cap_ble::L2CA_SetEcosystemBaseInterval(base_interval);
176 }
l2cble_use_preferred_conn_params(const RawAddress & bda)177 void l2cble_use_preferred_conn_params(const RawAddress& bda) {
178   inc_func_call_count(__func__);
179   test::mock::stack_l2cap_ble::l2cble_use_preferred_conn_params(bda);
180 }
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)181 bool L2CA_SubrateRequest(const RawAddress& rem_bda, uint16_t subrate_min, uint16_t subrate_max,
182                          uint16_t max_latency, uint16_t cont_num, uint16_t timeout) {
183   inc_func_call_count(__func__);
184   return test::mock::stack_l2cap_ble::L2CA_SubrateRequest(rem_bda, subrate_min, subrate_max,
185                                                           max_latency, cont_num, timeout);
186 }
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)187 void l2cble_process_subrate_change_evt(uint16_t handle, uint8_t status, uint16_t subrate_factor,
188                                        uint16_t peripheral_latency, uint16_t cont_num,
189                                        uint16_t timeout) {
190   inc_func_call_count(__func__);
191   test::mock::stack_l2cap_ble::l2cble_process_subrate_change_evt(
192           handle, status, subrate_factor, peripheral_latency, cont_num, timeout);
193 }
194 
195 // END mockcify generation
196