1/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.gnss@2.1;
18
19import android.hardware.gnss.measurement_corrections@1.1::IMeasurementCorrections;
20import @2.0::IGnss;
21import IGnssCallback;
22import IGnssMeasurement;
23import IGnssConfiguration;
24import IGnssAntennaInfo;
25
26/**
27 * Represents the standard GNSS (Global Navigation Satellite System) interface.
28 */
29interface IGnss extends @2.0::IGnss {
30    /**
31     * Opens the interface and provides the callback routines to the implementation of this
32     * interface.
33     *
34     * The framework calls this method to instruct the GPS engine to prepare for serving requests
35     * from the framework. The GNSS HAL implementation must respond to all GNSS requests from the
36     * framework upon successful return from this method until cleanup() method is called to
37     * close this interface.
38     *
39     * @param callback Callback interface for IGnss.
40     *
41     * @return success Returns true on success.
42     */
43    setCallback_2_1(IGnssCallback callback) generates (bool success);
44
45    /**
46     * This method returns the IGnssMeasurement interface.
47     *
48     * getExtensionGnssMeasurement(), getExtensionGnssMeasurement_1_1(),
49     * getExtensionGnssMeasurement_2_0(), and getExtensionGnssMeasurement_2_1() methods must return
50     * non-null. They can all return the same, latest version of IGnssMeasurement.
51     *
52     * @return gnssMeasurementIface Handle to the IGnssMeasurement interface.
53     */
54    getExtensionGnssMeasurement_2_1() generates (IGnssMeasurement gnssMeasurementIface);
55
56    /**
57     * This method returns the IGnssConfiguration interface.
58     *
59     * getExtensionGnssConfiguration(), getExtensionGnssConfiguration_1_1(),
60     * getExtensionGnssConfiguration_2_0(), and getExtensionGnssConfiguration_2_1() methods must
61     * return non-null. They can all return the same, latest version of IGnssConfiguration.
62     *
63     * @return gnssConfigurationIface Handle to the IGnssConfiguration interface.
64     */
65    getExtensionGnssConfiguration_2_1() generates (IGnssConfiguration gnssConfigurationIface);
66
67    /**
68     * This method returns the IMeasurementCorrections interface.
69     *
70     * Both getExtensionMeasurementCorrections and getExtensionMeasurementCorrections_1_1 must
71     * return non-null. Both methods can return the same V1.1 IMeasurementCorrections object.
72     *
73     * @return measurementCorrectionsIface Handle to the IMeasurementCorrections interface.
74     */
75    getExtensionMeasurementCorrections_1_1()
76        generates (IMeasurementCorrections measurementCorrectionsIface);
77
78    /**
79     * This method returns the IGnssAntennaInfo interface.
80     *
81     * This method must return non-null.
82     *
83     * @return gnssAntennaInfoIface Handle to the IGnssAntennaInfo interface.
84     */
85    getExtensionGnssAntennaInfo() generates (IGnssAntennaInfo gnssAntennaInfoIface);
86};
87