/*
 * Copyright (C) 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.gnss@2.0;

import @1.0::IGnssDebug;

/** Extended interface for DEBUG support. */
interface IGnssDebug extends @1.0::IGnssDebug {

    /** Extending SatelliteData, replacing the GnssConstellationType. */
    struct SatelliteData {
        /**
         * GNSS Satellite info.
         *
         * In this version of the HAL, the field 'constellation' in the v1_0 struct is deprecated,
         * and is no longer used by the framework. The constellation type is instead reported in
         * @2.0::IGnssDebug.SatelliteData.constellation.
         */
        @1.0::IGnssDebug.SatelliteData v1_0;

        /** Defines the constellation type of the given SV. */
        GnssConstellationType constellation;
    };

    /**
     * Provides a set of debug information that is filled by the GNSS chipset when the method
     * getDebugData() is invoked.
     */
    struct DebugData {
        /** Current best known position. */
        @1.0::IGnssDebug.PositionDebug position;

        /** Current best know time estimate. */
        @1.0::IGnssDebug.TimeDebug time;

        /**
         * Provides a list of the available satellite data, for all
         * satellites and constellations the device can track,
         * including GnssConstellationType UNKNOWN.
         */
        vec<SatelliteData> satelliteDataArray;
    };

    /**
     * This methods requests position, time and satellite ephemeris debug information from the HAL.
     *
     * @return ret debugData information from GNSS Hal that contains the current best known
     * position, best known time estimate and a complete list of constellations that the device can
     * track.
     */
    getDebugData_2_0() generates (DebugData debugData);
};
