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 #pragma once 18 19 #include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h> 20 #include <frameworks/proto_logging/stats/enums/bluetooth/hci/enums.pb.h> 21 22 #include <cstdint> 23 24 #include "types/raw_address.h" 25 26 void log_classic_pairing_event(const RawAddress& address, uint16_t handle, 27 uint32_t hci_cmd, uint16_t hci_event, 28 uint16_t cmd_status, uint16_t reason_code, 29 int64_t event_value); 30 31 void log_link_layer_connection_event( 32 const RawAddress* address, uint32_t connection_handle, 33 android::bluetooth::DirectionEnum direction, uint16_t link_type, 34 uint32_t hci_cmd, uint16_t hci_event, uint16_t hci_ble_event, 35 uint16_t cmd_status, uint16_t reason_code); 36 37 void log_smp_pairing_event(const RawAddress& address, uint16_t smp_cmd, 38 android::bluetooth::DirectionEnum direction, 39 uint16_t smp_fail_reason); 40 41 void log_sdp_attribute(const RawAddress& address, uint16_t protocol_uuid, 42 uint16_t attribute_id, size_t attribute_size, 43 const char* attribute_value); 44 45 void log_manufacturer_info(const RawAddress& address, 46 android::bluetooth::AddressTypeEnum address_type, 47 android::bluetooth::DeviceInfoSrcEnum source_type, 48 const std::string& source_name, 49 const std::string& manufacturer, 50 const std::string& model, 51 const std::string& hardware_version, 52 const std::string& software_version); 53 54 void log_counter_metrics(android::bluetooth::CodePathCounterKeyEnum key, 55 int64_t value); 56 57 void log_hfp_audio_packet_loss_stats(const RawAddress& address, 58 int num_decoded_frames, 59 double packet_loss_ratio, 60 uint16_t codec_type); 61 62 void log_mmc_transcode_rtt_stats(int maximum_rtt, double mean_rtt, 63 int num_requests, int codec_type); 64