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:27
20  */
21 
22 #include <cstdint>
23 #include <map>
24 #include <string>
25 
26 #include "stack/gatt/gatt_int.h"
27 #include "stack/include/gatt_api.h"
28 #include "types/bluetooth/uuid.h"
29 #include "types/bt_transport.h"
30 #include "types/raw_address.h"
31 
32 using namespace bluetooth;
33 
34 extern std::map<std::string, int> mock_function_count_map;
35 tGATT_HDL_LIST_ELEM elem;  // gatt_add_an_item_to_list
36 
37 #ifndef UNUSED_ATTR
38 #define UNUSED_ATTR
39 #endif
40 
GATTS_DeleteService(tGATT_IF gatt_if,Uuid * p_svc_uuid,uint16_t svc_inst)41 bool GATTS_DeleteService(tGATT_IF gatt_if, Uuid* p_svc_uuid,
42                          uint16_t svc_inst) {
43   mock_function_count_map[__func__]++;
44   return false;
45 }
GATTS_NVRegister(tGATT_APPL_INFO * p_cb_info)46 bool GATTS_NVRegister(tGATT_APPL_INFO* p_cb_info) {
47   mock_function_count_map[__func__]++;
48   return false;
49 }
GATT_CancelConnect(tGATT_IF gatt_if,const RawAddress & bd_addr,bool is_direct)50 bool GATT_CancelConnect(tGATT_IF gatt_if, const RawAddress& bd_addr,
51                         bool is_direct) {
52   mock_function_count_map[__func__]++;
53   return false;
54 }
GATT_Connect(tGATT_IF gatt_if,const RawAddress & bd_addr,bool is_direct,tBT_TRANSPORT transport,bool opportunistic)55 bool GATT_Connect(tGATT_IF gatt_if, const RawAddress& bd_addr, bool is_direct,
56                   tBT_TRANSPORT transport, bool opportunistic) {
57   mock_function_count_map[__func__]++;
58   return false;
59 }
GATT_Connect(tGATT_IF gatt_if,const RawAddress & bd_addr,bool is_direct,tBT_TRANSPORT transport,bool opportunistic,uint8_t initiating_phys)60 bool GATT_Connect(tGATT_IF gatt_if, const RawAddress& bd_addr, bool is_direct,
61                   tBT_TRANSPORT transport, bool opportunistic,
62                   uint8_t initiating_phys) {
63   mock_function_count_map[__func__]++;
64   return false;
65 }
GATT_GetConnIdIfConnected(tGATT_IF gatt_if,const RawAddress & bd_addr,uint16_t * p_conn_id,tBT_TRANSPORT transport)66 bool GATT_GetConnIdIfConnected(tGATT_IF gatt_if, const RawAddress& bd_addr,
67                                uint16_t* p_conn_id, tBT_TRANSPORT transport) {
68   mock_function_count_map[__func__]++;
69   return false;
70 }
GATT_GetConnectionInfor(uint16_t conn_id,tGATT_IF * p_gatt_if,RawAddress & bd_addr,tBT_TRANSPORT * p_transport)71 bool GATT_GetConnectionInfor(uint16_t conn_id, tGATT_IF* p_gatt_if,
72                              RawAddress& bd_addr, tBT_TRANSPORT* p_transport) {
73   mock_function_count_map[__func__]++;
74   return false;
75 }
is_active_service(const Uuid & app_uuid128,Uuid * p_svc_uuid,uint16_t start_handle)76 bool is_active_service(const Uuid& app_uuid128, Uuid* p_svc_uuid,
77                        uint16_t start_handle) {
78   mock_function_count_map[__func__]++;
79   return false;
80 }
gatt_add_an_item_to_list(uint16_t s_handle)81 tGATT_HDL_LIST_ELEM& gatt_add_an_item_to_list(uint16_t s_handle) {
82   mock_function_count_map[__func__]++;
83   return elem;
84 }
GATT_Register(const Uuid & app_uuid128,std::string name,tGATT_CBACK * p_cb_info,bool eatt_support)85 tGATT_IF GATT_Register(const Uuid& app_uuid128, std::string name,
86                        tGATT_CBACK* p_cb_info, bool eatt_support) {
87   mock_function_count_map[__func__]++;
88   return 0;
89 }
GATTC_ConfigureMTU(uint16_t conn_id,uint16_t mtu)90 tGATT_STATUS GATTC_ConfigureMTU(uint16_t conn_id, uint16_t mtu) {
91   mock_function_count_map[__func__]++;
92   return GATT_SUCCESS;
93 }
GATTC_Discover(uint16_t conn_id,tGATT_DISC_TYPE disc_type,uint16_t start_handle,uint16_t end_handle)94 tGATT_STATUS GATTC_Discover(uint16_t conn_id, tGATT_DISC_TYPE disc_type,
95                             uint16_t start_handle, uint16_t end_handle) {
96   mock_function_count_map[__func__]++;
97   return GATT_SUCCESS;
98 }
GATTC_Discover(uint16_t conn_id,tGATT_DISC_TYPE disc_type,uint16_t start_handle,uint16_t end_handle,const Uuid & uuid)99 tGATT_STATUS GATTC_Discover(uint16_t conn_id, tGATT_DISC_TYPE disc_type,
100                             uint16_t start_handle, uint16_t end_handle,
101                             const Uuid& uuid) {
102   mock_function_count_map[__func__]++;
103   return GATT_SUCCESS;
104 }
GATTC_ExecuteWrite(uint16_t conn_id,bool is_execute)105 tGATT_STATUS GATTC_ExecuteWrite(uint16_t conn_id, bool is_execute) {
106   mock_function_count_map[__func__]++;
107   return GATT_SUCCESS;
108 }
GATTC_Read(uint16_t conn_id,tGATT_READ_TYPE type,tGATT_READ_PARAM * p_read)109 tGATT_STATUS GATTC_Read(uint16_t conn_id, tGATT_READ_TYPE type,
110                         tGATT_READ_PARAM* p_read) {
111   mock_function_count_map[__func__]++;
112   return GATT_SUCCESS;
113 }
GATTC_SendHandleValueConfirm(uint16_t conn_id,uint16_t cid)114 tGATT_STATUS GATTC_SendHandleValueConfirm(uint16_t conn_id, uint16_t cid) {
115   mock_function_count_map[__func__]++;
116   return GATT_SUCCESS;
117 }
GATTC_Write(uint16_t conn_id,tGATT_WRITE_TYPE type,tGATT_VALUE * p_write)118 tGATT_STATUS GATTC_Write(uint16_t conn_id, tGATT_WRITE_TYPE type,
119                          tGATT_VALUE* p_write) {
120   mock_function_count_map[__func__]++;
121   return GATT_SUCCESS;
122 }
GATTS_AddService(tGATT_IF gatt_if,btgatt_db_element_t * service,int count)123 tGATT_STATUS GATTS_AddService(tGATT_IF gatt_if, btgatt_db_element_t* service,
124                               int count) {
125   mock_function_count_map[__func__]++;
126   return GATT_SUCCESS;
127 }
GATTS_HandleValueIndication(uint16_t conn_id,uint16_t attr_handle,uint16_t val_len,uint8_t * p_val)128 tGATT_STATUS GATTS_HandleValueIndication(uint16_t conn_id, uint16_t attr_handle,
129                                          uint16_t val_len, uint8_t* p_val) {
130   mock_function_count_map[__func__]++;
131   return GATT_SUCCESS;
132 }
GATTS_HandleValueNotification(uint16_t conn_id,uint16_t attr_handle,uint16_t val_len,uint8_t * p_val)133 tGATT_STATUS GATTS_HandleValueNotification(uint16_t conn_id,
134                                            uint16_t attr_handle,
135                                            uint16_t val_len, uint8_t* p_val) {
136   mock_function_count_map[__func__]++;
137   return GATT_SUCCESS;
138 }
GATTS_SendRsp(uint16_t conn_id,uint32_t trans_id,tGATT_STATUS status,tGATTS_RSP * p_msg)139 tGATT_STATUS GATTS_SendRsp(uint16_t conn_id, uint32_t trans_id,
140                            tGATT_STATUS status, tGATTS_RSP* p_msg) {
141   mock_function_count_map[__func__]++;
142   return GATT_SUCCESS;
143 }
GATT_Disconnect(uint16_t conn_id)144 tGATT_STATUS GATT_Disconnect(uint16_t conn_id) {
145   mock_function_count_map[__func__]++;
146   return GATT_SUCCESS;
147 }
GATTS_AddHandleRange(tGATTS_HNDL_RANGE * p_hndl_range)148 void GATTS_AddHandleRange(tGATTS_HNDL_RANGE* p_hndl_range) {
149   mock_function_count_map[__func__]++;
150 }
GATTS_StopService(uint16_t service_handle)151 void GATTS_StopService(uint16_t service_handle) {
152   mock_function_count_map[__func__]++;
153 }
GATT_Deregister(tGATT_IF gatt_if)154 void GATT_Deregister(tGATT_IF gatt_if) { mock_function_count_map[__func__]++; }
GATT_SetIdleTimeout(const RawAddress & bd_addr,uint16_t idle_tout,tBT_TRANSPORT transport)155 void GATT_SetIdleTimeout(const RawAddress& bd_addr, uint16_t idle_tout,
156                          tBT_TRANSPORT transport) {
157   mock_function_count_map[__func__]++;
158 }
GATT_StartIf(tGATT_IF gatt_if)159 void GATT_StartIf(tGATT_IF gatt_if) { mock_function_count_map[__func__]++; }
160