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:5 20 * 21 * mockcify.pl ver 0.2 22 */ 23 24 #include <map> 25 #include <string> 26 27 // Original included files, if any 28 // NOTE: Since this is a mock file with mock definitions some number of 29 // include files may not be required. The include-what-you-use 30 // still applies, but crafting proper inclusion is out of scope 31 // for this effort. This compilation unit may compile as-is, or 32 // may need attention to prune the inclusion set. 33 #include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h> 34 #include <frameworks/proto_logging/stats/enums/bluetooth/hci/enums.pb.h> 35 36 #include "test/common/mock_functions.h" 37 38 // Mocked compile conditionals, if any 39 #ifndef UNUSED_ATTR 40 #define UNUSED_ATTR 41 #endif 42 43 namespace test { 44 namespace mock { 45 namespace stack_metrics_logging { 46 47 // Shared state between mocked functions and tests 48 // Name: log_classic_pairing_event 49 // Params: const RawAddress& address, uint16_t handle, uint32_t hci_cmd, 50 // uint16_t hci_event, uint16_t cmd_status, uint16_t reason_code, int64_t 51 // event_value Returns: void 52 struct log_classic_pairing_event { 53 std::function<void(const RawAddress& address, uint16_t handle, 54 uint32_t hci_cmd, uint16_t hci_event, uint16_t cmd_status, 55 uint16_t reason_code, int64_t event_value)> 56 body{[](const RawAddress& address, uint16_t handle, uint32_t hci_cmd, 57 uint16_t hci_event, uint16_t cmd_status, uint16_t reason_code, 58 int64_t event_value) {}}; operatorlog_classic_pairing_event59 void operator()(const RawAddress& address, uint16_t handle, uint32_t hci_cmd, 60 uint16_t hci_event, uint16_t cmd_status, uint16_t reason_code, 61 int64_t event_value) { 62 body(address, handle, hci_cmd, hci_event, cmd_status, reason_code, 63 event_value); 64 }; 65 }; 66 extern struct log_classic_pairing_event log_classic_pairing_event; 67 // Name: log_link_layer_connection_event 68 // Params: const RawAddress* address, uint32_t connection_handle, 69 // android::bluetooth::DirectionEnum direction, uint16_t link_type, uint32_t 70 // hci_cmd, uint16_t hci_event, uint16_t hci_ble_event, uint16_t cmd_status, 71 // uint16_t reason_code Returns: void 72 struct log_link_layer_connection_event { 73 std::function<void(const RawAddress* address, uint32_t connection_handle, 74 android::bluetooth::DirectionEnum direction, 75 uint16_t link_type, uint32_t hci_cmd, uint16_t hci_event, 76 uint16_t hci_ble_event, uint16_t cmd_status, 77 uint16_t reason_code)> 78 body{[](const RawAddress* address, uint32_t connection_handle, 79 android::bluetooth::DirectionEnum direction, uint16_t link_type, 80 uint32_t hci_cmd, uint16_t hci_event, uint16_t hci_ble_event, 81 uint16_t cmd_status, uint16_t reason_code) {}}; operatorlog_link_layer_connection_event82 void operator()(const RawAddress* address, uint32_t connection_handle, 83 android::bluetooth::DirectionEnum direction, 84 uint16_t link_type, uint32_t hci_cmd, uint16_t hci_event, 85 uint16_t hci_ble_event, uint16_t cmd_status, 86 uint16_t reason_code) { 87 body(address, connection_handle, direction, link_type, hci_cmd, hci_event, 88 hci_ble_event, cmd_status, reason_code); 89 }; 90 }; 91 extern struct log_link_layer_connection_event log_link_layer_connection_event; 92 // Name: log_smp_pairing_event 93 // Params: const RawAddress& address, uint16_t smp_cmd, 94 // android::bluetooth::DirectionEnum direction, uint8_t smp_fail_reason Returns: 95 // void 96 struct log_smp_pairing_event { 97 std::function<void(const RawAddress& address, uint16_t smp_cmd, 98 android::bluetooth::DirectionEnum direction, 99 uint16_t smp_fail_reason)> 100 body{[](const RawAddress& address, uint16_t smp_cmd, 101 android::bluetooth::DirectionEnum direction, 102 uint16_t smp_fail_reason) {}}; operatorlog_smp_pairing_event103 void operator()(const RawAddress& address, uint16_t smp_cmd, 104 android::bluetooth::DirectionEnum direction, 105 uint16_t smp_fail_reason) { 106 body(address, smp_cmd, direction, smp_fail_reason); 107 }; 108 }; 109 extern struct log_smp_pairing_event log_smp_pairing_event; 110 // Name: log_sdp_attribute 111 // Params: const RawAddress& address, uint16_t protocol_uuid, uint16_t 112 // attribute_id, size_t attribute_size, const char* attribute_value Returns: 113 // void 114 struct log_sdp_attribute { 115 std::function<void(const RawAddress& address, uint16_t protocol_uuid, 116 uint16_t attribute_id, size_t attribute_size, 117 const char* attribute_value)> 118 body{[](const RawAddress& address, uint16_t protocol_uuid, 119 uint16_t attribute_id, size_t attribute_size, 120 const char* attribute_value) {}}; operatorlog_sdp_attribute121 void operator()(const RawAddress& address, uint16_t protocol_uuid, 122 uint16_t attribute_id, size_t attribute_size, 123 const char* attribute_value) { 124 body(address, protocol_uuid, attribute_id, attribute_size, attribute_value); 125 }; 126 }; 127 extern struct log_sdp_attribute log_sdp_attribute; 128 // Name: log_manufacturer_info 129 // Params: const RawAddress& address, android::bluetooth::DeviceInfoSrcEnum 130 // source_type, const std::string& source_name, const std::string& manufacturer, 131 // const std::string& model, const std::string& hardware_version, const 132 // std::string& software_version Returns: void 133 struct log_manufacturer_info { 134 std::function<void(const RawAddress& address, 135 android::bluetooth::AddressTypeEnum address_type, 136 android::bluetooth::DeviceInfoSrcEnum source_type, 137 const std::string& source_name, 138 const std::string& manufacturer, const std::string& model, 139 const std::string& hardware_version, 140 const std::string& software_version)> 141 body2{[](const RawAddress& address, 142 android::bluetooth::AddressTypeEnum address_type, 143 android::bluetooth::DeviceInfoSrcEnum source_type, 144 const std::string& source_name, const std::string& manufacturer, 145 const std::string& model, const std::string& hardware_version, 146 const std::string& software_version) {}}; operatorlog_manufacturer_info147 void operator()(const RawAddress& address, 148 android::bluetooth::AddressTypeEnum address_type, 149 android::bluetooth::DeviceInfoSrcEnum source_type, 150 const std::string& source_name, 151 const std::string& manufacturer, const std::string& model, 152 const std::string& hardware_version, 153 const std::string& software_version) { 154 body2(address, address_type, source_type, source_name, manufacturer, model, 155 hardware_version, software_version); 156 }; 157 std::function<void(const RawAddress& address, 158 android::bluetooth::DeviceInfoSrcEnum source_type, 159 const std::string& source_name, 160 const std::string& manufacturer, const std::string& model, 161 const std::string& hardware_version, 162 const std::string& software_version)> 163 body{[](const RawAddress& address, 164 android::bluetooth::DeviceInfoSrcEnum source_type, 165 const std::string& source_name, const std::string& manufacturer, 166 const std::string& model, const std::string& hardware_version, 167 const std::string& software_version) {}}; operatorlog_manufacturer_info168 void operator()(const RawAddress& address, 169 android::bluetooth::DeviceInfoSrcEnum source_type, 170 const std::string& source_name, 171 const std::string& manufacturer, const std::string& model, 172 const std::string& hardware_version, 173 const std::string& software_version) { 174 body(address, source_type, source_name, manufacturer, model, 175 hardware_version, software_version); 176 }; 177 }; 178 extern struct log_manufacturer_info log_manufacturer_info; 179 180 // Name: log_counter_metrics 181 struct log_counter_metrics { 182 std::function<void(android::bluetooth::CodePathCounterKeyEnum key, 183 int64_t value)> 184 body{ 185 [](android::bluetooth::CodePathCounterKeyEnum key, int64_t value) {}}; operatorlog_counter_metrics186 void operator()(android::bluetooth::CodePathCounterKeyEnum key, 187 int64_t value) { 188 body(key, value); 189 }; 190 }; 191 extern struct log_counter_metrics log_counter_metrics; 192 193 // Name: log_hfp_audio_packet_loss_stats 194 struct log_hfp_audio_packet_loss_stats { 195 std::function<void(const RawAddress& address, int num_decoded_frames, 196 double packet_loss_ratio)> 197 body{[](const RawAddress& address, int num_decoded_frames, 198 double packet_loss_ratio) {}}; operatorlog_hfp_audio_packet_loss_stats199 void operator()(const RawAddress& address, int num_decoded_frames, 200 double packet_loss_ratio) { 201 body(address, num_decoded_frames, packet_loss_ratio); 202 }; 203 }; 204 extern struct log_hfp_audio_packet_loss_stats log_hfp_audio_packet_loss_stats; 205 } // namespace stack_metrics_logging 206 } // namespace mock 207 } // namespace test 208 209 // END mockcify generation 210