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:20
20 */
21
22 #include <map>
23 #include <string>
24
25 extern std::map<std::string, int> mock_function_count_map;
26
27 #include <base/logging.h>
28 #include <string.h>
29 #include "bt_common.h"
30 #include "l2c_api.h"
31 #include "osi/include/log.h"
32 #include "osi/include/mutex.h"
33 #include "port_api.h"
34 #include "rfcdefs.h"
35 #include "sdp_api.h"
36 #include "stack/include/btm_api_types.h"
37 #include "stack/rfcomm/port_int.h"
38 #include "stack/rfcomm/rfc_int.h"
39
40 #ifndef UNUSED_ATTR
41 #define UNUSED_ATTR
42 #endif
43
PORT_IsOpening(RawAddress * bd_addr)44 bool PORT_IsOpening(RawAddress* bd_addr) {
45 mock_function_count_map[__func__]++;
46 return false;
47 }
PORT_GetResultString(const uint8_t result_code)48 const char* PORT_GetResultString(const uint8_t result_code) {
49 mock_function_count_map[__func__]++;
50 return nullptr;
51 }
PORT_CheckConnection(uint16_t handle,RawAddress * bd_addr,uint16_t * p_lcid)52 int PORT_CheckConnection(uint16_t handle, RawAddress* bd_addr,
53 uint16_t* p_lcid) {
54 mock_function_count_map[__func__]++;
55 return 0;
56 }
PORT_ClearKeepHandleFlag(uint16_t port_handle)57 int PORT_ClearKeepHandleFlag(uint16_t port_handle) {
58 mock_function_count_map[__func__]++;
59 return 0;
60 }
PORT_FlowControl_MaxCredit(uint16_t handle,bool enable)61 int PORT_FlowControl_MaxCredit(uint16_t handle, bool enable) {
62 mock_function_count_map[__func__]++;
63 return 0;
64 }
PORT_GetState(uint16_t handle,tPORT_STATE * p_settings)65 int PORT_GetState(uint16_t handle, tPORT_STATE* p_settings) {
66 mock_function_count_map[__func__]++;
67 return 0;
68 }
PORT_ReadData(uint16_t handle,char * p_data,uint16_t max_len,uint16_t * p_len)69 int PORT_ReadData(uint16_t handle, char* p_data, uint16_t max_len,
70 uint16_t* p_len) {
71 mock_function_count_map[__func__]++;
72 return 0;
73 }
PORT_SetDataCOCallback(uint16_t port_handle,tPORT_DATA_CO_CALLBACK * p_port_cb)74 int PORT_SetDataCOCallback(uint16_t port_handle,
75 tPORT_DATA_CO_CALLBACK* p_port_cb) {
76 mock_function_count_map[__func__]++;
77 return 0;
78 }
PORT_SetEventCallback(uint16_t port_handle,tPORT_CALLBACK * p_port_cb)79 int PORT_SetEventCallback(uint16_t port_handle, tPORT_CALLBACK* p_port_cb) {
80 mock_function_count_map[__func__]++;
81 return 0;
82 }
PORT_SetEventMask(uint16_t port_handle,uint32_t mask)83 int PORT_SetEventMask(uint16_t port_handle, uint32_t mask) {
84 mock_function_count_map[__func__]++;
85 return 0;
86 }
PORT_SetState(uint16_t handle,tPORT_STATE * p_settings)87 int PORT_SetState(uint16_t handle, tPORT_STATE* p_settings) {
88 mock_function_count_map[__func__]++;
89 return 0;
90 }
PORT_WriteData(uint16_t handle,const char * p_data,uint16_t max_len,uint16_t * p_len)91 int PORT_WriteData(uint16_t handle, const char* p_data, uint16_t max_len,
92 uint16_t* p_len) {
93 mock_function_count_map[__func__]++;
94 return 0;
95 }
PORT_WriteDataCO(uint16_t handle,int * p_len)96 int PORT_WriteDataCO(uint16_t handle, int* p_len) {
97 mock_function_count_map[__func__]++;
98 return 0;
99 }
RFCOMM_CreateConnection(uint16_t uuid,uint8_t scn,bool is_server,uint16_t mtu,const RawAddress & bd_addr,uint16_t * p_handle,tPORT_CALLBACK * p_mgmt_cb)100 int RFCOMM_CreateConnection(uint16_t uuid, uint8_t scn, bool is_server,
101 uint16_t mtu, const RawAddress& bd_addr,
102 uint16_t* p_handle, tPORT_CALLBACK* p_mgmt_cb) {
103 mock_function_count_map[__func__]++;
104 return 0;
105 }
RFCOMM_CreateConnectionWithSecurity(uint16_t uuid,uint8_t scn,bool is_server,uint16_t mtu,const RawAddress & bd_addr,uint16_t * p_handle,tPORT_CALLBACK * p_mgmt_cb,uint16_t sec_mask)106 int RFCOMM_CreateConnectionWithSecurity(uint16_t uuid, uint8_t scn,
107 bool is_server, uint16_t mtu,
108 const RawAddress& bd_addr,
109 uint16_t* p_handle,
110 tPORT_CALLBACK* p_mgmt_cb,
111 uint16_t sec_mask) {
112 mock_function_count_map[__func__]++;
113 return 0;
114 }
RFCOMM_RemoveConnection(uint16_t handle)115 int RFCOMM_RemoveConnection(uint16_t handle) {
116 mock_function_count_map[__func__]++;
117 return 0;
118 }
RFCOMM_RemoveServer(uint16_t handle)119 int RFCOMM_RemoveServer(uint16_t handle) {
120 mock_function_count_map[__func__]++;
121 return 0;
122 }
PORT_SetTraceLevel(uint8_t new_level)123 uint8_t PORT_SetTraceLevel(uint8_t new_level) {
124 mock_function_count_map[__func__]++;
125 return 0;
126 }
RFCOMM_ClearSecurityRecord(uint32_t scn)127 void RFCOMM_ClearSecurityRecord(uint32_t scn) {
128 mock_function_count_map[__func__]++;
129 }
RFCOMM_Init(void)130 void RFCOMM_Init(void) { mock_function_count_map[__func__]++; }
131