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:12
20  *
21  *  mockcify.pl ver 0.2.1
22  */
23 
24 #include <cstdint>
25 #include <functional>
26 #include <string>
27 
28 // Original included files, if any
29 #include "stack/include/pan_api.h"
30 #include "types/raw_address.h"
31 
32 // Mocked compile conditionals, if any
33 namespace test {
34 namespace mock {
35 namespace stack_pan_api {
36 
37 // Shared state between mocked functions and tests
38 // Name: PAN_Connect
39 // Params: const RawAddress& rem_bda, tPAN_ROLE src_role, tPAN_ROLE dst_role,
40 // uint16_t* handle Returns: tPAN_RESULT
41 struct PAN_Connect {
42   std::function<tPAN_RESULT(const RawAddress& rem_bda, tPAN_ROLE src_role,
43                             tPAN_ROLE dst_role, uint16_t* handle)>
44       body{[](const RawAddress& /* rem_bda */, tPAN_ROLE /* src_role */,
45               tPAN_ROLE /* dst_role */,
46               uint16_t* /* handle */) { return PAN_SUCCESS; }};
operatorPAN_Connect47   tPAN_RESULT operator()(const RawAddress& rem_bda, tPAN_ROLE src_role,
48                          tPAN_ROLE dst_role, uint16_t* handle) {
49     return body(rem_bda, src_role, dst_role, handle);
50   };
51 };
52 extern struct PAN_Connect PAN_Connect;
53 // Name: PAN_Disconnect
54 // Params: uint16_t handle
55 // Returns: tPAN_RESULT
56 struct PAN_Disconnect {
57   std::function<tPAN_RESULT(uint16_t handle)> body{
58       [](uint16_t /* handle */) { return PAN_SUCCESS; }};
operatorPAN_Disconnect59   tPAN_RESULT operator()(uint16_t handle) { return body(handle); };
60 };
61 extern struct PAN_Disconnect PAN_Disconnect;
62 // Name: PAN_SetMulticastFilters
63 // Params: uint16_t handle, uint16_t num_mcast_filters, uint8_t* p_start_array,
64 // uint8_t* p_end_array Returns: tPAN_RESULT
65 struct PAN_SetMulticastFilters {
66   std::function<tPAN_RESULT(uint16_t handle, uint16_t num_mcast_filters,
67                             uint8_t* p_start_array, uint8_t* p_end_array)>
68       body{[](uint16_t /* handle */, uint16_t /* num_mcast_filters */,
69               uint8_t* /* p_start_array */,
70               uint8_t* /* p_end_array */) { return PAN_SUCCESS; }};
operatorPAN_SetMulticastFilters71   tPAN_RESULT operator()(uint16_t handle, uint16_t num_mcast_filters,
72                          uint8_t* p_start_array, uint8_t* p_end_array) {
73     return body(handle, num_mcast_filters, p_start_array, p_end_array);
74   };
75 };
76 extern struct PAN_SetMulticastFilters PAN_SetMulticastFilters;
77 // Name: PAN_SetProtocolFilters
78 // Params: uint16_t handle, uint16_t num_filters, uint16_t* p_start_array,
79 // uint16_t* p_end_array Returns: tPAN_RESULT
80 struct PAN_SetProtocolFilters {
81   std::function<tPAN_RESULT(uint16_t handle, uint16_t num_filters,
82                             uint16_t* p_start_array, uint16_t* p_end_array)>
83       body{[](uint16_t /* handle */, uint16_t /* num_filters */,
84               uint16_t* /* p_start_array */,
85               uint16_t* /* p_end_array */) { return PAN_SUCCESS; }};
operatorPAN_SetProtocolFilters86   tPAN_RESULT operator()(uint16_t handle, uint16_t num_filters,
87                          uint16_t* p_start_array, uint16_t* p_end_array) {
88     return body(handle, num_filters, p_start_array, p_end_array);
89   };
90 };
91 extern struct PAN_SetProtocolFilters PAN_SetProtocolFilters;
92 // Name: PAN_SetRole
93 // Params: uint8_t role, const std::string p_user_name, const std::string
94 // p_nap_name Returns: tPAN_RESULT
95 struct PAN_SetRole {
96   std::function<tPAN_RESULT(uint8_t role, std::string p_user_name,
97                             std::string p_nap_name)>
98       body{[](uint8_t /* role */, std::string /* p_user_name */,
99               std::string /* p_nap_name */) { return PAN_SUCCESS; }};
operatorPAN_SetRole100   tPAN_RESULT operator()(uint8_t role, std::string p_user_name,
101                          std::string p_nap_name) {
102     return body(role, p_user_name, p_nap_name);
103   };
104 };
105 extern struct PAN_SetRole PAN_SetRole;
106 // Name: PAN_Write
107 // Params: uint16_t handle, const RawAddress& dst, const RawAddress& src,
108 // uint16_t protocol, uint8_t* p_data, uint16_t len, bool ext Returns:
109 // tPAN_RESULT
110 struct PAN_Write {
111   std::function<tPAN_RESULT(uint16_t handle, const RawAddress& dst,
112                             const RawAddress& src, uint16_t protocol,
113                             uint8_t* p_data, uint16_t len, bool ext)>
114       body{[](uint16_t /* handle */, const RawAddress& /* dst */,
115               const RawAddress& /* src */, uint16_t /* protocol */,
116               uint8_t* /* p_data */, uint16_t /* len */,
117               bool /* ext */) { return PAN_SUCCESS; }};
operatorPAN_Write118   tPAN_RESULT operator()(uint16_t handle, const RawAddress& dst,
119                          const RawAddress& src, uint16_t protocol,
120                          uint8_t* p_data, uint16_t len, bool ext) {
121     return body(handle, dst, src, protocol, p_data, len, ext);
122   };
123 };
124 extern struct PAN_Write PAN_Write;
125 // Name: PAN_WriteBuf
126 // Params: uint16_t handle, const RawAddress& dst, const RawAddress& src,
127 // uint16_t protocol, BT_HDR* p_buf, bool ext Returns: tPAN_RESULT
128 struct PAN_WriteBuf {
129   std::function<tPAN_RESULT(uint16_t handle, const RawAddress& dst,
130                             const RawAddress& src, uint16_t protocol,
131                             BT_HDR* p_buf, bool ext)>
132       body{[](uint16_t /* handle */, const RawAddress& /* dst */,
133               const RawAddress& /* src */, uint16_t /* protocol */,
134               BT_HDR* /* p_buf */, bool /* ext */) { return PAN_SUCCESS; }};
operatorPAN_WriteBuf135   tPAN_RESULT operator()(uint16_t handle, const RawAddress& dst,
136                          const RawAddress& src, uint16_t protocol,
137                          BT_HDR* p_buf, bool ext) {
138     return body(handle, dst, src, protocol, p_buf, ext);
139   };
140 };
141 extern struct PAN_WriteBuf PAN_WriteBuf;
142 // Name: PAN_Deregister
143 // Params: void
144 // Returns: void
145 struct PAN_Deregister {
146   std::function<void(void)> body{[](void) { ; }};
operatorPAN_Deregister147   void operator()(void) { body(); };
148 };
149 extern struct PAN_Deregister PAN_Deregister;
150 // Name: PAN_Dumpsys
151 // Params: int fd
152 // Returns: void
153 struct PAN_Dumpsys {
154   std::function<void(int fd)> body{[](int /* fd */) { ; }};
operatorPAN_Dumpsys155   void operator()(int fd) { body(fd); };
156 };
157 extern struct PAN_Dumpsys PAN_Dumpsys;
158 // Name: PAN_Init
159 // Params: void
160 // Returns: void
161 struct PAN_Init {
162   std::function<void(void)> body{[](void) { ; }};
operatorPAN_Init163   void operator()(void) { body(); };
164 };
165 extern struct PAN_Init PAN_Init;
166 // Name: PAN_Register
167 // Params: tPAN_REGISTER* p_register
168 // Returns: void
169 struct PAN_Register {
170   std::function<void(tPAN_REGISTER* p_register)> body{
171       [](tPAN_REGISTER* /* p_register */) { ; }};
operatorPAN_Register172   void operator()(tPAN_REGISTER* p_register) { body(p_register); };
173 };
174 extern struct PAN_Register PAN_Register;
175 
176 }  // namespace stack_pan_api
177 }  // namespace mock
178 }  // namespace test
179 
180 // END mockcify generation
181