1 /*
2 * Copyright 2020 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:44
20 */
21
22 #include <map>
23 #include <string>
24
25 extern std::map<std::string, int> mock_function_count_map;
26
27 #include <stddef.h>
28 #include <stdio.h>
29 #include <stdlib.h>
30 #include <string.h>
31
32 #include "advertise_data_parser.h"
33 #include "btm_api.h"
34 #include "common/time_util.h"
35 #include "device/include/controller.h"
36 #include "main/shim/btm_api.h"
37 #include "main/shim/shim.h"
38 #include "osi/include/log.h"
39 #include "osi/include/osi.h"
40 #include "stack/btm/btm_ble_int.h"
41 #include "stack/btm/btm_int_types.h"
42 #include "stack/include/acl_api.h"
43 #include "stack/include/bt_hdr.h"
44 #include "stack/include/btm_ble_api.h"
45 #include "stack/include/inq_hci_link_interface.h"
46 #include "types/bluetooth/uuid.h"
47 #include "types/raw_address.h"
48
49 #ifndef UNUSED_ATTR
50 #define UNUSED_ATTR
51 #endif
52
SendRemoteNameRequest(const RawAddress & raw_address)53 void SendRemoteNameRequest(const RawAddress& raw_address) {
54 mock_function_count_map[__func__]++;
55 }
BTM_HasEirService(const uint32_t * p_eir_uuid,uint16_t uuid16)56 bool BTM_HasEirService(const uint32_t* p_eir_uuid, uint16_t uuid16) {
57 mock_function_count_map[__func__]++;
58 return false;
59 }
btm_inq_find_bdaddr(const RawAddress & p_bda)60 bool btm_inq_find_bdaddr(const RawAddress& p_bda) {
61 mock_function_count_map[__func__]++;
62 return false;
63 }
BTM_HasInquiryEirService(tBTM_INQ_RESULTS * p_results,uint16_t uuid16)64 tBTM_EIR_SEARCH_RESULT BTM_HasInquiryEirService(tBTM_INQ_RESULTS* p_results,
65 uint16_t uuid16) {
66 mock_function_count_map[__func__]++;
67 return 0;
68 }
BTM_InqDbFirst(void)69 tBTM_INQ_INFO* BTM_InqDbFirst(void) {
70 mock_function_count_map[__func__]++;
71 return nullptr;
72 }
BTM_InqDbNext(tBTM_INQ_INFO * p_cur)73 tBTM_INQ_INFO* BTM_InqDbNext(tBTM_INQ_INFO* p_cur) {
74 mock_function_count_map[__func__]++;
75 return nullptr;
76 }
BTM_InqDbRead(const RawAddress & p_bda)77 tBTM_INQ_INFO* BTM_InqDbRead(const RawAddress& p_bda) {
78 mock_function_count_map[__func__]++;
79 return nullptr;
80 }
BTM_CancelRemoteDeviceName(void)81 tBTM_STATUS BTM_CancelRemoteDeviceName(void) {
82 mock_function_count_map[__func__]++;
83 return BTM_SUCCESS;
84 }
BTM_ClearInqDb(const RawAddress * p_bda)85 tBTM_STATUS BTM_ClearInqDb(const RawAddress* p_bda) {
86 mock_function_count_map[__func__]++;
87 return BTM_SUCCESS;
88 }
BTM_ReadRemoteDeviceName(const RawAddress & remote_bda,tBTM_CMPL_CB * p_cb,tBT_TRANSPORT transport)89 tBTM_STATUS BTM_ReadRemoteDeviceName(const RawAddress& remote_bda,
90 tBTM_CMPL_CB* p_cb,
91 tBT_TRANSPORT transport) {
92 mock_function_count_map[__func__]++;
93 return BTM_SUCCESS;
94 }
BTM_SetConnectability(uint16_t page_mode)95 tBTM_STATUS BTM_SetConnectability(uint16_t page_mode) {
96 mock_function_count_map[__func__]++;
97 return BTM_SUCCESS;
98 }
BTM_SetDiscoverability(uint16_t inq_mode)99 tBTM_STATUS BTM_SetDiscoverability(uint16_t inq_mode) {
100 mock_function_count_map[__func__]++;
101 return BTM_SUCCESS;
102 }
BTM_SetInquiryMode(uint8_t mode)103 tBTM_STATUS BTM_SetInquiryMode(uint8_t mode) {
104 mock_function_count_map[__func__]++;
105 return BTM_SUCCESS;
106 }
BTM_StartInquiry(tBTM_INQ_RESULTS_CB * p_results_cb,tBTM_CMPL_CB * p_cmpl_cb)107 tBTM_STATUS BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb,
108 tBTM_CMPL_CB* p_cmpl_cb) {
109 mock_function_count_map[__func__]++;
110 return BTM_SUCCESS;
111 }
btm_initiate_rem_name(const RawAddress & remote_bda,uint8_t origin,uint64_t timeout_ms,tBTM_CMPL_CB * p_cb)112 tBTM_STATUS btm_initiate_rem_name(const RawAddress& remote_bda, uint8_t origin,
113 uint64_t timeout_ms, tBTM_CMPL_CB* p_cb) {
114 mock_function_count_map[__func__]++;
115 return BTM_SUCCESS;
116 }
btm_inq_db_find(const RawAddress & p_bda)117 tINQ_DB_ENT* btm_inq_db_find(const RawAddress& p_bda) {
118 mock_function_count_map[__func__]++;
119 return nullptr;
120 }
btm_inq_db_new(const RawAddress & p_bda)121 tINQ_DB_ENT* btm_inq_db_new(const RawAddress& p_bda) {
122 mock_function_count_map[__func__]++;
123 return nullptr;
124 }
BTM_IsInquiryActive(void)125 uint16_t BTM_IsInquiryActive(void) {
126 mock_function_count_map[__func__]++;
127 return 0;
128 }
BTM_GetEirSupportedServices(uint32_t * p_eir_uuid,uint8_t ** p,uint8_t max_num_uuid16,uint8_t * p_num_uuid16)129 uint8_t BTM_GetEirSupportedServices(uint32_t* p_eir_uuid, uint8_t** p,
130 uint8_t max_num_uuid16,
131 uint8_t* p_num_uuid16) {
132 mock_function_count_map[__func__]++;
133 return 0;
134 }
BTM_GetEirUuidList(const uint8_t * p_eir,size_t eir_len,uint8_t uuid_size,uint8_t * p_num_uuid,uint8_t * p_uuid_list,uint8_t max_num_uuid)135 uint8_t BTM_GetEirUuidList(const uint8_t* p_eir, size_t eir_len,
136 uint8_t uuid_size, uint8_t* p_num_uuid,
137 uint8_t* p_uuid_list, uint8_t max_num_uuid) {
138 mock_function_count_map[__func__]++;
139 return 0;
140 }
BTM_AddEirService(uint32_t * p_eir_uuid,uint16_t uuid16)141 void BTM_AddEirService(uint32_t* p_eir_uuid, uint16_t uuid16) {
142 mock_function_count_map[__func__]++;
143 }
BTM_CancelInquiry(void)144 void BTM_CancelInquiry(void) { mock_function_count_map[__func__]++; }
BTM_EnableInterlacedInquiryScan()145 void BTM_EnableInterlacedInquiryScan() { mock_function_count_map[__func__]++; }
BTM_EnableInterlacedPageScan()146 void BTM_EnableInterlacedPageScan() { mock_function_count_map[__func__]++; }
btm_clr_inq_db(const RawAddress * p_bda)147 void btm_clr_inq_db(const RawAddress* p_bda) {
148 mock_function_count_map[__func__]++;
149 }
btm_clr_inq_result_flt(void)150 void btm_clr_inq_result_flt(void) { mock_function_count_map[__func__]++; }
btm_inq_clear_ssp(void)151 void btm_inq_clear_ssp(void) { mock_function_count_map[__func__]++; }
btm_inq_db_free(void)152 void btm_inq_db_free(void) { mock_function_count_map[__func__]++; }
btm_inq_db_init(void)153 void btm_inq_db_init(void) { mock_function_count_map[__func__]++; }
btm_inq_db_reset(void)154 void btm_inq_db_reset(void) { mock_function_count_map[__func__]++; }
btm_inq_remote_name_timer_timeout(UNUSED_ATTR void * data)155 void btm_inq_remote_name_timer_timeout(UNUSED_ATTR void* data) {
156 mock_function_count_map[__func__]++;
157 }
btm_inq_rmt_name_failed_cancelled(void)158 void btm_inq_rmt_name_failed_cancelled(void) {
159 mock_function_count_map[__func__]++;
160 }
btm_inq_stop_on_ssp(void)161 void btm_inq_stop_on_ssp(void) { mock_function_count_map[__func__]++; }
btm_process_cancel_complete(tHCI_STATUS status,uint8_t mode)162 void btm_process_cancel_complete(tHCI_STATUS status, uint8_t mode) {
163 mock_function_count_map[__func__]++;
164 }
btm_process_inq_complete(tHCI_STATUS status,uint8_t mode)165 void btm_process_inq_complete(tHCI_STATUS status, uint8_t mode) {
166 mock_function_count_map[__func__]++;
167 }
btm_process_inq_results(const uint8_t * p,uint8_t hci_evt_len,uint8_t inq_res_mode)168 void btm_process_inq_results(const uint8_t* p, uint8_t hci_evt_len,
169 uint8_t inq_res_mode) {
170 mock_function_count_map[__func__]++;
171 }
btm_process_remote_name(const RawAddress * bda,const BD_NAME bdn,uint16_t evt_len,tHCI_STATUS hci_status)172 void btm_process_remote_name(const RawAddress* bda, const BD_NAME bdn,
173 uint16_t evt_len, tHCI_STATUS hci_status) {
174 mock_function_count_map[__func__]++;
175 }
btm_set_eir_uuid(const uint8_t * p_eir,tBTM_INQ_RESULTS * p_results)176 void btm_set_eir_uuid(const uint8_t* p_eir, tBTM_INQ_RESULTS* p_results) {
177 mock_function_count_map[__func__]++;
178 }
btm_sort_inq_result(void)179 void btm_sort_inq_result(void) { mock_function_count_map[__func__]++; }
BTM_IsRemoteNameKnown(const RawAddress & bd_addr,tBT_TRANSPORT transport)180 bool BTM_IsRemoteNameKnown(const RawAddress& bd_addr, tBT_TRANSPORT transport) {
181 mock_function_count_map[__func__]++;
182 return false;
183 }
184