// Copyright (C) 2021 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";

option java_multiple_files = true;
option java_package = "com.android.emulation.bluetooth";
option csharp_namespace = "Android.Emulation.Bluetooth";
option objc_class_prefix = "AEB";
option cc_enable_arenas = true;

package android.emulation.bluetooth;

// A packet that is exchanged between the bluetooth chip and higher layers.
message HCIPacket {
    enum PacketType {
        // The packet is unspecified, and contains raw bytes.
        // This is mainly here to protect against compatibility issues that can
        // arise if new enum fields are ever introduced.
        // See: https://developers.google.com/protocol-buffers/docs/style#enums
        PACKET_TYPE_UNSPECIFIED = 0;

        // HCI Command Packets: commands are issued by the HCI Driver to the
        // Host Controller:
        PACKET_TYPE_HCI_COMMAND = 1;

        // ACL (asynchronous connectionless) packet.
        PACKET_TYPE_ACL = 2;

        // SCO (synchronous connection orientated) packet.
        PACKET_TYPE_SCO = 3;

        // HCI Event Packets.
        PACKET_TYPE_EVENT = 4;

        // Isochronous Channel, a data transmissions that are time-sensitive
        // and synchronized rendering of these data streams across multiple
        // receivers. See
        // https://www.novelbits.io/bluetooth-version-5-2-le-audio/ for an
        // overview of ISO channels.
        PACKET_TYPE_ISO = 5;
    }

    // Indicates the type of packet contained in the packet bytes.
    PacketType type = 1;

    // The actual data that was transferred.
    bytes packet = 2;
}
