1 /* 2 * Copyright 2022 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:14 21 * 22 * mockcify.pl ver 0.5.0 23 */ 24 25 #include <cstdint> 26 #include <functional> 27 #include <optional> 28 #include <string> 29 30 // Original included files, if any 31 #include "stack/include/bt_hdr.h" 32 #include "stack/include/bt_octets.h" 33 #include "stack/include/hci_error_code.h" 34 #include "types/ble_address_with_type.h" 35 #include "types/raw_address.h" 36 37 // Original usings 38 39 // Mocked compile conditionals, if any 40 41 namespace test { 42 namespace mock { 43 namespace main_shim_acl_api { 44 45 // Shared state between mocked functions and tests 46 // Name: ACL_AcceptLeConnectionFrom 47 // Params: const tBLE_BD_ADDR& legacy_address_with_type, bool is_direct 48 // Return: bool 49 struct ACL_AcceptLeConnectionFrom { 50 static bool return_value; 51 std::function<bool(const tBLE_BD_ADDR& legacy_address_with_type, 52 bool is_direct)> 53 body{[](const tBLE_BD_ADDR& legacy_address_with_type, bool is_direct) { 54 return return_value; 55 }}; operatorACL_AcceptLeConnectionFrom56 bool operator()(const tBLE_BD_ADDR& legacy_address_with_type, 57 bool is_direct) { 58 return body(legacy_address_with_type, is_direct); 59 }; 60 }; 61 extern struct ACL_AcceptLeConnectionFrom ACL_AcceptLeConnectionFrom; 62 63 // Name: ACL_AddToAddressResolution 64 // Params: const tBLE_BD_ADDR& legacy_address_with_type, const Octet16& 65 // peer_irk, const Octet16& local_irk Return: void 66 struct ACL_AddToAddressResolution { 67 std::function<void(const tBLE_BD_ADDR& legacy_address_with_type, 68 const Octet16& peer_irk, const Octet16& local_irk)> 69 body{[](const tBLE_BD_ADDR& legacy_address_with_type, 70 const Octet16& peer_irk, const Octet16& local_irk) {}}; operatorACL_AddToAddressResolution71 void operator()(const tBLE_BD_ADDR& legacy_address_with_type, 72 const Octet16& peer_irk, const Octet16& local_irk) { 73 body(legacy_address_with_type, peer_irk, local_irk); 74 }; 75 }; 76 extern struct ACL_AddToAddressResolution ACL_AddToAddressResolution; 77 78 // Name: ACL_CancelClassicConnection 79 // Params: const RawAddress& raw_address 80 // Return: void 81 struct ACL_CancelClassicConnection { 82 std::function<void(const RawAddress& raw_address)> body{ 83 [](const RawAddress& raw_address) {}}; operatorACL_CancelClassicConnection84 void operator()(const RawAddress& raw_address) { body(raw_address); }; 85 }; 86 extern struct ACL_CancelClassicConnection ACL_CancelClassicConnection; 87 88 // Name: ACL_ClearAddressResolution 89 // Params: 90 // Return: void 91 struct ACL_ClearAddressResolution { 92 std::function<void()> body{[]() {}}; operatorACL_ClearAddressResolution93 void operator()() { body(); }; 94 }; 95 extern struct ACL_ClearAddressResolution ACL_ClearAddressResolution; 96 97 // Name: ACL_ClearFilterAcceptList 98 // Params: 99 // Return: void 100 struct ACL_ClearFilterAcceptList { 101 std::function<void()> body{[]() {}}; operatorACL_ClearFilterAcceptList102 void operator()() { body(); }; 103 }; 104 extern struct ACL_ClearFilterAcceptList ACL_ClearFilterAcceptList; 105 106 // Name: ACL_LeSetDefaultSubrate 107 // Params: 108 // Return: void 109 struct ACL_LeSetDefaultSubrate { 110 std::function<void(uint16_t subrate_min, uint16_t subrate_max, 111 uint16_t max_latency, uint16_t cont_num, 112 uint16_t sup_tout)> 113 body{[](uint16_t subrate_min, uint16_t subrate_max, uint16_t max_latency, 114 uint16_t cont_num, uint16_t sup_tout) {}}; operatorACL_LeSetDefaultSubrate115 void operator()(uint16_t subrate_min, uint16_t subrate_max, 116 uint16_t max_latency, uint16_t cont_num, uint16_t sup_tout) { 117 body(subrate_min, subrate_max, max_latency, cont_num, sup_tout); 118 }; 119 }; 120 extern struct ACL_LeSetDefaultSubrate ACL_LeSetDefaultSubrate; 121 122 // Name: ACL_LeSubrateRequest 123 // Params: 124 // Return: void 125 struct ACL_LeSubrateRequest { 126 std::function<void(uint16_t hci_handle, uint16_t subrate_min, 127 uint16_t subrate_max, uint16_t max_latency, 128 uint16_t cont_num, uint16_t sup_tout)> 129 body{[](uint16_t hci_handle, uint16_t subrate_min, uint16_t subrate_max, 130 uint16_t max_latency, uint16_t cont_num, uint16_t sup_tout) {}}; operatorACL_LeSubrateRequest131 void operator()(uint16_t hci_handle, uint16_t subrate_min, 132 uint16_t subrate_max, uint16_t max_latency, uint16_t cont_num, 133 uint16_t sup_tout) { 134 body(hci_handle, subrate_min, subrate_max, max_latency, cont_num, sup_tout); 135 }; 136 }; 137 extern struct ACL_LeSubrateRequest ACL_LeSubrateRequest; 138 139 // Name: ACL_ConfigureLePrivacy 140 // Params: bool is_le_privacy_enabled 141 // Return: void 142 struct ACL_ConfigureLePrivacy { 143 std::function<void(bool is_le_privacy_enabled)> body{ 144 [](bool is_le_privacy_enabled) {}}; operatorACL_ConfigureLePrivacy145 void operator()(bool is_le_privacy_enabled) { body(is_le_privacy_enabled); }; 146 }; 147 extern struct ACL_ConfigureLePrivacy ACL_ConfigureLePrivacy; 148 149 // Name: ACL_CreateClassicConnection 150 // Params: const RawAddress& raw_address 151 // Return: void 152 struct ACL_CreateClassicConnection { 153 std::function<void(const RawAddress& raw_address)> body{ 154 [](const RawAddress& raw_address) {}}; operatorACL_CreateClassicConnection155 void operator()(const RawAddress& raw_address) { body(raw_address); }; 156 }; 157 extern struct ACL_CreateClassicConnection ACL_CreateClassicConnection; 158 159 // Name: ACL_Disconnect 160 // Params: uint16_t handle, bool is_classic, tHCI_STATUS reason, std::string 161 // comment Return: void 162 struct ACL_Disconnect { 163 std::function<void(uint16_t handle, bool is_classic, tHCI_STATUS reason, 164 std::string comment)> 165 body{[](uint16_t handle, bool is_classic, tHCI_STATUS reason, 166 std::string comment) {}}; operatorACL_Disconnect167 void operator()(uint16_t handle, bool is_classic, tHCI_STATUS reason, 168 std::string comment) { 169 body(handle, is_classic, reason, comment); 170 }; 171 }; 172 extern struct ACL_Disconnect ACL_Disconnect; 173 174 // Name: ACL_IgnoreAllLeConnections 175 // Params: 176 // Return: void 177 struct ACL_IgnoreAllLeConnections { 178 std::function<void()> body{[]() {}}; operatorACL_IgnoreAllLeConnections179 void operator()() { body(); }; 180 }; 181 extern struct ACL_IgnoreAllLeConnections ACL_IgnoreAllLeConnections; 182 183 // Name: ACL_IgnoreLeConnectionFrom 184 // Params: const tBLE_BD_ADDR& legacy_address_with_type 185 // Return: void 186 struct ACL_IgnoreLeConnectionFrom { 187 std::function<void(const tBLE_BD_ADDR& legacy_address_with_type)> body{ 188 [](const tBLE_BD_ADDR& legacy_address_with_type) {}}; operatorACL_IgnoreLeConnectionFrom189 void operator()(const tBLE_BD_ADDR& legacy_address_with_type) { 190 body(legacy_address_with_type); 191 }; 192 }; 193 extern struct ACL_IgnoreLeConnectionFrom ACL_IgnoreLeConnectionFrom; 194 195 // Name: ACL_ReadConnectionAddress 196 // Params: uint16_t handle, RawAddress& conn_addr, tBLE_ADDR_TYPE*, bool 197 // p_addr_type Return: void 198 struct ACL_ReadConnectionAddress { 199 std::function<void(uint16_t handle, RawAddress& conn_addr, 200 tBLE_ADDR_TYPE* p_addr_type, bool ota_address)> 201 body{[](uint16_t handle, RawAddress& conn_addr, 202 tBLE_ADDR_TYPE* p_addr_type, bool ota_address) {}}; operatorACL_ReadConnectionAddress203 void operator()(uint16_t handle, RawAddress& conn_addr, 204 tBLE_ADDR_TYPE* p_addr_type, bool ota_address) { 205 body(handle, conn_addr, p_addr_type, ota_address); 206 }; 207 }; 208 extern struct ACL_ReadConnectionAddress ACL_ReadConnectionAddress; 209 210 // Name: ACL_ReadPeerConnectionAddress 211 // Params: uint16_t handle, RawAddress& conn_addr, tBLE_ADDR_TYPE*, bool 212 // p_addr_type Return: void 213 struct ACL_ReadPeerConnectionAddress { 214 std::function<void(uint16_t handle, RawAddress& conn_addr, 215 tBLE_ADDR_TYPE* p_addr_type, bool ota_address)> 216 body{[](uint16_t handle, RawAddress& conn_addr, 217 tBLE_ADDR_TYPE* p_addr_type, bool ota_address) {}}; operatorACL_ReadPeerConnectionAddress218 void operator()(uint16_t handle, RawAddress& conn_addr, 219 tBLE_ADDR_TYPE* p_addr_type, bool ota_address) { 220 body(handle, conn_addr, p_addr_type, ota_address); 221 }; 222 }; 223 extern struct ACL_ReadPeerConnectionAddress ACL_ReadPeerConnectionAddress; 224 225 // Name: ACL_GetAdvertisingSetConnectedTo 226 // Params: const RawAddress& addr 227 // Return: std::optional<uint8_t> 228 struct ACL_GetAdvertisingSetConnectedTo { 229 static std::optional<uint8_t> return_value; 230 std::function<std::optional<uint8_t>(const RawAddress& addr)> body{ 231 [](const RawAddress& addr) { return return_value; }}; operatorACL_GetAdvertisingSetConnectedTo232 std::optional<uint8_t> operator()(const RawAddress& addr) { 233 return body(addr); 234 }; 235 }; 236 extern struct ACL_GetAdvertisingSetConnectedTo ACL_GetAdvertisingSetConnectedTo; 237 238 // Name: ACL_RemoveFromAddressResolution 239 // Params: const tBLE_BD_ADDR& legacy_address_with_type 240 // Return: void 241 struct ACL_RemoveFromAddressResolution { 242 std::function<void(const tBLE_BD_ADDR& legacy_address_with_type)> body{ 243 [](const tBLE_BD_ADDR& legacy_address_with_type) {}}; operatorACL_RemoveFromAddressResolution244 void operator()(const tBLE_BD_ADDR& legacy_address_with_type) { 245 body(legacy_address_with_type); 246 }; 247 }; 248 extern struct ACL_RemoveFromAddressResolution ACL_RemoveFromAddressResolution; 249 250 // Name: ACL_Shutdown 251 // Params: 252 // Return: void 253 struct ACL_Shutdown { 254 std::function<void()> body{[]() {}}; operatorACL_Shutdown255 void operator()() { body(); }; 256 }; 257 extern struct ACL_Shutdown ACL_Shutdown; 258 259 // Name: ACL_WriteData 260 // Params: uint16_t handle, BT_HDR* p_buf 261 // Return: void 262 struct ACL_WriteData { 263 std::function<void(uint16_t handle, BT_HDR* p_buf)> body{ 264 [](uint16_t handle, BT_HDR* p_buf) {}}; operatorACL_WriteData265 void operator()(uint16_t handle, BT_HDR* p_buf) { body(handle, p_buf); }; 266 }; 267 extern struct ACL_WriteData ACL_WriteData; 268 269 // Name: ACL_Flush 270 // Params: uint16_t handle 271 // Return: void 272 struct ACL_Flush { 273 std::function<void(uint16_t handle)> body{[](uint16_t /* handle */) {}}; operatorACL_Flush274 void operator()(uint16_t handle) { body(handle); }; 275 }; 276 extern struct ACL_Flush ACL_Flush; 277 278 // Name: ACL_SendConnectionParameterUpdateRequest 279 // Params: uint16_t handle 280 // Params: uint16_t conn_int_min 281 // Params: uint16_t conn_int_max 282 // Params: uint16_t conn_latency 283 // Params: uint16_t conn_timeout 284 // Params: uint16_t min_ce_len 285 // Params: uint16_t max_ce_len 286 // Return: void 287 struct ACL_SendConnectionParameterUpdateRequest { 288 std::function<void(uint16_t handle, uint16_t conn_int_min, 289 uint16_t conn_int_max, uint16_t conn_latency, 290 uint16_t conn_timeout, uint16_t min_ce_len, 291 uint16_t max_ce_len)> 292 body{[](uint16_t /* handle */, uint16_t /* conn_int_min */, 293 uint16_t /* conn_int_max */, uint16_t /* conn_latency */, 294 uint16_t /* conn_timeout */, uint16_t /* min_ce_len */, 295 uint16_t /* max_ce_len */) {}}; operatorACL_SendConnectionParameterUpdateRequest296 void operator()(uint16_t handle, uint16_t conn_int_min, uint16_t conn_int_max, 297 uint16_t conn_latency, uint16_t conn_timeout, 298 uint16_t min_ce_len, uint16_t max_ce_len) { 299 body(handle, conn_int_min, conn_int_max, conn_latency, conn_timeout, 300 min_ce_len, max_ce_len); 301 }; 302 }; 303 extern struct ACL_SendConnectionParameterUpdateRequest 304 ACL_SendConnectionParameterUpdateRequest; 305 } // namespace main_shim_acl_api 306 } // namespace mock 307 } // namespace test 308 309 // END mockcify generation 310