/*
 * Copyright 2019 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.wifi@1.4;

import @1.2::IWifiChipEventCallback;
import WifiBand;

/**
 * Wifi chip event callbacks.
 */
interface IWifiChipEventCallback extends @1.2::IWifiChipEventCallback {
    /**
     * Struct describing the state of each hardware radio chain (hardware MAC)
     * on the device.
     */
    struct RadioModeInfo {
        /**
         * Identifier for this radio chain. This is vendor dependent & used
         * only for debugging purposes.
         */
        uint32_t radioId;

        /**
         * List of bands on which this radio chain is operating.
         * Can be one of:
         * a) WifiBand.BAND_24GHZ => 2.4Ghz.
         * b) WifiBand.BAND_5GHZ => 5Ghz.
         * c) WifiBand.BAND_24GHZ_5GHZ = 2.4Ghz + 5Ghz (Radio is time sharing
         * across the 2 bands).
         * d) WifiBand.BAND_6GHZ => 6Ghz.
         * e) WifiBand.BAND_5GHZ_6GHZ => 5Ghz + 6Ghz (Radio is time sharing
         * across the 2 bands).
         * f) WifiBand.BAND_24GHZ_5GHZ_6GHZ => 2.4Ghz + 5Ghz + 6Ghz (Radio is
         * time sharing across the 3 bands).
         */
        WifiBand bandInfo;

        /**
         * List of interfaces on this radio chain (hardware MAC).
         */
        vec<IfaceInfo> ifaceInfos;
    };

    /**
     * Asynchronous callback indicating a radio mode change.
     * Radio mode change could be a result of:
     * a) Bringing up concurrent interfaces (For ex: STA + AP).
     * b) Change in operating band of one of the concurrent interfaces (For ex:
     * STA connection moved from 2.4G to 5G)
     *
     * @param radioModeInfos List of RadioModeInfo structures for each
     * radio chain (hardware MAC) on the device.
     */
    oneway onRadioModeChange_1_4(vec<RadioModeInfo> radioModeInfos);
};
