• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  *  Copyright 2021 Google, Inc.
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at:
8  *
9  *  http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  *
17  ******************************************************************************/
18 
19 #include "os/metrics.h"
20 #include "os/log.h"
21 
22 namespace bluetooth {
23 namespace os {
24 
25 using bluetooth::hci::Address;
26 
LogMetricClassicPairingEvent(const Address & address,uint16_t handle,uint32_t hci_cmd,uint16_t hci_event,uint16_t cmd_status,uint16_t reason_code,int64_t event_value)27 void LogMetricClassicPairingEvent(
28     const Address& address,
29     uint16_t handle,
30     uint32_t hci_cmd,
31     uint16_t hci_event,
32     uint16_t cmd_status,
33     uint16_t reason_code,
34     int64_t event_value) {}
35 
LogMetricSocketConnectionState(const Address & address,int port,int type,android::bluetooth::SocketConnectionstateEnum connection_state,int64_t tx_bytes,int64_t rx_bytes,int uid,int server_port,android::bluetooth::SocketRoleEnum socket_role)36 void LogMetricSocketConnectionState(
37     const Address& address,
38     int port,
39     int type,
40     android::bluetooth::SocketConnectionstateEnum connection_state,
41     int64_t tx_bytes,
42     int64_t rx_bytes,
43     int uid,
44     int server_port,
45     android::bluetooth::SocketRoleEnum socket_role) {}
46 
LogMetricHciTimeoutEvent(uint32_t hci_cmd)47 void LogMetricHciTimeoutEvent(uint32_t hci_cmd) {}
48 
LogMetricA2dpAudioUnderrunEvent(const Address & address,uint64_t encoding_interval_millis,int num_missing_pcm_bytes)49 void LogMetricA2dpAudioUnderrunEvent(
50     const Address& address, uint64_t encoding_interval_millis, int num_missing_pcm_bytes) {}
51 
LogMetricA2dpAudioOverrunEvent(const Address & address,uint64_t encoding_interval_millis,int num_dropped_buffers,int num_dropped_encoded_frames,int num_dropped_encoded_bytes)52 void LogMetricA2dpAudioOverrunEvent(
53     const Address& address,
54     uint64_t encoding_interval_millis,
55     int num_dropped_buffers,
56     int num_dropped_encoded_frames,
57     int num_dropped_encoded_bytes) {}
58 
LogMetricReadRssiResult(const Address & address,uint16_t handle,uint32_t cmd_status,int8_t rssi)59 void LogMetricReadRssiResult(const Address& address, uint16_t handle, uint32_t cmd_status, int8_t rssi) {}
60 
LogMetricReadFailedContactCounterResult(const Address & address,uint16_t handle,uint32_t cmd_status,int32_t failed_contact_counter)61 void LogMetricReadFailedContactCounterResult(
62     const Address& address, uint16_t handle, uint32_t cmd_status, int32_t failed_contact_counter) {}
63 
LogMetricReadTxPowerLevelResult(const Address & address,uint16_t handle,uint32_t cmd_status,int32_t transmit_power_level)64 void LogMetricReadTxPowerLevelResult(
65     const Address& address, uint16_t handle, uint32_t cmd_status, int32_t transmit_power_level) {}
66 
LogMetricRemoteVersionInfo(uint16_t handle,uint8_t status,uint8_t version,uint16_t manufacturer_name,uint16_t subversion)67 void LogMetricRemoteVersionInfo(
68     uint16_t handle, uint8_t status, uint8_t version, uint16_t manufacturer_name, uint16_t subversion) {}
69 
LogMetricLinkLayerConnectionEvent(const Address * address,uint32_t connection_handle,android::bluetooth::DirectionEnum direction,uint16_t link_type,uint32_t hci_cmd,uint16_t hci_event,uint16_t hci_ble_event,uint16_t cmd_status,uint16_t reason_code)70 void LogMetricLinkLayerConnectionEvent(
71     const Address* address,
72     uint32_t connection_handle,
73     android::bluetooth::DirectionEnum direction,
74     uint16_t link_type,
75     uint32_t hci_cmd,
76     uint16_t hci_event,
77     uint16_t hci_ble_event,
78     uint16_t cmd_status,
79     uint16_t reason_code) {}
80 
LogMetricManufacturerInfo(const Address & address,android::bluetooth::AddressTypeEnum address_type,android::bluetooth::DeviceInfoSrcEnum source_type,const std::string & source_name,const std::string & manufacturer,const std::string & model,const std::string & hardware_version,const std::string & software_version)81 void LogMetricManufacturerInfo(
82     const Address& address,
83     android::bluetooth::AddressTypeEnum address_type,
84     android::bluetooth::DeviceInfoSrcEnum source_type,
85     const std::string& source_name,
86     const std::string& manufacturer,
87     const std::string& model,
88     const std::string& hardware_version,
89     const std::string& software_version) {}
90 
LogMetricSdpAttribute(const Address & address,uint16_t protocol_uuid,uint16_t attribute_id,size_t attribute_size,const char * attribute_value)91 void LogMetricSdpAttribute(
92     const Address& address,
93     uint16_t protocol_uuid,
94     uint16_t attribute_id,
95     size_t attribute_size,
96     const char* attribute_value) {}
97 
LogMetricSmpPairingEvent(const Address & address,uint16_t smp_cmd,android::bluetooth::DirectionEnum direction,uint16_t smp_fail_reason)98 void LogMetricSmpPairingEvent(
99     const Address& address, uint16_t smp_cmd, android::bluetooth::DirectionEnum direction, uint16_t smp_fail_reason) {}
100 
LogMetricA2dpPlaybackEvent(const Address & address,int playback_state,int audio_coding_mode)101 void LogMetricA2dpPlaybackEvent(const Address& address, int playback_state, int audio_coding_mode) {}
102 
LogMetricBluetoothHalCrashReason(const Address & address,uint32_t error_code,uint32_t vendor_error_code)103 void LogMetricBluetoothHalCrashReason(
104     const Address& address, uint32_t error_code, uint32_t vendor_error_code) {}
105 
LogMetricBluetoothLocalSupportedFeatures(uint32_t page_num,uint64_t features)106 void LogMetricBluetoothLocalSupportedFeatures(uint32_t page_num, uint64_t features) {}
107 
LogMetricBluetoothLocalVersions(uint32_t lmp_manufacturer_name,uint8_t lmp_version,uint32_t lmp_subversion,uint8_t hci_version,uint32_t hci_reversion)108 void LogMetricBluetoothLocalVersions(
109     uint32_t lmp_manufacturer_name,
110     uint8_t lmp_version,
111     uint32_t lmp_subversion,
112     uint8_t hci_version,
113     uint32_t hci_reversion) {}
114 
LogMetricBluetoothDisconnectionReasonReported(uint32_t reason,const Address & address,uint32_t connection_handle)115 void LogMetricBluetoothDisconnectionReasonReported(
116     uint32_t reason, const Address& address, uint32_t connection_handle) {}
117 
LogMetricBluetoothRemoteSupportedFeatures(const Address & address,uint32_t page,uint64_t features,uint32_t connection_handle)118 void LogMetricBluetoothRemoteSupportedFeatures(
119     const Address& address, uint32_t page, uint64_t features, uint32_t connection_handle) {}
120 
LogMetricBluetoothCodePathCounterMetrics(int32_t key,int64_t count)121 void LogMetricBluetoothCodePathCounterMetrics(int32_t key, int64_t count) {}
122 
LogMetricBluetoothLEConnectionMetricEvent(const Address & address,android::bluetooth::le::LeConnectionOriginType origin_type,android::bluetooth::le::LeConnectionType connection_type,android::bluetooth::le::LeConnectionState transaction_state,std::vector<std::pair<os::ArgumentType,int>> & argument_list)123 void LogMetricBluetoothLEConnectionMetricEvent(
124     const Address& address,
125     android::bluetooth::le::LeConnectionOriginType origin_type,
126     android::bluetooth::le::LeConnectionType connection_type,
127     android::bluetooth::le::LeConnectionState transaction_state,
128    std::vector<std::pair<os::ArgumentType, int>>& argument_list)  {}
129 
LogMetricBluetoothLEConnection(os::LEConnectionSessionOptions session_options)130 void LogMetricBluetoothLEConnection(os::LEConnectionSessionOptions session_options) {}
131 
132 }  // namespace os
133 }  // namespace bluetooth
134