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:62
20 *
21 * mockcify.pl ver 0.3.0
22 */
23
24 // Mock include file to share data between tests and mock
25 #include "test/mock/mock_bta_dm_act.h"
26
27 #include <cstdint>
28
29 #include "test/common/mock_functions.h"
30 #include "types/raw_address.h"
31
32 // Mocked internal structures, if any
33
34 namespace test {
35 namespace mock {
36 namespace bta_dm_act {
37
38 // Function state capture and return values, if needed
39 struct BTA_DmSetVisibility BTA_DmSetVisibility;
40 struct BTA_dm_acl_down BTA_dm_acl_down;
41 struct BTA_dm_acl_up BTA_dm_acl_up;
42 struct BTA_dm_acl_up_failed BTA_dm_acl_up_failed;
43 struct BTA_dm_notify_remote_features_complete
44 BTA_dm_notify_remote_features_complete;
45 struct BTA_dm_on_hw_off BTA_dm_on_hw_off;
46 struct BTA_dm_on_hw_on BTA_dm_on_hw_on;
47 struct BTA_dm_report_role_change BTA_dm_report_role_change;
48 struct bta_dm_add_ble_device bta_dm_add_ble_device;
49 struct bta_dm_add_blekey bta_dm_add_blekey;
50 struct bta_dm_ble_config_local_privacy bta_dm_ble_config_local_privacy;
51 struct bta_dm_ble_confirm_reply bta_dm_ble_confirm_reply;
52 struct bta_dm_ble_csis_observe bta_dm_ble_csis_observe;
53 struct bta_dm_ble_get_energy_info bta_dm_ble_get_energy_info;
54 struct bta_dm_ble_passkey_reply bta_dm_ble_passkey_reply;
55 struct bta_dm_ble_scan bta_dm_ble_scan;
56 struct bta_dm_ble_set_conn_params bta_dm_ble_set_conn_params;
57 struct bta_dm_ble_set_data_length bta_dm_ble_set_data_length;
58 struct bta_dm_ble_update_conn_params bta_dm_ble_update_conn_params;
59 struct bta_dm_bond bta_dm_bond;
60 struct bta_dm_bond_cancel bta_dm_bond_cancel;
61 struct bta_dm_check_if_only_hd_connected bta_dm_check_if_only_hd_connected;
62 struct bta_dm_ci_rmt_oob_act bta_dm_ci_rmt_oob_act;
63 struct bta_dm_confirm bta_dm_confirm;
64 struct bta_dm_disable bta_dm_disable;
65 struct bta_dm_eir_update_cust_uuid bta_dm_eir_update_cust_uuid;
66 struct bta_dm_eir_update_uuid bta_dm_eir_update_uuid;
67 struct bta_dm_enable bta_dm_enable;
68 struct bta_dm_encrypt_cback bta_dm_encrypt_cback;
69 struct bta_dm_is_search_request_queued bta_dm_is_search_request_queued;
70 struct bta_dm_pin_reply bta_dm_pin_reply;
71 struct bta_dm_process_remove_device bta_dm_process_remove_device;
72 struct bta_dm_remove_device bta_dm_remove_device;
73 struct bta_dm_remote_key_missing bta_dm_remote_key_missing;
74 struct bta_dm_rm_cback bta_dm_rm_cback;
75 struct bta_dm_set_dev_name bta_dm_set_dev_name;
76 struct bta_dm_set_encryption bta_dm_set_encryption;
77 struct handle_remote_features_complete handle_remote_features_complete;
78
79 } // namespace bta_dm_act
80 } // namespace mock
81 } // namespace test
82
83 // Mocked functions, if any
BTA_DmSetVisibility(bt_scan_mode_t mode)84 bool BTA_DmSetVisibility(bt_scan_mode_t mode) {
85 inc_func_call_count(__func__);
86 return test::mock::bta_dm_act::BTA_DmSetVisibility(mode);
87 }
BTA_dm_acl_down(const RawAddress bd_addr,tBT_TRANSPORT transport)88 void BTA_dm_acl_down(const RawAddress bd_addr, tBT_TRANSPORT transport) {
89 inc_func_call_count(__func__);
90 test::mock::bta_dm_act::BTA_dm_acl_down(bd_addr, transport);
91 }
BTA_dm_acl_up(const RawAddress bd_addr,tBT_TRANSPORT transport,uint16_t acl_handle)92 void BTA_dm_acl_up(const RawAddress bd_addr, tBT_TRANSPORT transport,
93 uint16_t acl_handle) {
94 inc_func_call_count(__func__);
95 test::mock::bta_dm_act::BTA_dm_acl_up(bd_addr, transport, acl_handle);
96 }
BTA_dm_acl_up_failed(const RawAddress bd_addr,tBT_TRANSPORT transport,tHCI_STATUS hci_status)97 void BTA_dm_acl_up_failed(const RawAddress bd_addr, tBT_TRANSPORT transport,
98 tHCI_STATUS hci_status) {
99 inc_func_call_count(__func__);
100 test::mock::bta_dm_act::BTA_dm_acl_up_failed(bd_addr, transport, hci_status);
101 }
BTA_dm_notify_remote_features_complete(const RawAddress bd_addr)102 void BTA_dm_notify_remote_features_complete(const RawAddress bd_addr) {
103 inc_func_call_count(__func__);
104 test::mock::bta_dm_act::BTA_dm_notify_remote_features_complete(bd_addr);
105 }
BTA_dm_on_hw_off()106 void BTA_dm_on_hw_off() {
107 inc_func_call_count(__func__);
108 test::mock::bta_dm_act::BTA_dm_on_hw_off();
109 }
BTA_dm_on_hw_on()110 void BTA_dm_on_hw_on() {
111 inc_func_call_count(__func__);
112 test::mock::bta_dm_act::BTA_dm_on_hw_on();
113 }
BTA_dm_report_role_change(const RawAddress bd_addr,tHCI_ROLE new_role,tHCI_STATUS hci_status)114 void BTA_dm_report_role_change(const RawAddress bd_addr, tHCI_ROLE new_role,
115 tHCI_STATUS hci_status) {
116 inc_func_call_count(__func__);
117 test::mock::bta_dm_act::BTA_dm_report_role_change(bd_addr, new_role,
118 hci_status);
119 }
bta_dm_add_ble_device(const RawAddress & bd_addr,tBLE_ADDR_TYPE addr_type,tBT_DEVICE_TYPE dev_type)120 void bta_dm_add_ble_device(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
121 tBT_DEVICE_TYPE dev_type) {
122 inc_func_call_count(__func__);
123 test::mock::bta_dm_act::bta_dm_add_ble_device(bd_addr, addr_type, dev_type);
124 }
bta_dm_add_blekey(const RawAddress & bd_addr,tBTA_LE_KEY_VALUE blekey,tBTM_LE_KEY_TYPE key_type)125 void bta_dm_add_blekey(const RawAddress& bd_addr, tBTA_LE_KEY_VALUE blekey,
126 tBTM_LE_KEY_TYPE key_type) {
127 inc_func_call_count(__func__);
128 test::mock::bta_dm_act::bta_dm_add_blekey(bd_addr, blekey, key_type);
129 }
bta_dm_ble_config_local_privacy(bool privacy_enable)130 void bta_dm_ble_config_local_privacy(bool privacy_enable) {
131 inc_func_call_count(__func__);
132 test::mock::bta_dm_act::bta_dm_ble_config_local_privacy(privacy_enable);
133 }
bta_dm_ble_confirm_reply(const RawAddress & bd_addr,bool accept)134 void bta_dm_ble_confirm_reply(const RawAddress& bd_addr, bool accept) {
135 inc_func_call_count(__func__);
136 test::mock::bta_dm_act::bta_dm_ble_confirm_reply(bd_addr, accept);
137 }
bta_dm_ble_csis_observe(bool observe,tBTA_DM_SEARCH_CBACK * p_cback)138 void bta_dm_ble_csis_observe(bool observe, tBTA_DM_SEARCH_CBACK* p_cback) {
139 inc_func_call_count(__func__);
140 test::mock::bta_dm_act::bta_dm_ble_csis_observe(observe, p_cback);
141 }
bta_dm_ble_get_energy_info(tBTA_BLE_ENERGY_INFO_CBACK * p_energy_info_cback)142 void bta_dm_ble_get_energy_info(
143 tBTA_BLE_ENERGY_INFO_CBACK* p_energy_info_cback) {
144 inc_func_call_count(__func__);
145 test::mock::bta_dm_act::bta_dm_ble_get_energy_info(p_energy_info_cback);
146 }
bta_dm_ble_passkey_reply(const RawAddress & bd_addr,bool accept,uint32_t passkey)147 void bta_dm_ble_passkey_reply(const RawAddress& bd_addr, bool accept,
148 uint32_t passkey) {
149 inc_func_call_count(__func__);
150 test::mock::bta_dm_act::bta_dm_ble_passkey_reply(bd_addr, accept, passkey);
151 }
bta_dm_ble_scan(bool start,uint8_t duration_sec)152 void bta_dm_ble_scan(bool start, uint8_t duration_sec) {
153 inc_func_call_count(__func__);
154 test::mock::bta_dm_act::bta_dm_ble_scan(start, duration_sec);
155 }
bta_dm_ble_set_conn_params(const RawAddress & bd_addr,uint16_t conn_int_min,uint16_t conn_int_max,uint16_t peripheral_latency,uint16_t supervision_tout)156 void bta_dm_ble_set_conn_params(const RawAddress& bd_addr,
157 uint16_t conn_int_min, uint16_t conn_int_max,
158 uint16_t peripheral_latency,
159 uint16_t supervision_tout) {
160 inc_func_call_count(__func__);
161 test::mock::bta_dm_act::bta_dm_ble_set_conn_params(
162 bd_addr, conn_int_min, conn_int_max, peripheral_latency,
163 supervision_tout);
164 }
bta_dm_ble_set_data_length(const RawAddress & bd_addr)165 void bta_dm_ble_set_data_length(const RawAddress& bd_addr) {
166 inc_func_call_count(__func__);
167 test::mock::bta_dm_act::bta_dm_ble_set_data_length(bd_addr);
168 }
bta_dm_ble_update_conn_params(const RawAddress & bd_addr,uint16_t min_int,uint16_t max_int,uint16_t latency,uint16_t timeout,uint16_t min_ce_len,uint16_t max_ce_len)169 void bta_dm_ble_update_conn_params(const RawAddress& bd_addr, uint16_t min_int,
170 uint16_t max_int, uint16_t latency,
171 uint16_t timeout, uint16_t min_ce_len,
172 uint16_t max_ce_len) {
173 inc_func_call_count(__func__);
174 test::mock::bta_dm_act::bta_dm_ble_update_conn_params(
175 bd_addr, min_int, max_int, latency, timeout, min_ce_len, max_ce_len);
176 }
bta_dm_bond(const RawAddress & bd_addr,tBLE_ADDR_TYPE addr_type,tBT_TRANSPORT transport,tBT_DEVICE_TYPE device_type)177 void bta_dm_bond(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
178 tBT_TRANSPORT transport, tBT_DEVICE_TYPE device_type) {
179 inc_func_call_count(__func__);
180 test::mock::bta_dm_act::bta_dm_bond(bd_addr, addr_type, transport,
181 device_type);
182 }
bta_dm_bond_cancel(const RawAddress & bd_addr)183 void bta_dm_bond_cancel(const RawAddress& bd_addr) {
184 inc_func_call_count(__func__);
185 test::mock::bta_dm_act::bta_dm_bond_cancel(bd_addr);
186 }
bta_dm_check_if_only_hd_connected(const RawAddress & peer_addr)187 bool bta_dm_check_if_only_hd_connected(const RawAddress& peer_addr) {
188 inc_func_call_count(__func__);
189 return test::mock::bta_dm_act::bta_dm_check_if_only_hd_connected(peer_addr);
190 }
bta_dm_ci_rmt_oob_act(std::unique_ptr<tBTA_DM_CI_RMT_OOB> msg)191 void bta_dm_ci_rmt_oob_act(std::unique_ptr<tBTA_DM_CI_RMT_OOB> msg) {
192 inc_func_call_count(__func__);
193 test::mock::bta_dm_act::bta_dm_ci_rmt_oob_act(std::move(msg));
194 }
bta_dm_confirm(const RawAddress & bd_addr,bool accept)195 void bta_dm_confirm(const RawAddress& bd_addr, bool accept) {
196 inc_func_call_count(__func__);
197 test::mock::bta_dm_act::bta_dm_confirm(bd_addr, accept);
198 }
bta_dm_disable()199 void bta_dm_disable() {
200 inc_func_call_count(__func__);
201 test::mock::bta_dm_act::bta_dm_disable();
202 }
bta_dm_eir_update_cust_uuid(const tBTA_CUSTOM_UUID & curr,bool adding)203 void bta_dm_eir_update_cust_uuid(const tBTA_CUSTOM_UUID& curr, bool adding) {
204 inc_func_call_count(__func__);
205 test::mock::bta_dm_act::bta_dm_eir_update_cust_uuid(curr, adding);
206 }
bta_dm_eir_update_uuid(uint16_t uuid16,bool adding)207 void bta_dm_eir_update_uuid(uint16_t uuid16, bool adding) {
208 inc_func_call_count(__func__);
209 test::mock::bta_dm_act::bta_dm_eir_update_uuid(uuid16, adding);
210 }
bta_dm_enable(tBTA_DM_SEC_CBACK * p_sec_cback)211 void bta_dm_enable(tBTA_DM_SEC_CBACK* p_sec_cback) {
212 inc_func_call_count(__func__);
213 test::mock::bta_dm_act::bta_dm_enable(p_sec_cback);
214 }
bta_dm_encrypt_cback(const RawAddress * bd_addr,tBT_TRANSPORT transport,void * p_ref_data,tBTM_STATUS result)215 void bta_dm_encrypt_cback(const RawAddress* bd_addr, tBT_TRANSPORT transport,
216 void* p_ref_data, tBTM_STATUS result) {
217 inc_func_call_count(__func__);
218 test::mock::bta_dm_act::bta_dm_encrypt_cback(bd_addr, transport, p_ref_data,
219 result);
220 }
bta_dm_is_search_request_queued()221 bool bta_dm_is_search_request_queued() {
222 inc_func_call_count(__func__);
223 return test::mock::bta_dm_act::bta_dm_is_search_request_queued();
224 }
bta_dm_pin_reply(std::unique_ptr<tBTA_DM_API_PIN_REPLY> msg)225 void bta_dm_pin_reply(std::unique_ptr<tBTA_DM_API_PIN_REPLY> msg) {
226 inc_func_call_count(__func__);
227 test::mock::bta_dm_act::bta_dm_pin_reply(std::move(msg));
228 }
bta_dm_process_remove_device(const RawAddress & bd_addr)229 void bta_dm_process_remove_device(const RawAddress& bd_addr) {
230 inc_func_call_count(__func__);
231 test::mock::bta_dm_act::bta_dm_process_remove_device(bd_addr);
232 }
bta_dm_remove_device(const RawAddress & bd_addr)233 void bta_dm_remove_device(const RawAddress& bd_addr) {
234 inc_func_call_count(__func__);
235 test::mock::bta_dm_act::bta_dm_remove_device(bd_addr);
236 }
bta_dm_remote_key_missing(const RawAddress bd_addr)237 void bta_dm_remote_key_missing(const RawAddress bd_addr) {
238 inc_func_call_count(__func__);
239 test::mock::bta_dm_act::bta_dm_remote_key_missing(bd_addr);
240 }
bta_dm_rm_cback(tBTA_SYS_CONN_STATUS status,uint8_t id,uint8_t app_id,const RawAddress & peer_addr)241 void bta_dm_rm_cback(tBTA_SYS_CONN_STATUS status, uint8_t id, uint8_t app_id,
242 const RawAddress& peer_addr) {
243 inc_func_call_count(__func__);
244 test::mock::bta_dm_act::bta_dm_rm_cback(status, id, app_id, peer_addr);
245 }
bta_dm_set_dev_name(const std::vector<uint8_t> & name)246 void bta_dm_set_dev_name(const std::vector<uint8_t>& name) {
247 inc_func_call_count(__func__);
248 test::mock::bta_dm_act::bta_dm_set_dev_name(name);
249 }
bta_dm_set_encryption(const RawAddress & bd_addr,tBT_TRANSPORT transport,tBTA_DM_ENCRYPT_CBACK * p_callback,tBTM_BLE_SEC_ACT sec_act)250 void bta_dm_set_encryption(const RawAddress& bd_addr, tBT_TRANSPORT transport,
251 tBTA_DM_ENCRYPT_CBACK* p_callback,
252 tBTM_BLE_SEC_ACT sec_act) {
253 inc_func_call_count(__func__);
254 test::mock::bta_dm_act::bta_dm_set_encryption(bd_addr, transport, p_callback,
255 sec_act);
256 }
handle_remote_features_complete(const RawAddress & bd_addr)257 void handle_remote_features_complete(const RawAddress& bd_addr) {
258 inc_func_call_count(__func__);
259 test::mock::bta_dm_act::handle_remote_features_complete(bd_addr);
260 }
261
262 // END mockcify generation
263