bluetooth.proto revision 4308e8f5f34b668f48cb50fbbdac77e45d04e432
1// Copyright 2014 Google Inc. All Rights Reserved. 2// Author: pkanwar@google.com (Pankaj Kanwar) 3// Protos for uploading bluetooth metrics. 4 5syntax = "proto2"; 6 7package com.android.bluetooth.btservice; 8 9option java_package = "com.android.bluetooth.btservice"; 10option java_outer_classname = "BluetoothProto"; 11//option (datapol.file_vetting_status) = "latest"; 12 13// import "storage/datapol/annotations/proto/semantic_annotations.proto"; 14 15message BluetoothLog { 16 17 // Session information that gets logged for every BT connection. 18 repeated BluetoothSession session = 1; 19 20 // Session information that gets logged for every Pair event. 21 repeated PairEvent pair_event = 2; 22 23 // Information for Wake locks. 24 repeated WakeEvent wake_event = 3; 25 26 // Scan event information. 27 repeated ScanEvent scan_event = 4; 28 29 // Number of bonded devices. 30 optional int32 num_bonded_devices = 5; 31} 32 33// The information about the device. 34message DeviceInfo { 35 36 // Device type. 37 enum DeviceType { 38 39 // Type is unknown. 40 DEVICE_TYPE_UNKNOWN = 0; 41 42 DEVICE_TYPE_BREDR = 1; 43 44 DEVICE_TYPE_LE = 2; 45 46 DEVICE_TYPE_DUMO = 3; 47 } 48 49 // Device class 50 // https://cs.corp.google.com/#android/system/bt/stack/include/btm_api.h&q=major_computer. 51 optional int32 device_class = 1; 52 53 // Device type. 54 optional DeviceType device_type = 2; 55} 56 57// Information that gets logged for every Bluetooth connection. 58message BluetoothSession { 59 60 // Type of technology used in the connection. 61 enum ConnectionTechnologyType { 62 63 CONNECTION_TECHNOLOGY_TYPE_UNKNOWN = 0; 64 65 CONNECTION_TECHNOLOGY_TYPE_LE = 1; 66 67 CONNECTION_TECHNOLOGY_TYPE_BREDR = 2; 68 } 69 70 // Duration of the session. 71 optional int64 session_duration_sec = 2; 72 73 // Technology type. 74 optional ConnectionTechnologyType connection_technology_type = 3; 75 76 // Reason for disconnecting. 77 optional string disconnect_reason = 4; 78 79 // The information about the device which it is connected to. 80 optional DeviceInfo device_connected_to = 5; 81 82 // The information about the RFComm session. 83 optional RFCommSession rfcomm_session = 6; 84 85 // The information about the A2DP audio session. 86 optional A2DPSession a2dp_session = 7; 87} 88 89message RFCommSession { 90 91 // bytes transmitted. 92 optional int32 rx_bytes = 1; 93 94 // bytes transmitted. 95 optional int32 tx_bytes = 2; 96} 97 98// Session information that gets logged for A2DP session. 99message A2DPSession { 100 101 // Media timer in milliseconds. 102 optional int32 media_timer_min_millis = 1; 103 104 // Media timer in milliseconds. 105 optional int32 media_timer_max_millis = 2; 106 107 // Media timer in milliseconds. 108 optional int32 media_timer_avg_millis = 3; 109 110 // Buffer overruns count. 111 optional int32 buffer_overruns_max_count = 4; 112 113 // Buffer overruns total. 114 optional int32 buffer_overruns_total = 5; 115 116 // Buffer underruns average. 117 optional float buffer_underruns_average = 6; 118 119 // Buffer underruns count. 120 optional int32 buffer_underruns_count = 7; 121 122 // Total audio time in this A2DP session 123 optional int64 audio_duration_millis = 8; 124} 125 126message PairEvent { 127 128 // The reason for disconnecting 129 // https://cs.corp.google.com/#android/system/bt/stack/include/hcidefs.h&q=failed_establish. 130 optional int32 disconnect_reason = 1; 131 132 // Pair event time 133 optional int64 event_time_millis = 2; // [(datapol.semantic_type) = ST_TIMESTAMP]; 134 135 // The information about the device which it is paired to. 136 optional DeviceInfo device_paired_with = 3; 137} 138 139message WakeEvent { 140 141 // Information about the wake event type. 142 enum WakeEventType { 143 144 // Type is unknown. 145 UNKNOWN = 0; 146 147 // WakeLock was acquired. 148 ACQUIRED = 1; 149 150 // WakeLock was released. 151 RELEASED = 2; 152 } 153 154 // Information about the wake event type. 155 optional WakeEventType wake_event_type = 1; 156 157 // Initiator of the scan. Only the first three names will be stored. 158 // e.g. com.google.gms. 159 optional string requestor = 2; 160 161 // Name of the wakelock (e.g. bluedroid_timer). 162 optional string name = 3; 163 164 // Time of the event. 165 optional int64 event_time_millis = 4; // [(datapol.semantic_type) = ST_TIMESTAMP]; 166} 167 168message ScanEvent { 169 170 // Scan type. 171 enum ScanTechnologyType { 172 173 // Scan Type is unknown. 174 SCAN_TYPE_UNKNOWN = 0; 175 176 SCAN_TECH_TYPE_LE = 1; 177 178 SCAN_TECH_TYPE_BREDR = 2; 179 180 SCAN_TECH_TYPE_BOTH = 3; 181 } 182 183 // Scan event type. 184 enum ScanEventType { 185 186 // Scan started. 187 SCAN_EVENT_START = 0; 188 189 // Scan stopped. 190 SCAN_EVENT_STOP = 1; 191 } 192 193 // Scan event type. 194 optional ScanEventType scan_event_type = 1; 195 196 // Initiator of the scan. Only the first three names will be stored. 197 // e.g. com.google.gms. 198 optional string initiator = 2; 199 200 // Technology used for scanning. 201 optional ScanTechnologyType scan_technology_type = 3; 202 203 // Number of results returned. 204 optional int32 number_results = 4; 205 206 // Time of the event. 207 optional int64 event_time_millis = 5; // [(datapol.semantic_type) = ST_TIMESTAMP]; 208} 209