• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2023 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 #pragma once
17 
18 /*
19  * Generated mock file from original source file
20  *   Functions generated:41
21  *
22  *  mockcify.pl ver 0.7.0
23  */
24 
25 #include <cstdint>
26 #include <functional>
27 
28 // Original included files, if any
29 // NOTE: Since this is a mock file with mock definitions some number of
30 //       include files may not be required.  The include-what-you-use
31 //       still applies, but crafting proper inclusion is out of scope
32 //       for this effort.  This compilation unit may compile as-is, or
33 //       may need attention to prune from (or add to ) the inclusion set.
34 
35 #include "btif/include/btif_storage.h"
36 #include "stack/include/bt_octets.h"
37 #include "types/bluetooth/uuid.h"
38 #include "types/raw_address.h"
39 
40 // Original usings
41 
42 // Mocked compile conditionals, if any
43 
44 namespace test {
45 namespace mock {
46 namespace btif_storage {
47 
48 // Shared state between mocked functions and tests
49 // Name: btif_debug_linkkey_type_dump
50 // Params: int fd
51 // Return: void
52 struct btif_debug_linkkey_type_dump {
53   std::function<void(int fd)> body{[](int /* fd */) {}};
operatorbtif_debug_linkkey_type_dump54   void operator()(int fd) { body(fd); }
55 };
56 extern struct btif_debug_linkkey_type_dump btif_debug_linkkey_type_dump;
57 
58 // Name: btif_in_fetch_bonded_ble_device
59 // Params: const std::string& remote_bd_addr, int add, btif_bonded_devices_t*
60 // p_bonded_devices Return: bt_status_t
61 struct btif_in_fetch_bonded_ble_device {
62   static bt_status_t return_value;
63   std::function<bt_status_t(const std::string& remote_bd_addr, int add,
64                             btif_bonded_devices_t* p_bonded_devices)>
65           body{[](const std::string& /* remote_bd_addr */, int /* add */,
66                   btif_bonded_devices_t* /* p_bonded_devices */) { return return_value; }};
operatorbtif_in_fetch_bonded_ble_device67   bt_status_t operator()(const std::string& remote_bd_addr, int add,
68                          btif_bonded_devices_t* p_bonded_devices) {
69     return body(remote_bd_addr, add, p_bonded_devices);
70   }
71 };
72 extern struct btif_in_fetch_bonded_ble_device btif_in_fetch_bonded_ble_device;
73 
74 // Name: btif_in_fetch_bonded_device
75 // Params: const std::string& bdstr
76 // Return: bt_status_t
77 struct btif_in_fetch_bonded_device {
78   static bt_status_t return_value;
79   std::function<bt_status_t(const std::string& bdstr)> body{
80           [](const std::string& /* bdstr */) { return return_value; }};
operatorbtif_in_fetch_bonded_device81   bt_status_t operator()(const std::string& bdstr) { return body(bdstr); }
82 };
83 extern struct btif_in_fetch_bonded_device btif_in_fetch_bonded_device;
84 
85 // Name: btif_split_uuids_string
86 // Params: const char* str, bluetooth::Uuid* p_uuid, size_t max_uuids
87 // Return: size_t
88 struct btif_split_uuids_string {
89   static size_t return_value;
90   std::function<size_t(const char* str, bluetooth::Uuid* p_uuid, size_t max_uuids)> body{
91           [](const char* /* str */, bluetooth::Uuid* /* p_uuid */, size_t /* max_uuids */) {
92             return return_value;
93           }};
operatorbtif_split_uuids_string94   size_t operator()(const char* str, bluetooth::Uuid* p_uuid, size_t max_uuids) {
95     return body(str, p_uuid, max_uuids);
96   }
97 };
98 extern struct btif_split_uuids_string btif_split_uuids_string;
99 
100 // Name: btif_storage_add_ble_bonding_key
101 // Params: RawAddress* remote_bd_addr, const uint8_t* key_value, uint8_t
102 // key_type, uint8_t key_length Return: bt_status_t
103 struct btif_storage_add_ble_bonding_key {
104   static bt_status_t return_value;
105   std::function<bt_status_t(RawAddress* remote_bd_addr, const uint8_t* key_value, uint8_t key_type,
106                             uint8_t key_length)>
107           body{[](RawAddress* /* remote_bd_addr */, const uint8_t* /* key_value */,
108                   uint8_t /* key_type */, uint8_t /* key_length */) { return return_value; }};
operatorbtif_storage_add_ble_bonding_key109   bt_status_t operator()(RawAddress* remote_bd_addr, const uint8_t* key_value, uint8_t key_type,
110                          uint8_t key_length) {
111     return body(remote_bd_addr, key_value, key_type, key_length);
112   }
113 };
114 extern struct btif_storage_add_ble_bonding_key btif_storage_add_ble_bonding_key;
115 
116 // Name: btif_storage_add_ble_local_key
117 // Params: const Octet16& key_value, uint8_t key_type
118 // Return: bt_status_t
119 struct btif_storage_add_ble_local_key {
120   static bt_status_t return_value;
121   std::function<bt_status_t(const Octet16& key_value, uint8_t key_type)> body{
122           [](const Octet16& /* key_value */, uint8_t /* key_type */) { return return_value; }};
operatorbtif_storage_add_ble_local_key123   bt_status_t operator()(const Octet16& key_value, uint8_t key_type) {
124     return body(key_value, key_type);
125   }
126 };
127 extern struct btif_storage_add_ble_local_key btif_storage_add_ble_local_key;
128 
129 // Name: btif_storage_add_bonded_device
130 // Params: RawAddress* remote_bd_addr, LinkKey link_key, uint8_t key_type,
131 // uint8_t pin_length Return: bt_status_t
132 struct btif_storage_add_bonded_device {
133   static bt_status_t return_value;
134   std::function<bt_status_t(RawAddress* remote_bd_addr, LinkKey link_key, uint8_t key_type,
135                             uint8_t pin_length)>
136           body{[](RawAddress* /* remote_bd_addr */, LinkKey /* link_key */, uint8_t /* key_type */,
137                   uint8_t /* pin_length */) { return return_value; }};
operatorbtif_storage_add_bonded_device138   bt_status_t operator()(RawAddress* remote_bd_addr, LinkKey link_key, uint8_t key_type,
139                          uint8_t pin_length) {
140     return body(remote_bd_addr, link_key, key_type, pin_length);
141   }
142 };
143 extern struct btif_storage_add_bonded_device btif_storage_add_bonded_device;
144 
145 // Name: btif_storage_add_remote_device
146 // Params: const RawAddress* remote_bd_addr, uint32_t num_properties,
147 // bt_property_t* properties Return: bt_status_t
148 struct btif_storage_add_remote_device {
149   static bt_status_t return_value;
150   std::function<bt_status_t(const RawAddress* remote_bd_addr, uint32_t num_properties,
151                             bt_property_t* properties)>
152           body{[](const RawAddress* /* remote_bd_addr */, uint32_t /* num_properties */,
153                   bt_property_t* /* properties */) { return return_value; }};
operatorbtif_storage_add_remote_device154   bt_status_t operator()(const RawAddress* remote_bd_addr, uint32_t num_properties,
155                          bt_property_t* properties) {
156     return body(remote_bd_addr, num_properties, properties);
157   }
158 };
159 extern struct btif_storage_add_remote_device btif_storage_add_remote_device;
160 
161 // Name: btif_storage_get_adapter_property
162 // Params: bt_property_t* property
163 // Return: bt_status_t
164 struct btif_storage_get_adapter_property {
165   static bt_status_t return_value;
166   std::function<bt_status_t(bt_property_t* property)> body{
167           [](bt_property_t* /* property */) { return return_value; }};
operatorbtif_storage_get_adapter_property168   bt_status_t operator()(bt_property_t* property) { return body(property); }
169 };
170 extern struct btif_storage_get_adapter_property btif_storage_get_adapter_property;
171 
172 // Name: btif_storage_get_ble_bonding_key
173 // Params: const RawAddress& remote_bd_addr, uint8_t key_type, uint8_t*
174 // key_value, int key_length Return: bt_status_t
175 struct btif_storage_get_ble_bonding_key {
176   static bt_status_t return_value;
177   std::function<bt_status_t(const RawAddress& remote_bd_addr, uint8_t key_type, uint8_t* key_value,
178                             int key_length)>
179           body{[](const RawAddress& /* remote_bd_addr */, uint8_t /* key_type */,
180                   uint8_t* /* key_value */, int /* key_length */) { return return_value; }};
operatorbtif_storage_get_ble_bonding_key181   bt_status_t operator()(const RawAddress& remote_bd_addr, uint8_t key_type, uint8_t* key_value,
182                          int key_length) {
183     return body(remote_bd_addr, key_type, key_value, key_length);
184   }
185 };
186 extern struct btif_storage_get_ble_bonding_key btif_storage_get_ble_bonding_key;
187 
188 // Name: btif_storage_get_ble_local_key
189 // Params: uint8_t key_type, Octet16* key_value
190 // Return: bt_status_t
191 struct btif_storage_get_ble_local_key {
192   static bt_status_t return_value;
193   std::function<bt_status_t(uint8_t key_type, Octet16* key_value)> body{
194           [](uint8_t /* key_type */, Octet16* /* key_value */) { return return_value; }};
operatorbtif_storage_get_ble_local_key195   bt_status_t operator()(uint8_t key_type, Octet16* key_value) { return body(key_type, key_value); }
196 };
197 extern struct btif_storage_get_ble_local_key btif_storage_get_ble_local_key;
198 
199 // Name: btif_storage_get_gatt_cl_db_hash
200 // Params: const RawAddress& bd_addr
201 // Return: Octet16
202 struct btif_storage_get_gatt_cl_db_hash {
203   static Octet16 return_value;
204   std::function<Octet16(const RawAddress& bd_addr)> body{
205           [](const RawAddress& /* bd_addr */) { return return_value; }};
operatorbtif_storage_get_gatt_cl_db_hash206   Octet16 operator()(const RawAddress& bd_addr) { return body(bd_addr); }
207 };
208 extern struct btif_storage_get_gatt_cl_db_hash btif_storage_get_gatt_cl_db_hash;
209 
210 // Name: btif_storage_get_gatt_cl_supp_feat
211 // Params: const RawAddress& bd_addr
212 // Return: uint8_t
213 struct btif_storage_get_gatt_cl_supp_feat {
214   static uint8_t return_value;
215   std::function<uint8_t(const RawAddress& bd_addr)> body{
216           [](const RawAddress& /* bd_addr */) { return return_value; }};
operatorbtif_storage_get_gatt_cl_supp_feat217   uint8_t operator()(const RawAddress& bd_addr) { return body(bd_addr); }
218 };
219 extern struct btif_storage_get_gatt_cl_supp_feat btif_storage_get_gatt_cl_supp_feat;
220 
221 // Name: btif_storage_get_remote_addr_type
222 // Params: const RawAddress* remote_bd_addr, tBLE_ADDR_TYPE addr_type
223 // Return: bt_status_t
224 struct btif_storage_get_remote_addr_type {
225   static bt_status_t return_value;
226   std::function<bt_status_t(const RawAddress* remote_bd_addr, tBLE_ADDR_TYPE* addr_type)> body{
227           [](const RawAddress* /* remote_bd_addr */,
228              tBLE_ADDR_TYPE* /* addr_type */) -> bt_status_t { return return_value; }};
operatorbtif_storage_get_remote_addr_type229   bt_status_t operator()(const RawAddress* remote_bd_addr, tBLE_ADDR_TYPE* addr_type) {
230     return body(remote_bd_addr, addr_type);
231   }
232 };
233 extern struct btif_storage_get_remote_addr_type btif_storage_get_remote_addr_type;
234 
235 // Name: btif_storage_get_remote_device_property
236 // Params: const RawAddress* remote_bd_addr, bt_property_t* property
237 // Return: bt_status_t
238 struct btif_storage_get_remote_device_property {
239   static bt_status_t return_value;
240   std::function<bt_status_t(const RawAddress* remote_bd_addr, bt_property_t* property)> body{
241           [](const RawAddress* /* remote_bd_addr */, bt_property_t* /* property */) {
242             return return_value;
243           }};
operatorbtif_storage_get_remote_device_property244   bt_status_t operator()(const RawAddress* remote_bd_addr, bt_property_t* property) {
245     return body(remote_bd_addr, property);
246   }
247 };
248 extern struct btif_storage_get_remote_device_property btif_storage_get_remote_device_property;
249 
250 // Name: btif_storage_get_sr_supp_feat
251 // Params: const RawAddress& bd_addr
252 // Return: uint8_t
253 struct btif_storage_get_sr_supp_feat {
254   static uint8_t return_value;
255   std::function<uint8_t(const RawAddress& bd_addr)> body{
256           [](const RawAddress& /* bd_addr */) { return return_value; }};
operatorbtif_storage_get_sr_supp_feat257   uint8_t operator()(const RawAddress& bd_addr) { return body(bd_addr); }
258 };
259 extern struct btif_storage_get_sr_supp_feat btif_storage_get_sr_supp_feat;
260 
261 // Name: btif_storage_get_stored_remote_name
262 // Params: const RawAddress& bd_addr, char* name
263 // Return: bool
264 struct btif_storage_get_stored_remote_name {
265   static bool return_value;
266   std::function<bool(const RawAddress& bd_addr, char* name)> body{
267           [](const RawAddress& /* bd_addr */, char* /* name */) { return return_value; }};
operatorbtif_storage_get_stored_remote_name268   bool operator()(const RawAddress& bd_addr, char* name) { return body(bd_addr, name); }
269 };
270 extern struct btif_storage_get_stored_remote_name btif_storage_get_stored_remote_name;
271 
272 // Name: btif_storage_get_cod
273 // Params: const RawAddress& bd_addr, uint32_t* cod
274 // Return: bool
275 struct btif_storage_get_cod {
276   static bool return_value;
277   std::function<bool(const RawAddress& bd_addr, uint32_t* cod)> body{
278           [](const RawAddress& /* bd_addr */, uint32_t* /* cod */) { return return_value; }};
operatorbtif_storage_get_cod279   bool operator()(const RawAddress& bd_addr, uint32_t* cod) { return body(bd_addr, cod); }
280 };
281 extern struct btif_storage_get_cod btif_storage_get_cod;
282 
283 // Name: btif_storage_is_restricted_device
284 // Params: const RawAddress* remote_bd_addr
285 // Return: bool
286 struct btif_storage_is_restricted_device {
287   static bool return_value;
288   std::function<bool(const RawAddress* remote_bd_addr)> body{
289           [](const RawAddress* /* remote_bd_addr */) { return return_value; }};
operatorbtif_storage_is_restricted_device290   bool operator()(const RawAddress* remote_bd_addr) { return body(remote_bd_addr); }
291 };
292 extern struct btif_storage_is_restricted_device btif_storage_is_restricted_device;
293 
294 // Name: btif_storage_load_bonded_devices
295 // Params: void
296 // Return: bt_status_t
297 struct btif_storage_load_bonded_devices {
298   static bt_status_t return_value;
299   std::function<bt_status_t(void)> body{[](void) { return return_value; }};
operatorbtif_storage_load_bonded_devices300   bt_status_t operator()(void) { return body(); }
301 };
302 extern struct btif_storage_load_bonded_devices btif_storage_load_bonded_devices;
303 
304 // Name: btif_storage_load_le_devices
305 // Params: void
306 // Return: void
307 struct btif_storage_load_le_devices {
308   std::function<void(void)> body{[](void) {}};
operatorbtif_storage_load_le_devices309   void operator()(void) { body(); }
310 };
311 extern struct btif_storage_load_le_devices btif_storage_load_le_devices;
312 
313 // Name: btif_storage_remove_ble_bonding_keys
314 // Params: const RawAddress* remote_bd_addr
315 // Return: bt_status_t
316 struct btif_storage_remove_ble_bonding_keys {
317   static bt_status_t return_value;
318   std::function<bt_status_t(const RawAddress* remote_bd_addr)> body{
319           [](const RawAddress* /* remote_bd_addr */) { return return_value; }};
operatorbtif_storage_remove_ble_bonding_keys320   bt_status_t operator()(const RawAddress* remote_bd_addr) { return body(remote_bd_addr); }
321 };
322 extern struct btif_storage_remove_ble_bonding_keys btif_storage_remove_ble_bonding_keys;
323 
324 // Name: btif_storage_remove_ble_local_keys
325 // Params: void
326 // Return: bt_status_t
327 struct btif_storage_remove_ble_local_keys {
328   static bt_status_t return_value;
329   std::function<bt_status_t(void)> body{[](void) { return return_value; }};
operatorbtif_storage_remove_ble_local_keys330   bt_status_t operator()(void) { return body(); }
331 };
332 extern struct btif_storage_remove_ble_local_keys btif_storage_remove_ble_local_keys;
333 
334 // Name: btif_storage_remove_bonded_device
335 // Params: const RawAddress* remote_bd_addr
336 // Return: bt_status_t
337 struct btif_storage_remove_bonded_device {
338   static bt_status_t return_value;
339   std::function<bt_status_t(const RawAddress* remote_bd_addr)> body{
340           [](const RawAddress* /* remote_bd_addr */) { return return_value; }};
operatorbtif_storage_remove_bonded_device341   bt_status_t operator()(const RawAddress* remote_bd_addr) { return body(remote_bd_addr); }
342 };
343 extern struct btif_storage_remove_bonded_device btif_storage_remove_bonded_device;
344 
345 // Name: btif_storage_remove_gatt_cl_db_hash
346 // Params: const RawAddress& bd_addr
347 // Return: void
348 struct btif_storage_remove_gatt_cl_db_hash {
349   std::function<void(const RawAddress& bd_addr)> body{[](const RawAddress& /* bd_addr */) {}};
operatorbtif_storage_remove_gatt_cl_db_hash350   void operator()(const RawAddress& bd_addr) { body(bd_addr); }
351 };
352 extern struct btif_storage_remove_gatt_cl_db_hash btif_storage_remove_gatt_cl_db_hash;
353 
354 // Name: btif_storage_remove_gatt_cl_supp_feat
355 // Params: const RawAddress& bd_addr
356 // Return: void
357 struct btif_storage_remove_gatt_cl_supp_feat {
358   std::function<void(const RawAddress& bd_addr)> body{[](const RawAddress& /* bd_addr */) {}};
operatorbtif_storage_remove_gatt_cl_supp_feat359   void operator()(const RawAddress& bd_addr) { body(bd_addr); }
360 };
361 extern struct btif_storage_remove_gatt_cl_supp_feat btif_storage_remove_gatt_cl_supp_feat;
362 
363 // Name: btif_storage_set_adapter_property
364 // Params: bt_property_t* property
365 // Return: bt_status_t
366 struct btif_storage_set_adapter_property {
367   static bt_status_t return_value;
368   std::function<bt_status_t(bt_property_t* property)> body{
369           [](bt_property_t* /* property */) { return return_value; }};
operatorbtif_storage_set_adapter_property370   bt_status_t operator()(bt_property_t* property) { return body(property); }
371 };
372 extern struct btif_storage_set_adapter_property btif_storage_set_adapter_property;
373 
374 // Name: btif_storage_set_gatt_cl_db_hash
375 // Params: const RawAddress& bd_addr, Octet16 hash
376 // Return: void
377 struct btif_storage_set_gatt_cl_db_hash {
378   std::function<void(const RawAddress& bd_addr, Octet16 hash)> body{
379           [](const RawAddress& /* bd_addr */, Octet16 /* hash */) {}};
operatorbtif_storage_set_gatt_cl_db_hash380   void operator()(const RawAddress& bd_addr, Octet16 hash) { body(bd_addr, hash); }
381 };
382 extern struct btif_storage_set_gatt_cl_db_hash btif_storage_set_gatt_cl_db_hash;
383 
384 // Name: btif_storage_set_gatt_cl_supp_feat
385 // Params: const RawAddress& bd_addr, uint8_t feat
386 // Return: void
387 struct btif_storage_set_gatt_cl_supp_feat {
388   std::function<void(const RawAddress& bd_addr, uint8_t feat)> body{
389           [](const RawAddress& /* bd_addr */, uint8_t /* feat */) {}};
operatorbtif_storage_set_gatt_cl_supp_feat390   void operator()(const RawAddress& bd_addr, uint8_t feat) { body(bd_addr, feat); }
391 };
392 extern struct btif_storage_set_gatt_cl_supp_feat btif_storage_set_gatt_cl_supp_feat;
393 
394 // Name: btif_storage_set_gatt_sr_supp_feat
395 // Params: const RawAddress& addr, uint8_t feat
396 // Return: void
397 struct btif_storage_set_gatt_sr_supp_feat {
398   std::function<void(const RawAddress& addr, uint8_t feat)> body{
399           [](const RawAddress& /* addr */, uint8_t /* feat */) {}};
operatorbtif_storage_set_gatt_sr_supp_feat400   void operator()(const RawAddress& addr, uint8_t feat) { body(addr, feat); }
401 };
402 extern struct btif_storage_set_gatt_sr_supp_feat btif_storage_set_gatt_sr_supp_feat;
403 
404 // Name: btif_storage_set_remote_addr_type
405 // Params: const RawAddress& remote_bd_addr, const tBLE_ADDR_TYPE& addr_type
406 // Return: void
407 struct btif_storage_set_remote_addr_type {
408   std::function<bt_status_t(const RawAddress* remote_bd_addr, const tBLE_ADDR_TYPE addr_type)> body{
409           [](const RawAddress* /* remote_bd_addr */, const tBLE_ADDR_TYPE /* addr_type */) {
410             return BT_STATUS_SUCCESS;
411           }};
operatorbtif_storage_set_remote_addr_type412   bt_status_t operator()(const RawAddress* remote_bd_addr, const tBLE_ADDR_TYPE addr_type) {
413     return body(remote_bd_addr, addr_type);
414   }
415 };
416 extern struct btif_storage_set_remote_addr_type btif_storage_set_remote_addr_type;
417 
418 // Name: btif_storage_set_remote_device_property
419 // Params: const RawAddress* remote_bd_addr, bt_property_t* property
420 // Return: bt_status_t
421 struct btif_storage_set_remote_device_property {
422   static bt_status_t return_value;
423   std::function<bt_status_t(const RawAddress* remote_bd_addr, bt_property_t* property)> body{
424           [](const RawAddress* /* remote_bd_addr */, bt_property_t* /* property */) {
425             return return_value;
426           }};
operatorbtif_storage_set_remote_device_property427   bt_status_t operator()(const RawAddress* remote_bd_addr, bt_property_t* property) {
428     return body(remote_bd_addr, property);
429   }
430 };
431 extern struct btif_storage_set_remote_device_property btif_storage_set_remote_device_property;
432 
433 // Name: btif_storage_get_services
434 // Params: const RawAddress& bd_addr, tBT_TRANSPORT transport
435 // Return: std::vector<bluetooth::Uuid>
436 struct btif_storage_get_services {
437   static std::vector<bluetooth::Uuid> return_value;
438   std::function<std::vector<bluetooth::Uuid>(const RawAddress& bd_addr, tBT_TRANSPORT transport)>
439           body{[](const RawAddress& /* bd_addr */, tBT_TRANSPORT /* transport */) {
440             return return_value;
441           }};
operatorbtif_storage_get_services442   std::vector<bluetooth::Uuid> operator()(const RawAddress& bd_addr, tBT_TRANSPORT transport) {
443     return body(bd_addr, transport);
444   }
445 };
446 extern struct btif_storage_get_services btif_storage_get_services;
447 
448 }  // namespace btif_storage
449 }  // namespace mock
450 }  // namespace test
451 
452 // END mockcify generation
453