1/* 2 * Copyright (C) 2025 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 17syntax = "proto2"; 18 19package perfetto.protos; 20 21// Describes the packet type and direction. CMD and EVT are unidirectional, so 22// no need to differentiate the direction. 23enum BluetoothTracePacketType { 24 HCI_CMD = 1; 25 HCI_EVT = 2; 26 HCI_ACL_RX = 3; 27 HCI_ACL_TX = 4; 28 HCI_SCO_RX = 5; 29 HCI_SCO_TX = 6; 30 HCI_ISO_RX = 7; 31 HCI_ISO_TX = 8; 32} 33 34// Trace event for bluetooth 35message BluetoothTraceEvent { 36 // Packet type and direction 37 optional BluetoothTracePacketType packet_type = 1; 38 39 // Total count of the packets collected during the collection interval 40 optional uint32 count = 2; 41 42 // Total cumulative length of the packets collected during the collection 43 // interval 44 optional uint32 length = 3; 45 46 // The collection interval in nanoseconds. This is the duration between the 47 // first and last packets collected. 48 optional uint32 duration = 4; 49 50 // In case of CMD type, further breakdown of the type of command 51 optional uint32 op_code = 5; 52 53 // In the case of EVT type, further breakdown of the type of event 54 optional uint32 event_code = 6; 55 56 // When applicable for EVT type, further breakdown of event type into specific 57 // subevent 58 optional uint32 subevent_code = 7; 59 60 // Associated handle for the bluetooth packet 61 optional uint32 connection_handle = 8; 62} 63