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:6
20  *
21  *  mockcify.pl ver 0.2
22  */
23 
24 #include <cstdint>
25 #include <map>
26 #include <string>
27 
28 extern std::map<std::string, int> mock_function_count_map;
29 
30 // Original included files, if any
31 // NOTE: Since this is a mock file with mock definitions some number of
32 //       include files may not be required.  The include-what-you-use
33 //       still applies, but crafting proper inclusion is out of scope
34 //       for this effort.  This compilation unit may compile as-is, or
35 //       may need attention to prune the inclusion set.
36 
37 #include "stack/include/hci_error_code.h"
38 #include "types/ble_address_with_type.h"
39 #include "types/raw_address.h"
40 
41 // Mocked compile conditionals, if any
42 #ifndef UNUSED_ATTR
43 #define UNUSED_ATTR
44 #endif
45 
46 namespace test {
47 namespace mock {
48 namespace stack_acl_btm_ble_connection_establishment {
49 
50 // Shared state between mocked functions and tests
51 // Name: btm_send_hci_create_connection
52 // Params: uint16_t scan_int, uint16_t scan_win, uint8_t init_filter_policy,
53 // uint8_t addr_type_peer, const RawAddress& bda_peer, uint8_t addr_type_own,
54 // uint16_t conn_int_min, uint16_t conn_int_max, uint16_t conn_latency, uint16_t
55 // conn_timeout, uint16_t min_ce_len, uint16_t max_ce_len, uint8_t
56 // initiating_phys Returns: void
57 struct btm_send_hci_create_connection {
58   std::function<void(
59       uint16_t scan_int, uint16_t scan_win, uint8_t init_filter_policy,
60       uint8_t addr_type_peer, const RawAddress& bda_peer, uint8_t addr_type_own,
61       uint16_t conn_int_min, uint16_t conn_int_max, uint16_t conn_latency,
62       uint16_t conn_timeout, uint16_t min_ce_len, uint16_t max_ce_len,
63       uint8_t initiating_phys)>
64       body{[](uint16_t scan_int, uint16_t scan_win, uint8_t init_filter_policy,
65               uint8_t addr_type_peer, const RawAddress& bda_peer,
66               uint8_t addr_type_own, uint16_t conn_int_min,
67               uint16_t conn_int_max, uint16_t conn_latency,
68               uint16_t conn_timeout, uint16_t min_ce_len, uint16_t max_ce_len,
69               uint8_t initiating_phys) {}};
operatorbtm_send_hci_create_connection70   void operator()(uint16_t scan_int, uint16_t scan_win,
71                   uint8_t init_filter_policy, uint8_t addr_type_peer,
72                   const RawAddress& bda_peer, uint8_t addr_type_own,
73                   uint16_t conn_int_min, uint16_t conn_int_max,
74                   uint16_t conn_latency, uint16_t conn_timeout,
75                   uint16_t min_ce_len, uint16_t max_ce_len,
76                   uint8_t initiating_phys) {
77     body(scan_int, scan_win, init_filter_policy, addr_type_peer, bda_peer,
78          addr_type_own, conn_int_min, conn_int_max, conn_latency, conn_timeout,
79          min_ce_len, max_ce_len, initiating_phys);
80   };
81 };
82 extern struct btm_send_hci_create_connection btm_send_hci_create_connection;
83 // Name: btm_ble_create_ll_conn_complete
84 // Params: tHCI_STATUS status
85 // Returns: void
86 struct btm_ble_create_ll_conn_complete {
87   std::function<void(tHCI_STATUS status)> body{[](tHCI_STATUS status) {}};
operatorbtm_ble_create_ll_conn_complete88   void operator()(tHCI_STATUS status) { body(status); };
89 };
90 extern struct btm_ble_create_ll_conn_complete btm_ble_create_ll_conn_complete;
91 // Name: maybe_resolve_address
92 // Params: RawAddress* bda, tBLE_ADDR_TYPE* bda_type
93 // Returns: bool
94 struct maybe_resolve_address {
95   std::function<bool(RawAddress* bda, tBLE_ADDR_TYPE* bda_type)> body{
96       [](RawAddress* bda, tBLE_ADDR_TYPE* bda_type) { return false; }};
operatormaybe_resolve_address97   bool operator()(RawAddress* bda, tBLE_ADDR_TYPE* bda_type) {
98     return body(bda, bda_type);
99   };
100 };
101 extern struct maybe_resolve_address maybe_resolve_address;
102 // Name: btm_ble_conn_complete
103 // Params: uint8_t* p, uint16_t evt_len, bool enhanced
104 // Returns: void
105 struct btm_ble_conn_complete {
106   std::function<void(uint8_t* p, uint16_t evt_len, bool enhanced)> body{
107       [](uint8_t* p, uint16_t evt_len, bool enhanced) {}};
operatorbtm_ble_conn_complete108   void operator()(uint8_t* p, uint16_t evt_len, bool enhanced) {
109     body(p, evt_len, enhanced);
110   };
111 };
112 extern struct btm_ble_conn_complete btm_ble_conn_complete;
113 // Name: btm_ble_create_conn_cancel
114 // Params:
115 // Returns: void
116 struct btm_ble_create_conn_cancel {
117   std::function<void()> body{[]() {}};
operatorbtm_ble_create_conn_cancel118   void operator()() { body(); };
119 };
120 extern struct btm_ble_create_conn_cancel btm_ble_create_conn_cancel;
121 // Name: btm_ble_create_conn_cancel_complete
122 // Params: uint8_t* p
123 // Returns: void
124 struct btm_ble_create_conn_cancel_complete {
125   std::function<void(uint8_t* p)> body{[](uint8_t* p) {}};
operatorbtm_ble_create_conn_cancel_complete126   void operator()(uint8_t* p) { body(p); };
127 };
128 extern struct btm_ble_create_conn_cancel_complete
129     btm_ble_create_conn_cancel_complete;
130 
131 }  // namespace stack_acl_btm_ble_connection_establishment
132 }  // namespace mock
133 }  // namespace test
134 
135 // END mockcify generation
136