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:10 20 * 21 * mockcify.pl ver 0.3.0 22 */ 23 24 #include <cstdint> 25 #include <functional> 26 27 // Original included files, if any 28 #include "bta/hh/bta_hh_int.h" 29 #include "types/raw_address.h" 30 31 // Mocked compile conditionals, if any 32 33 namespace test { 34 namespace mock { 35 namespace bta_hh_utils { 36 37 // Shared state between mocked functions and tests 38 // Name: bta_hh_add_device_to_list 39 // Params: tBTA_HH_DEV_CB* p_cb, uint8_t handle, uint16_t attr_mask, const 40 // tHID_DEV_DSCP_INFO* p_dscp_info, uint8_t sub_class, uint16_t ssr_max_latency, 41 // uint16_t ssr_min_tout, uint8_t app_id Return: void 42 struct bta_hh_add_device_to_list { 43 std::function<void(tBTA_HH_DEV_CB* p_cb, uint8_t handle, uint16_t attr_mask, 44 const tHID_DEV_DSCP_INFO* p_dscp_info, uint8_t sub_class, 45 uint16_t ssr_max_latency, uint16_t ssr_min_tout, 46 uint8_t app_id)> 47 body{[](tBTA_HH_DEV_CB* /* p_cb */, uint8_t /* handle */, 48 uint16_t /* attr_mask */, 49 const tHID_DEV_DSCP_INFO* /* p_dscp_info */, 50 uint8_t /* sub_class */, uint16_t /* ssr_max_latency */, 51 uint16_t /* ssr_min_tout */, uint8_t /* app_id */) {}}; operatorbta_hh_add_device_to_list52 void operator()(tBTA_HH_DEV_CB* p_cb, uint8_t handle, uint16_t attr_mask, 53 const tHID_DEV_DSCP_INFO* p_dscp_info, uint8_t sub_class, 54 uint16_t ssr_max_latency, uint16_t ssr_min_tout, 55 uint8_t app_id) { 56 body(p_cb, handle, attr_mask, p_dscp_info, sub_class, ssr_max_latency, 57 ssr_min_tout, app_id); 58 }; 59 }; 60 extern struct bta_hh_add_device_to_list bta_hh_add_device_to_list; 61 62 // Name: bta_hh_clean_up_kdev 63 // Params: tBTA_HH_DEV_CB* p_cb 64 // Return: void 65 struct bta_hh_clean_up_kdev { 66 std::function<void(tBTA_HH_DEV_CB* p_cb)> body{ 67 [](tBTA_HH_DEV_CB* /* p_cb */) {}}; operatorbta_hh_clean_up_kdev68 void operator()(tBTA_HH_DEV_CB* p_cb) { body(p_cb); }; 69 }; 70 extern struct bta_hh_clean_up_kdev bta_hh_clean_up_kdev; 71 72 // Name: bta_hh_cleanup_disable 73 // Params: tBTA_HH_STATUS status 74 // Return: void 75 struct bta_hh_cleanup_disable { 76 std::function<void(tBTA_HH_STATUS status)> body{ 77 [](tBTA_HH_STATUS /* status */) {}}; operatorbta_hh_cleanup_disable78 void operator()(tBTA_HH_STATUS status) { body(status); }; 79 }; 80 extern struct bta_hh_cleanup_disable bta_hh_cleanup_disable; 81 82 // Name: bta_hh_dev_handle_to_cb_idx 83 // Params: uint8_t dev_handle 84 // Return: uint8_t 85 struct bta_hh_dev_handle_to_cb_idx { 86 uint8_t return_value{0}; 87 std::function<uint8_t(uint8_t dev_handle)> body{ 88 [this](uint8_t /* dev_handle */) { return return_value; }}; operatorbta_hh_dev_handle_to_cb_idx89 uint8_t operator()(uint8_t dev_handle) { return body(dev_handle); }; 90 }; 91 extern struct bta_hh_dev_handle_to_cb_idx bta_hh_dev_handle_to_cb_idx; 92 93 // Name: bta_hh_find_cb 94 // Params: const tAclLinkSpec& link_spec 95 // Return: uint8_t 96 struct bta_hh_find_cb { 97 uint8_t return_value{0}; 98 std::function<uint8_t(const tAclLinkSpec& link_spec)> body{ 99 [this](const tAclLinkSpec& /* link_spec */) { return return_value; }}; operatorbta_hh_find_cb100 uint8_t operator()(const tAclLinkSpec& link_spec) { return body(link_spec); }; 101 }; 102 extern struct bta_hh_find_cb bta_hh_find_cb; 103 104 // Name: bta_hh_get_cb 105 // Params: const tAclLinkSpec& link_spec 106 // Return: tBTA_HH_DEV_CB* 107 struct bta_hh_get_cb { 108 tBTA_HH_DEV_CB* return_value{0}; 109 std::function<tBTA_HH_DEV_CB*(const tAclLinkSpec& link_spec)> body{ 110 [this](const tAclLinkSpec& /* link_spec */) { return return_value; }}; operatorbta_hh_get_cb111 tBTA_HH_DEV_CB* operator()(const tAclLinkSpec& link_spec) { 112 return body(link_spec); 113 }; 114 }; 115 extern struct bta_hh_get_cb bta_hh_get_cb; 116 117 // Name: bta_hh_read_ssr_param 118 // Params: const tAclLinkSpec& bd_addr, uint16_t* p_max_ssr_lat, uint16_t* 119 // p_min_ssr_tout Return: tBTA_HH_STATUS 120 struct bta_hh_read_ssr_param { 121 tBTA_HH_STATUS return_value{0}; 122 std::function<tBTA_HH_STATUS(const tAclLinkSpec& link_spec, 123 uint16_t* p_max_ssr_lat, 124 uint16_t* p_min_ssr_tout)> 125 body{[this](const tAclLinkSpec& /* link_spec */, 126 uint16_t* /* p_max_ssr_lat */, 127 uint16_t* /* p_min_ssr_tout */) { return return_value; }}; operatorbta_hh_read_ssr_param128 tBTA_HH_STATUS operator()(const tAclLinkSpec& link_spec, 129 uint16_t* p_max_ssr_lat, uint16_t* p_min_ssr_tout) { 130 return body(link_spec, p_max_ssr_lat, p_min_ssr_tout); 131 }; 132 }; 133 extern struct bta_hh_read_ssr_param bta_hh_read_ssr_param; 134 135 // Name: bta_hh_tod_spt 136 // Params: tBTA_HH_DEV_CB* p_cb, uint8_t sub_class 137 // Return: bool 138 struct bta_hh_tod_spt { 139 bool return_value{false}; 140 std::function<bool(tBTA_HH_DEV_CB* p_cb, uint8_t sub_class)> body{ 141 [this](tBTA_HH_DEV_CB* /* p_cb */, uint8_t /* sub_class */) { 142 return return_value; 143 }}; operatorbta_hh_tod_spt144 bool operator()(tBTA_HH_DEV_CB* p_cb, uint8_t sub_class) { 145 return body(p_cb, sub_class); 146 }; 147 }; 148 extern struct bta_hh_tod_spt bta_hh_tod_spt; 149 150 // Name: bta_hh_trace_dev_db 151 // Params: void 152 // Return: void 153 struct bta_hh_trace_dev_db { 154 std::function<void(void)> body{[](void) {}}; operatorbta_hh_trace_dev_db155 void operator()(void) { body(); }; 156 }; 157 extern struct bta_hh_trace_dev_db bta_hh_trace_dev_db; 158 159 // Name: bta_hh_update_di_info 160 // Params: tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id, uint16_t product_id, 161 // uint16_t version, uint8_t flag Return: void 162 struct bta_hh_update_di_info { 163 std::function<void(tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id, 164 uint16_t product_id, uint16_t version, uint8_t flag, 165 uint8_t ctry_code)> 166 body{[](tBTA_HH_DEV_CB* /* p_cb */, uint16_t /* vendor_id */, 167 uint16_t /* product_id */, uint16_t /* version */, 168 uint8_t /* flag */, uint8_t /* ctry_code */) {}}; operatorbta_hh_update_di_info169 void operator()(tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id, uint16_t product_id, 170 uint16_t version, uint8_t flag, uint8_t ctry_code) { 171 body(p_cb, vendor_id, product_id, version, flag, ctry_code); 172 }; 173 }; 174 extern struct bta_hh_update_di_info bta_hh_update_di_info; 175 176 // Name: bta_hh_le_is_hh_gatt_if 177 // Params: tGATT_IF client_if 178 // Return: bool 179 struct bta_hh_le_is_hh_gatt_if { 180 bool return_value{false}; 181 std::function<bool(tGATT_IF client_if)> body{ 182 [this](tGATT_IF /* client_if */) { return return_value; }}; operatorbta_hh_le_is_hh_gatt_if183 bool operator()(tGATT_IF client_if) { return body(client_if); }; 184 }; 185 extern struct bta_hh_le_is_hh_gatt_if bta_hh_le_is_hh_gatt_if; 186 187 } // namespace bta_hh_utils 188 } // namespace mock 189 } // namespace test 190 191 // END mockcify generation 192