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 <string> 25 26 // Original included files, if any 27 #include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h> 28 #include <frameworks/proto_logging/stats/enums/bluetooth/hci/enums.pb.h> 29 30 #include "types/raw_address.h" 31 32 // Mocked compile conditionals, if any 33 34 namespace test { 35 namespace mock { 36 namespace stack_metrics_logging { 37 38 // Shared state between mocked functions and tests 39 // Name: log_classic_pairing_event 40 // Params: const RawAddress& address, uint16_t handle, uint32_t hci_cmd, 41 // uint16_t hci_event, uint16_t cmd_status, uint16_t reason_code, int64_t 42 // event_value Returns: void 43 struct log_classic_pairing_event { 44 std::function<void(const RawAddress& address, uint16_t handle, 45 uint32_t hci_cmd, uint16_t hci_event, uint16_t cmd_status, 46 uint16_t reason_code, int64_t event_value)> 47 body{[](const RawAddress& /* address */, uint16_t /* handle */, 48 uint32_t /* hci_cmd */, uint16_t /* hci_event */, 49 uint16_t /* cmd_status */, uint16_t /* reason_code */, 50 int64_t /* event_value */) {}}; operatorlog_classic_pairing_event51 void operator()(const RawAddress& address, uint16_t handle, uint32_t hci_cmd, 52 uint16_t hci_event, uint16_t cmd_status, uint16_t reason_code, 53 int64_t event_value) { 54 body(address, handle, hci_cmd, hci_event, cmd_status, reason_code, 55 event_value); 56 }; 57 }; 58 extern struct log_classic_pairing_event log_classic_pairing_event; 59 // Name: log_link_layer_connection_event 60 // Params: const RawAddress* address, uint32_t connection_handle, 61 // android::bluetooth::DirectionEnum direction, uint16_t link_type, uint32_t 62 // hci_cmd, uint16_t hci_event, uint16_t hci_ble_event, uint16_t cmd_status, 63 // uint16_t reason_code Returns: void 64 struct log_link_layer_connection_event { 65 std::function<void(const RawAddress* address, uint32_t connection_handle, 66 android::bluetooth::DirectionEnum direction, 67 uint16_t link_type, uint32_t hci_cmd, uint16_t hci_event, 68 uint16_t hci_ble_event, uint16_t cmd_status, 69 uint16_t reason_code)> 70 body{[](const RawAddress* /* address */, uint32_t /* connection_handle */, 71 android::bluetooth::DirectionEnum /* direction */, 72 uint16_t /* link_type */, uint32_t /* hci_cmd */, 73 uint16_t /* hci_event */, uint16_t /* hci_ble_event */, 74 uint16_t /* cmd_status */, uint16_t /* reason_code */) {}}; operatorlog_link_layer_connection_event75 void operator()(const RawAddress* address, uint32_t connection_handle, 76 android::bluetooth::DirectionEnum direction, 77 uint16_t link_type, uint32_t hci_cmd, uint16_t hci_event, 78 uint16_t hci_ble_event, uint16_t cmd_status, 79 uint16_t reason_code) { 80 body(address, connection_handle, direction, link_type, hci_cmd, hci_event, 81 hci_ble_event, cmd_status, reason_code); 82 }; 83 }; 84 extern struct log_link_layer_connection_event log_link_layer_connection_event; 85 // Name: log_smp_pairing_event 86 // Params: const RawAddress& address, uint16_t smp_cmd, 87 // android::bluetooth::DirectionEnum direction, uint8_t smp_fail_reason Returns: 88 // void 89 struct log_smp_pairing_event { 90 std::function<void(const RawAddress& address, uint16_t smp_cmd, 91 android::bluetooth::DirectionEnum direction, 92 uint16_t smp_fail_reason)> 93 body{[](const RawAddress& /* address */, uint16_t /* smp_cmd */, 94 android::bluetooth::DirectionEnum /* direction */, 95 uint16_t /* smp_fail_reason */) {}}; operatorlog_smp_pairing_event96 void operator()(const RawAddress& address, uint16_t smp_cmd, 97 android::bluetooth::DirectionEnum direction, 98 uint16_t smp_fail_reason) { 99 body(address, smp_cmd, direction, smp_fail_reason); 100 }; 101 }; 102 extern struct log_smp_pairing_event log_smp_pairing_event; 103 // Name: log_sdp_attribute 104 // Params: const RawAddress& address, uint16_t protocol_uuid, uint16_t 105 // attribute_id, size_t attribute_size, const char* attribute_value Returns: 106 // void 107 struct log_sdp_attribute { 108 std::function<void(const RawAddress& address, uint16_t protocol_uuid, 109 uint16_t attribute_id, size_t attribute_size, 110 const char* attribute_value)> 111 body{[](const RawAddress& /* address */, uint16_t /* protocol_uuid */, 112 uint16_t /* attribute_id */, size_t /* attribute_size */, 113 const char* /* attribute_value */) {}}; operatorlog_sdp_attribute114 void operator()(const RawAddress& address, uint16_t protocol_uuid, 115 uint16_t attribute_id, size_t attribute_size, 116 const char* attribute_value) { 117 body(address, protocol_uuid, attribute_id, attribute_size, attribute_value); 118 }; 119 }; 120 extern struct log_sdp_attribute log_sdp_attribute; 121 // Name: log_manufacturer_info 122 // Params: const RawAddress& address, android::bluetooth::DeviceInfoSrcEnum 123 // source_type, const std::string& source_name, const std::string& manufacturer, 124 // const std::string& model, const std::string& hardware_version, const 125 // std::string& software_version Returns: void 126 struct log_manufacturer_info { 127 std::function<void(const RawAddress& address, 128 android::bluetooth::AddressTypeEnum address_type, 129 android::bluetooth::DeviceInfoSrcEnum source_type, 130 const std::string& source_name, 131 const std::string& manufacturer, const std::string& model, 132 const std::string& hardware_version, 133 const std::string& software_version)> 134 body2{[](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 */, 139 const std::string& /* model */, 140 const std::string& /* hardware_version */, 141 const std::string& /* software_version */) {}}; operatorlog_manufacturer_info142 void operator()(const RawAddress& address, 143 android::bluetooth::AddressTypeEnum address_type, 144 android::bluetooth::DeviceInfoSrcEnum source_type, 145 const std::string& source_name, 146 const std::string& manufacturer, const std::string& model, 147 const std::string& hardware_version, 148 const std::string& software_version) { 149 body2(address, address_type, source_type, source_name, manufacturer, model, 150 hardware_version, software_version); 151 }; 152 std::function<void(const RawAddress& address, 153 android::bluetooth::DeviceInfoSrcEnum source_type, 154 const std::string& source_name, 155 const std::string& manufacturer, const std::string& model, 156 const std::string& hardware_version, 157 const std::string& software_version)> 158 body{[](const RawAddress& /* address */, 159 android::bluetooth::DeviceInfoSrcEnum /* source_type */, 160 const std::string& /* source_name */, 161 const std::string& /* manufacturer */, 162 const std::string& /* model */, 163 const std::string& /* hardware_version */, 164 const std::string& /* software_version */) {}}; operatorlog_manufacturer_info165 void operator()(const RawAddress& address, 166 android::bluetooth::DeviceInfoSrcEnum source_type, 167 const std::string& source_name, 168 const std::string& manufacturer, const std::string& model, 169 const std::string& hardware_version, 170 const std::string& software_version) { 171 body(address, source_type, source_name, manufacturer, model, 172 hardware_version, software_version); 173 }; 174 }; 175 extern struct log_manufacturer_info log_manufacturer_info; 176 177 // Name: log_counter_metrics 178 struct log_counter_metrics { 179 std::function<void(android::bluetooth::CodePathCounterKeyEnum key, 180 int64_t value)> 181 body{[](android::bluetooth::CodePathCounterKeyEnum /* key */, 182 int64_t /* value */) {}}; operatorlog_counter_metrics183 void operator()(android::bluetooth::CodePathCounterKeyEnum key, 184 int64_t value) { 185 body(key, value); 186 }; 187 }; 188 extern struct log_counter_metrics log_counter_metrics; 189 190 // Name: log_hfp_audio_packet_loss_stats 191 struct log_hfp_audio_packet_loss_stats { 192 std::function<void(const RawAddress& address, int num_decoded_frames, 193 double packet_loss_ratio, uint16_t codec_type)> 194 body{[](const RawAddress& /* address */, int /* num_decoded_frames */, 195 double /* packet_loss_ratio */, uint16_t /* codec_type */) {}}; operatorlog_hfp_audio_packet_loss_stats196 void operator()(const RawAddress& address, int num_decoded_frames, 197 double packet_loss_ratio, uint16_t codec_type) { 198 body(address, num_decoded_frames, packet_loss_ratio, codec_type); 199 }; 200 }; 201 extern struct log_hfp_audio_packet_loss_stats log_hfp_audio_packet_loss_stats; 202 203 // Name: log_mmc_transcode_rtt_stats 204 struct log_mmc_transcode_rtt_stats { 205 std::function<void(int maximum_rtt, double mean_rtt, int num_requests, 206 int codec_type)> 207 body{[](int /* maximum_rtt */, double /* mean_rtt */, 208 int /* num_requests */, int /* codec_type */) {}}; operatorlog_mmc_transcode_rtt_stats209 void operator()(int maximum_rtt, double mean_rtt, int num_requests, 210 int codec_type) { 211 body(maximum_rtt, mean_rtt, num_requests, codec_type); 212 }; 213 }; 214 extern struct log_mmc_transcode_rtt_stats log_mmc_transcode_rtt_stats; 215 } // namespace stack_metrics_logging 216 } // namespace mock 217 } // namespace test 218 219 // END mockcify generation 220