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 #include <map>
25 #include <string>
26 
27 extern std::map<std::string, int> mock_function_count_map;
28 
29 // Original included files, if any
30 // NOTE: Since this is a mock file with mock definitions some number of
31 //       include files may not be required.  The include-what-you-use
32 //       still applies, but crafting proper inclusion is out of scope
33 //       for this effort.  This compilation unit may compile as-is, or
34 //       may need attention to prune the inclusion set.
35 
36 // Mock include file to share data between tests and mock
37 #include "test/mock/mock_stack_l2cap_ble.h"
38 
39 // Mocked compile conditionals, if any
40 #ifndef UNUSED_ATTR
41 #define UNUSED_ATTR
42 #endif
43 
44 // Mocked internal structures, if any
45 
46 namespace test {
47 namespace mock {
48 namespace stack_l2cap_ble {
49 
50 // Function state capture and return values, if needed
51 struct L2CA_UpdateBleConnParams L2CA_UpdateBleConnParams;
52 struct L2CA_EnableUpdateBleConnParams L2CA_EnableUpdateBleConnParams;
53 struct L2CA_GetBleConnRole L2CA_GetBleConnRole;
54 struct l2cble_notify_le_connection l2cble_notify_le_connection;
55 struct l2cble_conn_comp l2cble_conn_comp;
56 struct l2cble_conn_comp_from_address_with_type
57     l2cble_conn_comp_from_address_with_type;
58 struct l2cble_process_conn_update_evt l2cble_process_conn_update_evt;
59 struct l2cble_process_sig_cmd l2cble_process_sig_cmd;
60 struct l2cble_create_conn l2cble_create_conn;
61 struct l2c_link_processs_ble_num_bufs l2c_link_processs_ble_num_bufs;
62 struct l2c_ble_link_adjust_allocation l2c_ble_link_adjust_allocation;
63 struct l2cble_process_rc_param_request_evt l2cble_process_rc_param_request_evt;
64 struct l2cble_update_data_length l2cble_update_data_length;
65 struct l2cble_process_data_length_change_event
66     l2cble_process_data_length_change_event;
67 struct l2cble_credit_based_conn_req l2cble_credit_based_conn_req;
68 struct l2cble_credit_based_conn_res l2cble_credit_based_conn_res;
69 struct l2cble_send_flow_control_credit l2cble_send_flow_control_credit;
70 struct l2cble_send_peer_disc_req l2cble_send_peer_disc_req;
71 struct l2cble_sec_comp l2cble_sec_comp;
72 struct l2ble_sec_access_req l2ble_sec_access_req;
73 struct L2CA_AdjustConnectionIntervals L2CA_AdjustConnectionIntervals;
74 struct l2cble_use_preferred_conn_params l2cble_use_preferred_conn_params;
75 
76 }  // namespace stack_l2cap_ble
77 }  // namespace mock
78 }  // namespace test
79 
80 // 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)81 bool L2CA_UpdateBleConnParams(const RawAddress& rem_bda, uint16_t min_int,
82                               uint16_t max_int, uint16_t latency,
83                               uint16_t timeout, uint16_t min_ce_len,
84                               uint16_t max_ce_len) {
85   mock_function_count_map[__func__]++;
86   return test::mock::stack_l2cap_ble::L2CA_UpdateBleConnParams(
87       rem_bda, min_int, max_int, latency, timeout, min_ce_len, max_ce_len);
88 }
L2CA_EnableUpdateBleConnParams(const RawAddress & rem_bda,bool enable)89 bool L2CA_EnableUpdateBleConnParams(const RawAddress& rem_bda, bool enable) {
90   mock_function_count_map[__func__]++;
91   return test::mock::stack_l2cap_ble::L2CA_EnableUpdateBleConnParams(rem_bda,
92                                                                      enable);
93 }
L2CA_GetBleConnRole(const RawAddress & bd_addr)94 hci_role_t L2CA_GetBleConnRole(const RawAddress& bd_addr) {
95   mock_function_count_map[__func__]++;
96   return test::mock::stack_l2cap_ble::L2CA_GetBleConnRole(bd_addr);
97 }
l2cble_notify_le_connection(const RawAddress & bda)98 void l2cble_notify_le_connection(const RawAddress& bda) {
99   mock_function_count_map[__func__]++;
100   test::mock::stack_l2cap_ble::l2cble_notify_le_connection(bda);
101 }
l2cble_conn_comp(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)102 bool l2cble_conn_comp(uint16_t handle, uint8_t role, const RawAddress& bda,
103                       tBLE_ADDR_TYPE type, uint16_t conn_interval,
104                       uint16_t conn_latency, uint16_t conn_timeout) {
105   mock_function_count_map[__func__]++;
106   return test::mock::stack_l2cap_ble::l2cble_conn_comp(
107       handle, role, bda, type, conn_interval, conn_latency, conn_timeout);
108 }
l2cble_conn_comp_from_address_with_type(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)109 bool l2cble_conn_comp_from_address_with_type(
110     uint16_t handle, uint8_t role, const tBLE_BD_ADDR& address_with_type,
111     uint16_t conn_interval, uint16_t conn_latency, uint16_t conn_timeout) {
112   mock_function_count_map[__func__]++;
113   return test::mock::stack_l2cap_ble::l2cble_conn_comp_from_address_with_type(
114       handle, role, address_with_type, conn_interval, conn_latency,
115       conn_timeout);
116 }
l2cble_process_conn_update_evt(uint16_t handle,uint8_t status,uint16_t interval,uint16_t latency,uint16_t timeout)117 void l2cble_process_conn_update_evt(uint16_t handle, uint8_t status,
118                                     uint16_t interval, uint16_t latency,
119                                     uint16_t timeout) {
120   mock_function_count_map[__func__]++;
121   test::mock::stack_l2cap_ble::l2cble_process_conn_update_evt(
122       handle, status, interval, latency, timeout);
123 }
l2cble_process_sig_cmd(tL2C_LCB * p_lcb,uint8_t * p,uint16_t pkt_len)124 void l2cble_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) {
125   mock_function_count_map[__func__]++;
126   test::mock::stack_l2cap_ble::l2cble_process_sig_cmd(p_lcb, p, pkt_len);
127 }
l2cble_create_conn(tL2C_LCB * p_lcb)128 bool l2cble_create_conn(tL2C_LCB* p_lcb) {
129   mock_function_count_map[__func__]++;
130   return test::mock::stack_l2cap_ble::l2cble_create_conn(p_lcb);
131 }
l2c_link_processs_ble_num_bufs(uint16_t num_lm_ble_bufs)132 void l2c_link_processs_ble_num_bufs(uint16_t num_lm_ble_bufs) {
133   mock_function_count_map[__func__]++;
134   test::mock::stack_l2cap_ble::l2c_link_processs_ble_num_bufs(num_lm_ble_bufs);
135 }
l2c_ble_link_adjust_allocation(void)136 void l2c_ble_link_adjust_allocation(void) {
137   mock_function_count_map[__func__]++;
138   test::mock::stack_l2cap_ble::l2c_ble_link_adjust_allocation();
139 }
l2cble_process_rc_param_request_evt(uint16_t handle,uint16_t int_min,uint16_t int_max,uint16_t latency,uint16_t timeout)140 void l2cble_process_rc_param_request_evt(uint16_t handle, uint16_t int_min,
141                                          uint16_t int_max, uint16_t latency,
142                                          uint16_t timeout) {
143   mock_function_count_map[__func__]++;
144   test::mock::stack_l2cap_ble::l2cble_process_rc_param_request_evt(
145       handle, int_min, int_max, latency, timeout);
146 }
l2cble_update_data_length(tL2C_LCB * p_lcb)147 void l2cble_update_data_length(tL2C_LCB* p_lcb) {
148   mock_function_count_map[__func__]++;
149   test::mock::stack_l2cap_ble::l2cble_update_data_length(p_lcb);
150 }
l2cble_process_data_length_change_event(uint16_t handle,uint16_t tx_data_len,uint16_t rx_data_len)151 void l2cble_process_data_length_change_event(uint16_t handle,
152                                              uint16_t tx_data_len,
153                                              uint16_t rx_data_len) {
154   mock_function_count_map[__func__]++;
155   test::mock::stack_l2cap_ble::l2cble_process_data_length_change_event(
156       handle, tx_data_len, rx_data_len);
157 }
l2cble_credit_based_conn_req(tL2C_CCB * p_ccb)158 void l2cble_credit_based_conn_req(tL2C_CCB* p_ccb) {
159   mock_function_count_map[__func__]++;
160   test::mock::stack_l2cap_ble::l2cble_credit_based_conn_req(p_ccb);
161 }
l2cble_credit_based_conn_res(tL2C_CCB * p_ccb,uint16_t result)162 void l2cble_credit_based_conn_res(tL2C_CCB* p_ccb, uint16_t result) {
163   mock_function_count_map[__func__]++;
164   test::mock::stack_l2cap_ble::l2cble_credit_based_conn_res(p_ccb, result);
165 }
l2cble_send_flow_control_credit(tL2C_CCB * p_ccb,uint16_t credit_value)166 void l2cble_send_flow_control_credit(tL2C_CCB* p_ccb, uint16_t credit_value) {
167   mock_function_count_map[__func__]++;
168   test::mock::stack_l2cap_ble::l2cble_send_flow_control_credit(p_ccb,
169                                                                credit_value);
170 }
l2cble_send_peer_disc_req(tL2C_CCB * p_ccb)171 void l2cble_send_peer_disc_req(tL2C_CCB* p_ccb) {
172   mock_function_count_map[__func__]++;
173   test::mock::stack_l2cap_ble::l2cble_send_peer_disc_req(p_ccb);
174 }
l2cble_sec_comp(const RawAddress * bda,tBT_TRANSPORT transport,void * p_ref_data,tBTM_STATUS status)175 void l2cble_sec_comp(const RawAddress* bda, tBT_TRANSPORT transport,
176                      void* p_ref_data, tBTM_STATUS status) {
177   mock_function_count_map[__func__]++;
178   test::mock::stack_l2cap_ble::l2cble_sec_comp(bda, transport, p_ref_data,
179                                                status);
180 }
l2ble_sec_access_req(const RawAddress & bd_addr,uint16_t psm,bool is_originator,tL2CAP_SEC_CBACK * p_callback,void * p_ref_data)181 tL2CAP_LE_RESULT_CODE l2ble_sec_access_req(const RawAddress& bd_addr,
182                                            uint16_t psm, bool is_originator,
183                                            tL2CAP_SEC_CBACK* p_callback,
184                                            void* p_ref_data) {
185   mock_function_count_map[__func__]++;
186   return test::mock::stack_l2cap_ble::l2ble_sec_access_req(
187       bd_addr, psm, is_originator, p_callback, p_ref_data);
188 }
L2CA_AdjustConnectionIntervals(uint16_t * min_interval,uint16_t * max_interval,uint16_t floor_interval)189 void L2CA_AdjustConnectionIntervals(uint16_t* min_interval,
190                                     uint16_t* max_interval,
191                                     uint16_t floor_interval) {
192   mock_function_count_map[__func__]++;
193   test::mock::stack_l2cap_ble::L2CA_AdjustConnectionIntervals(
194       min_interval, max_interval, floor_interval);
195 }
l2cble_use_preferred_conn_params(const RawAddress & bda)196 void l2cble_use_preferred_conn_params(const RawAddress& bda) {
197   mock_function_count_map[__func__]++;
198   test::mock::stack_l2cap_ble::l2cble_use_preferred_conn_params(bda);
199 }
200 
201 // END mockcify generation
202