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, tPAN_ROLE dst_role, 43 uint16_t* handle)> 44 body{[](const RawAddress& /* rem_bda */, tPAN_ROLE /* src_role */, 45 tPAN_ROLE /* dst_role */, uint16_t* /* handle */) { return PAN_SUCCESS; }}; operatorPAN_Connect46 tPAN_RESULT operator()(const RawAddress& rem_bda, tPAN_ROLE src_role, tPAN_ROLE dst_role, 47 uint16_t* handle) { 48 return body(rem_bda, src_role, dst_role, handle); 49 } 50 }; 51 extern struct PAN_Connect PAN_Connect; 52 // Name: PAN_Disconnect 53 // Params: uint16_t handle 54 // Returns: tPAN_RESULT 55 struct PAN_Disconnect { 56 std::function<tPAN_RESULT(uint16_t handle)> body{ 57 [](uint16_t /* handle */) { return PAN_SUCCESS; }}; operatorPAN_Disconnect58 tPAN_RESULT operator()(uint16_t handle) { return body(handle); } 59 }; 60 extern struct PAN_Disconnect PAN_Disconnect; 61 // Name: PAN_SetMulticastFilters 62 // Params: uint16_t handle, uint16_t num_mcast_filters, uint8_t* p_start_array, 63 // uint8_t* p_end_array Returns: tPAN_RESULT 64 struct PAN_SetMulticastFilters { 65 std::function<tPAN_RESULT(uint16_t handle, uint16_t num_mcast_filters, uint8_t* p_start_array, 66 uint8_t* p_end_array)> 67 body{[](uint16_t /* handle */, uint16_t /* num_mcast_filters */, 68 uint8_t* /* p_start_array */, 69 uint8_t* /* p_end_array */) { return PAN_SUCCESS; }}; operatorPAN_SetMulticastFilters70 tPAN_RESULT operator()(uint16_t handle, uint16_t num_mcast_filters, uint8_t* p_start_array, 71 uint8_t* p_end_array) { 72 return body(handle, num_mcast_filters, p_start_array, p_end_array); 73 } 74 }; 75 extern struct PAN_SetMulticastFilters PAN_SetMulticastFilters; 76 // Name: PAN_SetProtocolFilters 77 // Params: uint16_t handle, uint16_t num_filters, uint16_t* p_start_array, 78 // uint16_t* p_end_array Returns: tPAN_RESULT 79 struct PAN_SetProtocolFilters { 80 std::function<tPAN_RESULT(uint16_t handle, uint16_t num_filters, uint16_t* p_start_array, 81 uint16_t* p_end_array)> 82 body{[](uint16_t /* handle */, uint16_t /* num_filters */, uint16_t* /* p_start_array */, 83 uint16_t* /* p_end_array */) { return PAN_SUCCESS; }}; operatorPAN_SetProtocolFilters84 tPAN_RESULT operator()(uint16_t handle, uint16_t num_filters, uint16_t* p_start_array, 85 uint16_t* p_end_array) { 86 return body(handle, num_filters, p_start_array, p_end_array); 87 } 88 }; 89 extern struct PAN_SetProtocolFilters PAN_SetProtocolFilters; 90 // Name: PAN_SetRole 91 // Params: uint8_t role, const std::string p_user_name, const std::string 92 // p_nap_name Returns: tPAN_RESULT 93 struct PAN_SetRole { 94 std::function<tPAN_RESULT(uint8_t role, std::string p_user_name, std::string p_nap_name)> body{ 95 [](uint8_t /* role */, std::string /* p_user_name */, std::string /* p_nap_name */) { 96 return PAN_SUCCESS; 97 }}; operatorPAN_SetRole98 tPAN_RESULT operator()(uint8_t role, std::string p_user_name, std::string p_nap_name) { 99 return body(role, p_user_name, p_nap_name); 100 } 101 }; 102 extern struct PAN_SetRole PAN_SetRole; 103 // Name: PAN_Write 104 // Params: uint16_t handle, const RawAddress& dst, const RawAddress& src, 105 // uint16_t protocol, uint8_t* p_data, uint16_t len, bool ext Returns: 106 // tPAN_RESULT 107 struct PAN_Write { 108 std::function<tPAN_RESULT(uint16_t handle, const RawAddress& dst, const RawAddress& src, 109 uint16_t protocol, uint8_t* p_data, uint16_t len, bool ext)> 110 body{[](uint16_t /* handle */, const RawAddress& /* dst */, const RawAddress& /* src */, 111 uint16_t /* protocol */, uint8_t* /* p_data */, uint16_t /* len */, 112 bool /* ext */) { return PAN_SUCCESS; }}; operatorPAN_Write113 tPAN_RESULT operator()(uint16_t handle, const RawAddress& dst, const RawAddress& src, 114 uint16_t protocol, uint8_t* p_data, uint16_t len, bool ext) { 115 return body(handle, dst, src, protocol, p_data, len, ext); 116 } 117 }; 118 extern struct PAN_Write PAN_Write; 119 // Name: PAN_WriteBuf 120 // Params: uint16_t handle, const RawAddress& dst, const RawAddress& src, 121 // uint16_t protocol, BT_HDR* p_buf, bool ext Returns: tPAN_RESULT 122 struct PAN_WriteBuf { 123 std::function<tPAN_RESULT(uint16_t handle, const RawAddress& dst, const RawAddress& src, 124 uint16_t protocol, BT_HDR* p_buf, bool ext)> 125 body{[](uint16_t /* handle */, const RawAddress& /* dst */, const RawAddress& /* src */, 126 uint16_t /* protocol */, BT_HDR* /* p_buf */, 127 bool /* ext */) { return PAN_SUCCESS; }}; operatorPAN_WriteBuf128 tPAN_RESULT operator()(uint16_t handle, const RawAddress& dst, const RawAddress& src, 129 uint16_t protocol, BT_HDR* p_buf, bool ext) { 130 return body(handle, dst, src, protocol, p_buf, ext); 131 } 132 }; 133 extern struct PAN_WriteBuf PAN_WriteBuf; 134 // Name: PAN_Deregister 135 // Params: void 136 // Returns: void 137 struct PAN_Deregister { 138 std::function<void(void)> body{[](void) { ; }}; operatorPAN_Deregister139 void operator()(void) { body(); } 140 }; 141 extern struct PAN_Deregister PAN_Deregister; 142 // Name: PAN_Dumpsys 143 // Params: int fd 144 // Returns: void 145 struct PAN_Dumpsys { 146 std::function<void(int fd)> body{[](int /* fd */) { ; }}; operatorPAN_Dumpsys147 void operator()(int fd) { body(fd); } 148 }; 149 extern struct PAN_Dumpsys PAN_Dumpsys; 150 // Name: PAN_Init 151 // Params: void 152 // Returns: void 153 struct PAN_Init { 154 std::function<void(void)> body{[](void) { ; }}; operatorPAN_Init155 void operator()(void) { body(); } 156 }; 157 extern struct PAN_Init PAN_Init; 158 // Name: PAN_Register 159 // Params: tPAN_REGISTER* p_register 160 // Returns: void 161 struct PAN_Register { 162 std::function<void(tPAN_REGISTER* p_register)> body{[](tPAN_REGISTER* /* p_register */) { ; }}; operatorPAN_Register163 void operator()(tPAN_REGISTER* p_register) { body(p_register); } 164 }; 165 extern struct PAN_Register PAN_Register; 166 167 } // namespace stack_pan_api 168 } // namespace mock 169 } // namespace test 170 171 // END mockcify generation 172