/*
 * 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.
 */

package android.hardware.tv.cec@1.1;

import @1.0::CecLogicalAddress;
import @1.0::CecMessageType;

enum CecLogicalAddress : @1.0::CecLogicalAddress {
    BACKUP_1 = 12,
    BACKUP_2 = 13,
};

enum CecMessageType : @1.0::CecMessageType {
    GIVE_FEATURES = 0xA5,
    REPORT_FEATURES = 0xA6,
    REQUEST_CURRENT_LATENCY = 0xA7,
    REPORT_CURRENT_LATENCY = 0xA8,
};

struct CecMessage {
    /** logical address of the initiator */
    CecLogicalAddress initiator;

    /** logical address of destination */
    CecLogicalAddress destination;

    /**
     * The maximum size of body is 15 (MaxLength::MESSAGE_BODY) as specified in
     * the section 6 of the CEC Spec 1.4b. Overflowed data must be ignored. */
    vec<uint8_t> body;
};
