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:16
20 */
21
22 #include "test/mock/mock_stack_btm_dev.h"
23
24 #include <stddef.h>
25 #include <stdlib.h>
26
27 #include <string>
28
29 #include "stack/btm/btm_dev.h"
30 #include "stack/include/bt_octets.h"
31 #include "stack/include/btm_ble_addr.h"
32 #include "stack/include/btm_client_interface.h"
33 #include "stack/include/btm_sec_api.h"
34 #include "test/common/mock_functions.h"
35 #include "types/raw_address.h"
36
37 namespace test {
38 namespace mock {
39 namespace stack_btm_dev {
40
41 struct btm_find_dev btm_find_dev;
42 struct BTM_Sec_AddressKnown BTM_Sec_AddressKnown;
43
44 struct maybe_resolve_address maybe_resolve_address;
45 } // namespace stack_btm_dev
46 } // namespace mock
47 } // namespace test
48
BTM_SecAddDevice(const RawAddress &,const DEV_CLASS,LinkKey,uint8_t,uint8_t)49 void BTM_SecAddDevice(const RawAddress& /* bd_addr */, const DEV_CLASS /* dev_class */,
50 LinkKey /* link_key */, uint8_t /* key_type */, uint8_t /* pin_length */) {
51 inc_func_call_count(__func__);
52 }
BTM_SecDeleteDevice(const RawAddress &)53 bool BTM_SecDeleteDevice(const RawAddress& /* bd_addr */) {
54 inc_func_call_count(__func__);
55 return false;
56 }
btm_set_bond_type_dev(const RawAddress &,tBTM_BOND_TYPE)57 bool btm_set_bond_type_dev(const RawAddress& /* bd_addr */, tBTM_BOND_TYPE /* bond_type */) {
58 inc_func_call_count(__func__);
59 return false;
60 }
BTM_SecReadDevName(const RawAddress &)61 const char* BTM_SecReadDevName(const RawAddress& /* bd_addr */) {
62 inc_func_call_count(__func__);
63 return nullptr;
64 }
BTM_SecReadDevClass(const RawAddress &)65 DEV_CLASS BTM_SecReadDevClass(const RawAddress& /* bd_addr */) {
66 inc_func_call_count(__func__);
67 return kDevClassEmpty;
68 }
btm_find_dev(const RawAddress & bd_addr)69 tBTM_SEC_DEV_REC* btm_find_dev(const RawAddress& bd_addr) {
70 inc_func_call_count(__func__);
71 return test::mock::stack_btm_dev::btm_find_dev.body(bd_addr);
72 }
btm_find_dev_by_handle(uint16_t)73 tBTM_SEC_DEV_REC* btm_find_dev_by_handle(uint16_t /* handle */) {
74 inc_func_call_count(__func__);
75 return nullptr;
76 }
btm_find_or_alloc_dev(const RawAddress &)77 tBTM_SEC_DEV_REC* btm_find_or_alloc_dev(const RawAddress& /* bd_addr */) {
78 inc_func_call_count(__func__);
79 return nullptr;
80 }
btm_sec_alloc_dev(const RawAddress &)81 tBTM_SEC_DEV_REC* btm_sec_alloc_dev(const RawAddress& /* bd_addr */) {
82 inc_func_call_count(__func__);
83 return nullptr;
84 }
btm_sec_allocate_dev_rec(void)85 tBTM_SEC_DEV_REC* btm_sec_allocate_dev_rec(void) {
86 inc_func_call_count(__func__);
87 return nullptr;
88 }
btm_get_bond_type_dev(const RawAddress &)89 tBTM_BOND_TYPE btm_get_bond_type_dev(const RawAddress& /* bd_addr */) {
90 inc_func_call_count(__func__);
91 return BOND_TYPE_UNKNOWN;
92 }
BTM_SecClearSecurityFlags(const RawAddress &)93 void BTM_SecClearSecurityFlags(const RawAddress& /* bd_addr */) { inc_func_call_count(__func__); }
btm_consolidate_dev(tBTM_SEC_DEV_REC *)94 void btm_consolidate_dev(tBTM_SEC_DEV_REC* /* p_target_rec */) { inc_func_call_count(__func__); }
btm_dev_consolidate_existing_connections(const RawAddress &)95 void btm_dev_consolidate_existing_connections(const RawAddress& /* bd_addr */) {
96 inc_func_call_count(__func__);
97 }
btm_get_sec_dev_rec()98 std::vector<tBTM_SEC_DEV_REC*> btm_get_sec_dev_rec() {
99 inc_func_call_count(__func__);
100 return {};
101 }
BTM_Sec_AddressKnown(const RawAddress & address)102 bool BTM_Sec_AddressKnown(const RawAddress& address) {
103 inc_func_call_count(__func__);
104 return test::mock::stack_btm_dev::BTM_Sec_AddressKnown(address);
105 }
106
maybe_resolve_address(RawAddress * bda,tBLE_ADDR_TYPE * bda_type)107 bool maybe_resolve_address(RawAddress* bda, tBLE_ADDR_TYPE* bda_type) {
108 inc_func_call_count(__func__);
109 return test::mock::stack_btm_dev::maybe_resolve_address(bda, bda_type);
110 }
BTM_Sec_GetAddressWithType(const RawAddress & bd_addr)111 const tBLE_BD_ADDR BTM_Sec_GetAddressWithType(const RawAddress& bd_addr) {
112 inc_func_call_count(__func__);
113 return tBLE_BD_ADDR{.type = BLE_ADDR_PUBLIC, .bda = bd_addr};
114 }
115
DumpsysRecord(int)116 void DumpsysRecord(int /* fd */) { inc_func_call_count(__func__); }
117