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:23
20  */
21 
22 #include <map>
23 #include <string>
24 
25 extern std::map<std::string, int> mock_function_count_map;
26 
27 #include "bt_common.h"
28 #include "bt_target.h"
29 #include "device/include/interop.h"
30 #include "l2c_api.h"
31 #include "osi/include/osi.h"
32 #include "stack/btm/btm_ble_int.h"
33 #include "stack/btm/btm_dev.h"
34 #include "stack/btm/btm_sec.h"
35 #include "stack/gatt/gatt_int.h"
36 #include "stack/include/l2cap_acl_interface.h"
37 
38 #ifndef UNUSED_ATTR
39 #define UNUSED_ATTR
40 #endif
41 
gatt_init(void)42 void gatt_init(void) { mock_function_count_map[__func__]++; }
gatt_act_connect(tGATT_REG * p_reg,const RawAddress & bd_addr,tBT_TRANSPORT transport,int8_t initiating_phys)43 bool gatt_act_connect(tGATT_REG* p_reg, const RawAddress& bd_addr,
44                       tBT_TRANSPORT transport, int8_t initiating_phys) {
45   mock_function_count_map[__func__]++;
46   return false;
47 }
gatt_connect(const RawAddress & rem_bda,tGATT_TCB * p_tcb,tBT_TRANSPORT transport,uint8_t initiating_phys,tGATT_IF gatt_if)48 bool gatt_connect(const RawAddress& rem_bda, tGATT_TCB* p_tcb,
49                   tBT_TRANSPORT transport, uint8_t initiating_phys,
50                   tGATT_IF gatt_if) {
51   mock_function_count_map[__func__]++;
52   return false;
53 }
gatt_disconnect(tGATT_TCB * p_tcb)54 bool gatt_disconnect(tGATT_TCB* p_tcb) {
55   mock_function_count_map[__func__]++;
56   return false;
57 }
gatt_update_app_hold_link_status(tGATT_IF gatt_if,tGATT_TCB * p_tcb,bool is_add)58 bool gatt_update_app_hold_link_status(tGATT_IF gatt_if, tGATT_TCB* p_tcb,
59                                       bool is_add) {
60   mock_function_count_map[__func__]++;
61   return false;
62 }
gatt_get_ch_state(tGATT_TCB * p_tcb)63 tGATT_CH_STATE gatt_get_ch_state(tGATT_TCB* p_tcb) {
64   mock_function_count_map[__func__]++;
65   return GATT_CH_CLOSE;
66 }
gatt_add_a_bonded_dev_for_srv_chg(const RawAddress & bda)67 void gatt_add_a_bonded_dev_for_srv_chg(const RawAddress& bda) {
68   mock_function_count_map[__func__]++;
69 }
gatt_chk_srv_chg(tGATTS_SRV_CHG * p_srv_chg_clt)70 void gatt_chk_srv_chg(tGATTS_SRV_CHG* p_srv_chg_clt) {
71   mock_function_count_map[__func__]++;
72 }
gatt_data_process(tGATT_TCB & tcb,uint16_t cid,BT_HDR * p_buf)73 void gatt_data_process(tGATT_TCB& tcb, uint16_t cid, BT_HDR* p_buf) {
74   mock_function_count_map[__func__]++;
75 }
gatt_find_in_device_record(const RawAddress & bd_addr,tBLE_BD_ADDR * address_with_type)76 void gatt_find_in_device_record(const RawAddress& bd_addr,
77                                 tBLE_BD_ADDR* address_with_type) {
78   mock_function_count_map[__func__]++;
79 }
gatt_free(void)80 void gatt_free(void) { mock_function_count_map[__func__]++; }
gatt_init_srv_chg(void)81 void gatt_init_srv_chg(void) { mock_function_count_map[__func__]++; }
gatt_l2cif_config_cfm_cback(uint16_t lcid,uint16_t initiator,tL2CAP_CFG_INFO * p_cfg)82 void gatt_l2cif_config_cfm_cback(uint16_t lcid, uint16_t initiator,
83                                  tL2CAP_CFG_INFO* p_cfg) {
84   mock_function_count_map[__func__]++;
85 }
gatt_l2cif_config_ind_cback(uint16_t lcid,tL2CAP_CFG_INFO * p_cfg)86 void gatt_l2cif_config_ind_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg) {
87   mock_function_count_map[__func__]++;
88 }
gatt_l2cif_disconnect_ind_cback(uint16_t lcid,bool ack_needed)89 void gatt_l2cif_disconnect_ind_cback(uint16_t lcid, bool ack_needed) {
90   mock_function_count_map[__func__]++;
91 }
gatt_notify_conn_update(const RawAddress & remote,uint16_t interval,uint16_t latency,uint16_t timeout,tHCI_STATUS status)92 void gatt_notify_conn_update(const RawAddress& remote, uint16_t interval,
93                              uint16_t latency, uint16_t timeout,
94                              tHCI_STATUS status) {
95   mock_function_count_map[__func__]++;
96 }
gatt_notify_phy_updated(tGATT_STATUS status,uint16_t handle,uint8_t tx_phy,uint8_t rx_phy)97 void gatt_notify_phy_updated(tGATT_STATUS status, uint16_t handle,
98                              uint8_t tx_phy, uint8_t rx_phy) {
99   mock_function_count_map[__func__]++;
100 }
gatt_proc_srv_chg(void)101 void gatt_proc_srv_chg(void) { mock_function_count_map[__func__]++; }
gatt_send_srv_chg_ind(const RawAddress & peer_bda)102 void gatt_send_srv_chg_ind(const RawAddress& peer_bda) {
103   mock_function_count_map[__func__]++;
104 }
gatt_set_ch_state(tGATT_TCB * p_tcb,tGATT_CH_STATE ch_state)105 void gatt_set_ch_state(tGATT_TCB* p_tcb, tGATT_CH_STATE ch_state) {
106   mock_function_count_map[__func__]++;
107 }
gatt_update_app_use_link_flag(tGATT_IF gatt_if,tGATT_TCB * p_tcb,bool is_add,bool check_acl_link)108 void gatt_update_app_use_link_flag(tGATT_IF gatt_if, tGATT_TCB* p_tcb,
109                                    bool is_add, bool check_acl_link) {
110   mock_function_count_map[__func__]++;
111 }
112