• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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:34
20  *
21  *  mockcify.pl ver 0.3.0
22  */
23 
24 #include <cstdint>
25 #include <functional>
26 #include <map>
27 #include <string>
28 
29 extern std::map<std::string, int> mock_function_count_map;
30 
31 // Original included files, if any
32 // NOTE: Since this is a mock file with mock definitions some number of
33 //       include files may not be required.  The include-what-you-use
34 //       still applies, but crafting proper inclusion is out of scope
35 //       for this effort.  This compilation unit may compile as-is, or
36 //       may need attention to prune from (or add to ) the inclusion set.
37 #include <base/bind.h>
38 
39 #include <map>
40 #include <string>
41 #include <vector>
42 
43 #include "bt_target.h"
44 #include "bta/dm/bta_dm_int.h"
45 #include "osi/include/allocator.h"
46 #include "stack/btm/btm_sec.h"
47 #include "stack/include/bt_octets.h"
48 #include "stack/include/btm_api.h"
49 #include "types/bluetooth/uuid.h"
50 #include "types/raw_address.h"
51 
52 // Mocked compile conditionals, if any
53 
54 namespace test {
55 namespace mock {
56 namespace bta_dm_api {
57 
58 // Name: BTA_DmAddBleDevice
59 // Params: const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type, tBT_DEVICE_TYPE
60 // dev_type Return: void
61 struct BTA_DmAddBleDevice {
62   std::function<void(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
63                      tBT_DEVICE_TYPE dev_type)>
64       body{[](const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
65               tBT_DEVICE_TYPE dev_type) {}};
operatorBTA_DmAddBleDevice66   void operator()(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
67                   tBT_DEVICE_TYPE dev_type) {
68     body(bd_addr, addr_type, dev_type);
69   };
70 };
71 extern struct BTA_DmAddBleDevice BTA_DmAddBleDevice;
72 
73 // Name: BTA_DmAddBleKey
74 // Params: const RawAddress& bd_addr, tBTA_LE_KEY_VALUE* p_le_key,
75 // tBTM_LE_KEY_TYPE key_type Return: void
76 struct BTA_DmAddBleKey {
77   std::function<void(const RawAddress& bd_addr, tBTA_LE_KEY_VALUE* p_le_key,
78                      tBTM_LE_KEY_TYPE key_type)>
79       body{[](const RawAddress& bd_addr, tBTA_LE_KEY_VALUE* p_le_key,
80               tBTM_LE_KEY_TYPE key_type) {}};
operatorBTA_DmAddBleKey81   void operator()(const RawAddress& bd_addr, tBTA_LE_KEY_VALUE* p_le_key,
82                   tBTM_LE_KEY_TYPE key_type) {
83     body(bd_addr, p_le_key, key_type);
84   };
85 };
86 extern struct BTA_DmAddBleKey BTA_DmAddBleKey;
87 
88 // Name: BTA_DmAddDevice
89 // Params: const RawAddress& bd_addr, DEV_CLASS dev_class, const LinkKey&
90 // link_key, uint8_t key_type, uint8_t pin_length Return: void
91 struct BTA_DmAddDevice {
92   std::function<void(const RawAddress& bd_addr, DEV_CLASS dev_class,
93                      const LinkKey& link_key, uint8_t key_type,
94                      uint8_t pin_length)>
95       body{[](const RawAddress& bd_addr, DEV_CLASS dev_class,
96               const LinkKey& link_key, uint8_t key_type,
97               uint8_t pin_length) {}};
operatorBTA_DmAddDevice98   void operator()(const RawAddress& bd_addr, DEV_CLASS dev_class,
99                   const LinkKey& link_key, uint8_t key_type,
100                   uint8_t pin_length) {
101     body(bd_addr, dev_class, link_key, key_type, pin_length);
102   };
103 };
104 extern struct BTA_DmAddDevice BTA_DmAddDevice;
105 
106 // Name: BTA_DmBleConfigLocalPrivacy
107 // Params: bool privacy_enable
108 // Return: void
109 struct BTA_DmBleConfigLocalPrivacy {
110   std::function<void(bool privacy_enable)> body{[](bool privacy_enable) {}};
operatorBTA_DmBleConfigLocalPrivacy111   void operator()(bool privacy_enable) { body(privacy_enable); };
112 };
113 extern struct BTA_DmBleConfigLocalPrivacy BTA_DmBleConfigLocalPrivacy;
114 
115 // Name: BTA_DmBleConfirmReply
116 // Params: const RawAddress& bd_addr, bool accept
117 // Return: void
118 struct BTA_DmBleConfirmReply {
119   std::function<void(const RawAddress& bd_addr, bool accept)> body{
120       [](const RawAddress& bd_addr, bool accept) {}};
operatorBTA_DmBleConfirmReply121   void operator()(const RawAddress& bd_addr, bool accept) {
122     body(bd_addr, accept);
123   };
124 };
125 extern struct BTA_DmBleConfirmReply BTA_DmBleConfirmReply;
126 
127 // Name: BTA_DmBleCsisObserve
128 // Params: bool observe, tBTA_DM_SEARCH_CBACK* p_results_cb
129 // Return: void
130 struct BTA_DmBleCsisObserve {
131   std::function<void(bool observe, tBTA_DM_SEARCH_CBACK* p_results_cb)> body{
132       [](bool observe, tBTA_DM_SEARCH_CBACK* p_results_cb) {}};
operatorBTA_DmBleCsisObserve133   void operator()(bool observe, tBTA_DM_SEARCH_CBACK* p_results_cb) {
134     body(observe, p_results_cb);
135   };
136 };
137 extern struct BTA_DmBleCsisObserve BTA_DmBleCsisObserve;
138 
139 // Name: BTA_DmBleGetEnergyInfo
140 // Params: tBTA_BLE_ENERGY_INFO_CBACK* p_cmpl_cback
141 // Return: void
142 struct BTA_DmBleGetEnergyInfo {
143   std::function<void(tBTA_BLE_ENERGY_INFO_CBACK* p_cmpl_cback)> body{
144       [](tBTA_BLE_ENERGY_INFO_CBACK* p_cmpl_cback) {}};
operatorBTA_DmBleGetEnergyInfo145   void operator()(tBTA_BLE_ENERGY_INFO_CBACK* p_cmpl_cback) {
146     body(p_cmpl_cback);
147   };
148 };
149 extern struct BTA_DmBleGetEnergyInfo BTA_DmBleGetEnergyInfo;
150 
151 // Name: BTA_DmBleObserve
152 // Params: bool start, uint8_t duration, tBTA_DM_SEARCH_CBACK* p_results_cb
153 // Return: void
154 struct BTA_DmBleObserve {
155   std::function<void(bool start, uint8_t duration,
156                      tBTA_DM_SEARCH_CBACK* p_results_cb)>
157       body{[](bool start, uint8_t duration,
158               tBTA_DM_SEARCH_CBACK* p_results_cb) {}};
operatorBTA_DmBleObserve159   void operator()(bool start, uint8_t duration,
160                   tBTA_DM_SEARCH_CBACK* p_results_cb) {
161     body(start, duration, p_results_cb);
162   };
163 };
164 extern struct BTA_DmBleObserve BTA_DmBleObserve;
165 
166 // Name: BTA_DmBlePasskeyReply
167 // Params: const RawAddress& bd_addr, bool accept, uint32_t passkey
168 // Return: void
169 struct BTA_DmBlePasskeyReply {
170   std::function<void(const RawAddress& bd_addr, bool accept, uint32_t passkey)>
171       body{[](const RawAddress& bd_addr, bool accept, uint32_t passkey) {}};
operatorBTA_DmBlePasskeyReply172   void operator()(const RawAddress& bd_addr, bool accept, uint32_t passkey) {
173     body(bd_addr, accept, passkey);
174   };
175 };
176 extern struct BTA_DmBlePasskeyReply BTA_DmBlePasskeyReply;
177 
178 // Name: BTA_DmBleRequestMaxTxDataLength
179 // Params: const RawAddress& remote_device
180 // Return: void
181 struct BTA_DmBleRequestMaxTxDataLength {
182   std::function<void(const RawAddress& remote_device)> body{
183       [](const RawAddress& remote_device) {}};
operatorBTA_DmBleRequestMaxTxDataLength184   void operator()(const RawAddress& remote_device) { body(remote_device); };
185 };
186 extern struct BTA_DmBleRequestMaxTxDataLength BTA_DmBleRequestMaxTxDataLength;
187 
188 // Name: BTA_DmBleScan
189 // Params: bool start, uint8_t duration
190 // Return: void
191 struct BTA_DmBleScan {
192   std::function<void(bool start, uint8_t duration)> body{
193       [](bool start, uint8_t duration) {}};
operatorBTA_DmBleScan194   void operator()(bool start, uint8_t duration) { body(start, duration); };
195 };
196 extern struct BTA_DmBleScan BTA_DmBleScan;
197 
198 // Name: BTA_DmBleSecurityGrant
199 // Params: const RawAddress& bd_addr, tBTA_DM_BLE_SEC_GRANT res
200 // Return: void
201 struct BTA_DmBleSecurityGrant {
202   std::function<void(const RawAddress& bd_addr, tBTA_DM_BLE_SEC_GRANT res)>
203       body{[](const RawAddress& bd_addr, tBTA_DM_BLE_SEC_GRANT res) {}};
operatorBTA_DmBleSecurityGrant204   void operator()(const RawAddress& bd_addr, tBTA_DM_BLE_SEC_GRANT res) {
205     body(bd_addr, res);
206   };
207 };
208 extern struct BTA_DmBleSecurityGrant BTA_DmBleSecurityGrant;
209 
210 // Name: BTA_DmBleUpdateConnectionParams
211 // Params: const RawAddress& bd_addr, uint16_t min_int, uint16_t max_int,
212 // uint16_t latency, uint16_t timeout, uint16_t min_ce_len, uint16_t max_ce_len
213 // Return: void
214 struct BTA_DmBleUpdateConnectionParams {
215   std::function<void(const RawAddress& bd_addr, uint16_t min_int,
216                      uint16_t max_int, uint16_t latency, uint16_t timeout,
217                      uint16_t min_ce_len, uint16_t max_ce_len)>
218       body{[](const RawAddress& bd_addr, uint16_t min_int, uint16_t max_int,
219               uint16_t latency, uint16_t timeout, uint16_t min_ce_len,
220               uint16_t max_ce_len) {}};
operatorBTA_DmBleUpdateConnectionParams221   void operator()(const RawAddress& bd_addr, uint16_t min_int, uint16_t max_int,
222                   uint16_t latency, uint16_t timeout, uint16_t min_ce_len,
223                   uint16_t max_ce_len) {
224     body(bd_addr, min_int, max_int, latency, timeout, min_ce_len, max_ce_len);
225   };
226 };
227 extern struct BTA_DmBleUpdateConnectionParams BTA_DmBleUpdateConnectionParams;
228 
229 // Name: BTA_DmBond
230 // Params: const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type, tBT_TRANSPORT
231 // transport, tBT_DEVICE_TYPE device_type Return: void
232 struct BTA_DmBond {
233   std::function<void(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
234                      tBT_TRANSPORT transport, tBT_DEVICE_TYPE device_type)>
235       body{[](const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
236               tBT_TRANSPORT transport, tBT_DEVICE_TYPE device_type) {}};
operatorBTA_DmBond237   void operator()(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
238                   tBT_TRANSPORT transport, tBT_DEVICE_TYPE device_type) {
239     body(bd_addr, addr_type, transport, device_type);
240   };
241 };
242 extern struct BTA_DmBond BTA_DmBond;
243 
244 // Name: BTA_DmBondCancel
245 // Params: const RawAddress& bd_addr
246 // Return: void
247 struct BTA_DmBondCancel {
248   std::function<void(const RawAddress& bd_addr)> body{
249       [](const RawAddress& bd_addr) {}};
operatorBTA_DmBondCancel250   void operator()(const RawAddress& bd_addr) { body(bd_addr); };
251 };
252 extern struct BTA_DmBondCancel BTA_DmBondCancel;
253 
254 // Name: BTA_DmCloseACL
255 // Params: const RawAddress& bd_addr, bool remove_dev, tBT_TRANSPORT transport
256 // Return: void
257 struct BTA_DmCloseACL {
258   std::function<void(const RawAddress& bd_addr, bool remove_dev,
259                      tBT_TRANSPORT transport)>
260       body{[](const RawAddress& bd_addr, bool remove_dev,
261               tBT_TRANSPORT transport) {}};
operatorBTA_DmCloseACL262   void operator()(const RawAddress& bd_addr, bool remove_dev,
263                   tBT_TRANSPORT transport) {
264     body(bd_addr, remove_dev, transport);
265   };
266 };
267 extern struct BTA_DmCloseACL BTA_DmCloseACL;
268 
269 // Name: BTA_DmConfirm
270 // Params: const RawAddress& bd_addr, bool accept
271 // Return: void
272 struct BTA_DmConfirm {
273   std::function<void(const RawAddress& bd_addr, bool accept)> body{
274       [](const RawAddress& bd_addr, bool accept) {}};
operatorBTA_DmConfirm275   void operator()(const RawAddress& bd_addr, bool accept) {
276     body(bd_addr, accept);
277   };
278 };
279 extern struct BTA_DmConfirm BTA_DmConfirm;
280 
281 // Name: BTA_DmDiscover
282 // Params: const RawAddress& bd_addr, tBTA_DM_SEARCH_CBACK* p_cback,
283 // tBT_TRANSPORT transport Return: void
284 struct BTA_DmDiscover {
285   std::function<void(const RawAddress& bd_addr, tBTA_DM_SEARCH_CBACK* p_cback,
286                      tBT_TRANSPORT transport)>
287       body{[](const RawAddress& bd_addr, tBTA_DM_SEARCH_CBACK* p_cback,
288               tBT_TRANSPORT transport) {}};
operatorBTA_DmDiscover289   void operator()(const RawAddress& bd_addr, tBTA_DM_SEARCH_CBACK* p_cback,
290                   tBT_TRANSPORT transport) {
291     body(bd_addr, p_cback, transport);
292   };
293 };
294 extern struct BTA_DmDiscover BTA_DmDiscover;
295 
296 // Name: BTA_DmGetConnectionState
297 // Params: const RawAddress& bd_addr
298 // Return: bool
299 struct BTA_DmGetConnectionState {
300   bool return_value{false};
301   std::function<bool(const RawAddress& bd_addr)> body{
302       [this](const RawAddress& bd_addr) { return return_value; }};
operatorBTA_DmGetConnectionState303   bool operator()(const RawAddress& bd_addr) { return body(bd_addr); };
304 };
305 extern struct BTA_DmGetConnectionState BTA_DmGetConnectionState;
306 
307 // Name: BTA_DmLocalOob
308 // Params: void
309 // Return: void
310 struct BTA_DmLocalOob {
311   std::function<void(void)> body{[](void) {}};
operatorBTA_DmLocalOob312   void operator()(void) { body(); };
313 };
314 extern struct BTA_DmLocalOob BTA_DmLocalOob;
315 
316 // Name: BTA_DmPinReply
317 // Params: const RawAddress& bd_addr, bool accept, uint8_t pin_len, uint8_t*
318 // p_pin Return: void
319 struct BTA_DmPinReply {
320   std::function<void(const RawAddress& bd_addr, bool accept, uint8_t pin_len,
321                      uint8_t* p_pin)>
322       body{[](const RawAddress& bd_addr, bool accept, uint8_t pin_len,
323               uint8_t* p_pin) {}};
operatorBTA_DmPinReply324   void operator()(const RawAddress& bd_addr, bool accept, uint8_t pin_len,
325                   uint8_t* p_pin) {
326     body(bd_addr, accept, pin_len, p_pin);
327   };
328 };
329 extern struct BTA_DmPinReply BTA_DmPinReply;
330 
331 // Name: BTA_DmRemoveDevice
332 // Params: const RawAddress& bd_addr
333 // Return: tBTA_STATUS
334 struct BTA_DmRemoveDevice {
335   tBTA_STATUS return_value{0};
336   std::function<tBTA_STATUS(const RawAddress& bd_addr)> body{
337       [this](const RawAddress& bd_addr) { return return_value; }};
operatorBTA_DmRemoveDevice338   tBTA_STATUS operator()(const RawAddress& bd_addr) { return body(bd_addr); };
339 };
340 extern struct BTA_DmRemoveDevice BTA_DmRemoveDevice;
341 
342 // Name: BTA_DmSearch
343 // Params: tBTA_DM_SEARCH_CBACK* p_cback
344 // Return: void
345 struct BTA_DmSearch {
346   std::function<void(tBTA_DM_SEARCH_CBACK* p_cback)> body{
347       [](tBTA_DM_SEARCH_CBACK* p_cback) {}};
operatorBTA_DmSearch348   void operator()(tBTA_DM_SEARCH_CBACK* p_cback) { body(p_cback); };
349 };
350 extern struct BTA_DmSearch BTA_DmSearch;
351 
352 // Name: BTA_DmSearchCancel
353 // Params: void
354 // Return: void
355 struct BTA_DmSearchCancel {
356   std::function<void(void)> body{[](void) {}};
operatorBTA_DmSearchCancel357   void operator()(void) { body(); };
358 };
359 extern struct BTA_DmSearchCancel BTA_DmSearchCancel;
360 
361 // Name: BTA_DmSetBlePrefConnParams
362 // Params: const RawAddress& bd_addr, uint16_t min_conn_int, uint16_t
363 // max_conn_int, uint16_t peripheral_latency, uint16_t supervision_tout Return:
364 // void
365 struct BTA_DmSetBlePrefConnParams {
366   std::function<void(const RawAddress& bd_addr, uint16_t min_conn_int,
367                      uint16_t max_conn_int, uint16_t peripheral_latency,
368                      uint16_t supervision_tout)>
369       body{[](const RawAddress& bd_addr, uint16_t min_conn_int,
370               uint16_t max_conn_int, uint16_t peripheral_latency,
371               uint16_t supervision_tout) {}};
operatorBTA_DmSetBlePrefConnParams372   void operator()(const RawAddress& bd_addr, uint16_t min_conn_int,
373                   uint16_t max_conn_int, uint16_t peripheral_latency,
374                   uint16_t supervision_tout) {
375     body(bd_addr, min_conn_int, max_conn_int, peripheral_latency,
376          supervision_tout);
377   };
378 };
379 extern struct BTA_DmSetBlePrefConnParams BTA_DmSetBlePrefConnParams;
380 
381 // Name: BTA_DmSetDeviceName
382 // Params: char* p_name
383 // Return: void
384 struct BTA_DmSetDeviceName {
385   std::function<void(const char* p_name)> body{[](const char* p_name) {}};
operatorBTA_DmSetDeviceName386   void operator()(const char* p_name) { body(p_name); };
387 };
388 extern struct BTA_DmSetDeviceName BTA_DmSetDeviceName;
389 
390 // Name: BTA_DmSetEncryption
391 // Params: const RawAddress& bd_addr, tBT_TRANSPORT transport,
392 // tBTA_DM_ENCRYPT_CBACK* p_callback, tBTM_BLE_SEC_ACT sec_act Return: void
393 struct BTA_DmSetEncryption {
394   std::function<void(const RawAddress& bd_addr, tBT_TRANSPORT transport,
395                      tBTA_DM_ENCRYPT_CBACK* p_callback,
396                      tBTM_BLE_SEC_ACT sec_act)>
397       body{[](const RawAddress& bd_addr, tBT_TRANSPORT transport,
398               tBTA_DM_ENCRYPT_CBACK* p_callback, tBTM_BLE_SEC_ACT sec_act) {}};
operatorBTA_DmSetEncryption399   void operator()(const RawAddress& bd_addr, tBT_TRANSPORT transport,
400                   tBTA_DM_ENCRYPT_CBACK* p_callback, tBTM_BLE_SEC_ACT sec_act) {
401     body(bd_addr, transport, p_callback, sec_act);
402   };
403 };
404 extern struct BTA_DmSetEncryption BTA_DmSetEncryption;
405 
406 // Name: BTA_DmSetLocalDiRecord
407 // Params: tSDP_DI_RECORD* p_device_info, uint32_t* p_handle
408 // Return: tBTA_STATUS
409 struct BTA_DmSetLocalDiRecord {
410   tBTA_STATUS return_value{0};
411   std::function<tBTA_STATUS(tSDP_DI_RECORD* p_device_info, uint32_t* p_handle)>
412       body{[this](tSDP_DI_RECORD* p_device_info, uint32_t* p_handle) {
413         return return_value;
414       }};
operatorBTA_DmSetLocalDiRecord415   tBTA_STATUS operator()(tSDP_DI_RECORD* p_device_info, uint32_t* p_handle) {
416     return body(p_device_info, p_handle);
417   };
418 };
419 extern struct BTA_DmSetLocalDiRecord BTA_DmSetLocalDiRecord;
420 
421 // Name: BTA_EnableTestMode
422 // Params: void
423 // Return: void
424 struct BTA_EnableTestMode {
425   std::function<void(void)> body{[](void) {}};
operatorBTA_EnableTestMode426   void operator()(void) { body(); };
427 };
428 extern struct BTA_EnableTestMode BTA_EnableTestMode;
429 
430 // Name: BTA_GetEirService
431 // Params: uint8_t* p_eir, size_t eir_len, tBTA_SERVICE_MASK* p_services
432 // Return: void
433 struct BTA_GetEirService {
434   std::function<void(const uint8_t* p_eir, size_t eir_len,
435                      tBTA_SERVICE_MASK* p_services)>
436       body{[](const uint8_t* p_eir, size_t eir_len,
437               tBTA_SERVICE_MASK* p_services) {}};
operatorBTA_GetEirService438   void operator()(const uint8_t* p_eir, size_t eir_len,
439                   tBTA_SERVICE_MASK* p_services) {
440     body(p_eir, eir_len, p_services);
441   };
442 };
443 extern struct BTA_GetEirService BTA_GetEirService;
444 
445 // Name: BTA_VendorInit
446 // Params: void
447 // Return: void
448 struct BTA_VendorInit {
449   std::function<void(void)> body{[](void) {}};
operatorBTA_VendorInit450   void operator()(void) { body(); };
451 };
452 extern struct BTA_VendorInit BTA_VendorInit;
453 
454 // Name: BTA_dm_init
455 // Params:
456 // Return: void
457 struct BTA_dm_init {
458   std::function<void()> body{[]() {}};
operatorBTA_dm_init459   void operator()() { body(); };
460 };
461 extern struct BTA_dm_init BTA_dm_init;
462 
463 }  // namespace bta_dm_api
464 }  // namespace mock
465 }  // namespace test
466 
467 // END mockcify generation
468