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

import @1.0::IGnssMeasurement;
import @1.1::IGnssMeasurement;
import @2.0::IGnssMeasurement;
import IGnssMeasurementCallback;

/**
 * Extended interface for GNSS Measurements support.
 */
interface IGnssMeasurement extends @2.0::IGnssMeasurement {
    /**
     * Initializes the interface and registers the callback routines with the HAL. After a
     * successful call to 'setCallback_2_1' the HAL must begin to provide updates at an average
     * output rate of 1Hz (occasional intra-measurement time offsets in the range from 0-2000msec
     * can be tolerated.)
     *
     * @param callback Handle to GnssMeasurement callback interface.
     * @param enableFullTracking If true, GNSS chipset must switch off duty cycling. In such mode
     *     no clock discontinuities are expected and, when supported, carrier phase should be
     *     continuous in good signal conditions. All non-blacklisted, healthy constellations,
     *     satellites and frequency bands that the chipset supports must be reported in this mode.
     *     The GNSS chipset is allowed to consume more power in this mode. If false, API must behave
     *     as in HAL V1_0, optimizing power via duty cycling, constellations and frequency limits,
     *     etc.
     *
     * @return initRet Returns SUCCESS if successful. Returns ERROR_ALREADY_INIT if a callback has
     *     already been registered without a corresponding call to 'close'. Returns ERROR_GENERIC
     *     for any other error. The HAL must not generate any other updates upon returning this
     *     error code.
     */
    setCallback_2_1(IGnssMeasurementCallback callback, bool enableFullTracking)
        generates (GnssMeasurementStatus initRet);
};
