blob: cc19ef87eb26b227d0c69a6c50d89d2e53ac5e30 [file] [log] [blame]
Hridya Valsarajue596a712016-09-22 14:07:22 -07001/*
2 * Copyright (C) 2016 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@1.0;
18
19import IAGnss;
20import IAGnssRil;
Hridya Valsaraju49526a72016-10-13 21:09:22 -070021import IGnssCallback;
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070022import IGnssConfiguration;
Hridya Valsaraju49526a72016-10-13 21:09:22 -070023import IGnssDebug;
Hridya Valsarajue596a712016-09-22 14:07:22 -070024import IGnssMeasurement;
25import IGnssNavigationMessage;
Hridya Valsarajue596a712016-09-22 14:07:22 -070026import IGnssGeofencing;
27import IGnssNi;
28import IGnssXtra;
29
30/* Represents the standard GNSS interface. */
31interface IGnss {
32 /* Requested operational mode for GNSS operation. */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070033 enum GnssPositionMode : uint8_t {
Hridya Valsarajue596a712016-09-22 14:07:22 -070034 /** Mode for running GNSS standalone (no assistance). */
35 STANDALONE = 0,
36 /** AGNSS MS-Based mode. */
37 MS_BASED = 1,
38 /*
39 * AGNSS MS-Assisted mode. This mode is not maintained by the platform anymore.
40 * It is strongly recommended to use MS_BASED instead.
41 */
42 MS_ASSISTED = 2,
43 };
44
45 /* Requested recurrence mode for GNSS operation. */
46 enum GnssPositionRecurrence : uint32_t {
47 /** Receive GNSS fixes on a recurring basis at a specified period. */
48 RECURRENCE_PERIODIC = 0,
49 /** Request a single shot GNSS fix. */
50 RECURRENCE_SINGLE = 1
51 };
52
53 /*
54 * Flags used to specify which aiding data to delete when calling
55 * deleteAidingData().
56 */
57 enum GnssAidingData : uint16_t {
58 DELETE_EPHEMERIS = 0x0001,
59 DELETE_ALMANAC = 0x0002,
60 DELETE_POSITION = 0x0004,
61 DELETE_TIME = 0x0008,
62 DELETE_IONO = 0x0010,
63 DELETE_UTC = 0x0020,
64 DELETE_HEALTH = 0x0040,
65 DELETE_SVDIR = 0x0080,
66 DELETE_SVSTEER = 0x0100,
67 DELETE_SADATA = 0x0200,
68 DELETE_RTI = 0x0400,
69 DELETE_CELLDB_INFO = 0x8000,
70 DELETE_ALL = 0xFFFF
71 };
72
73 /*
74 * Opens the interface and provides the callback routines
75 * to the implementation of this interface.
76 *
77 * @param callback Callback interface for IGnss.
78 *
79 * @return success Returns true on success.
80 */
81 setCallback(IGnssCallback callback) generates (bool success);
82
83 /*
84 * Starts navigating.
85 *
86 * @return success Returns true on success.
87 */
88 start() generates (bool success);
89
90 /*
91 * Stops navigating.
92 *
93 * @return success Returns true on success.
94 */
95 stop() generates (bool success);
96
97 /*
98 * Closes the interface.
99 */
100 cleanup();
101
102 /*
103 * Injects the current time.
104 *
105 * @param timeMs This is the UTC time received from the NTP server, its value
106 * is given in milliseconds since January 1, 1970.
107 * @param timeReferenceMs The corresponding value of
108 * SystemClock.elapsedRealtime() from the device when the NTP response was
109 * received in milliseconds.
110 * @param uncertaintyMs Uncertainty associated with the value represented by
111 * time. Represented in milliseconds.
112 *
113 * @return success Returns true if the operation is successful.
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700114 */
Hridya Valsarajue596a712016-09-22 14:07:22 -0700115 injectTime(GnssUtcTime timeMs, int64_t timeReferenceMs, int32_t uncertaintyMs)
116 generates (bool success);
117
118 /*
119 * Injects current location from another location provider (typically cell
120 * ID).
121 *
122 * @param latitudeDegrees Measured in Degrees.
123 * @param longitudeDegrees Measured in Degrees.
124 * @param accuracyMeters Measured in meters.
125 *
126 * @return success Returns true if successful.
127 */
128 injectLocation(double latitudeDegrees, double longitudeDegrees, float accuracyMeters)
129 generates (bool success);
130
131 /*
132 * Specifies that the next call to start will not use the
133 * information defined in the flags. GnssAidingData value of DELETE_ALL is
134 * passed for a cold start.
135 *
136 * @param aidingDataFlags Flags specifying the aiding data to be deleted.
137 */
138 deleteAidingData(GnssAidingData aidingDataFlags);
139
140 /*
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700141 * Sets the GnssPositionMode parameter,its associated recurrence value,
142 * the time between fixes,requested fix accuracy and time to first fix.
143 *
Hridya Valsarajue596a712016-09-22 14:07:22 -0700144 * @param mode Parameter must be one of MS_BASED or STANDALONE.
145 * It is allowed by the platform (and it is recommended) to fallback to
146 * MS_BASED if MS_ASSISTED is passed in, and MS_BASED is supported.
147 * @recurrence GNSS postion recurrence value, either periodic or single.
148 * @param minIntervalMs Represents the time between fixes in milliseconds.
149 * @param preferredAccuracyMeters Represents the requested fix accuracy in meters.
150 * @param preferredTimeMs Represents the requested time to first fix in milliseconds.
151
152 * @return success Returns true if successful.
153 */
154 setPositionMode(GnssPositionMode mode, GnssPositionRecurrence recurrence,
155 uint32_t minIntervalMs, uint32_t preferredAccuracyMeters,
156 uint32_t preferredTimeMs)
157 generates (bool success);
158
159 /*
160 * This method returns the IAGnssRil Interface.
161 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700162 * @return aGnssRilIface Handle to the IAGnssRil interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700163 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700164 getExtensionAGnssRil() generates (IAGnssRil aGnssRilIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700165
166 /*
167 * This method returns the IGnssGeofencing Interface.
168 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700169 * @return gnssGeofencingIface Handle to the IGnssGeofencing interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700170 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700171 getExtensionGnssGeofencing() generates(IGnssGeofencing gnssGeofencingIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700172
173 /*
174 * This method returns the IAGnss Interface.
175 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700176 * @return aGnssIface Handle to the IAGnss interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700177 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700178 getExtensionAGnss() generates (IAGnss aGnssIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700179
180 /*
181 * This method returns the IGnssNi interface.
182 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700183 * @return gnssNiIface Handle to the IGnssNi interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700184 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700185 getExtensionGnssNi() generates (IGnssNi gnssNiIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700186
187 /*
188 * This method returns the IGnssMeasurement interface.
189 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700190 * @return gnssMeasurementIface Handle to the IGnssMeasurement interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700191 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700192 getExtensionGnssMeasurement() generates (IGnssMeasurement gnssMeasurementIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700193
194 /*
195 * This method returns the IGnssNavigationMessage interface.
196 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700197 * @return gnssNavigationIface gnssNavigationIface to the IGnssNavigationMessage interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700198 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700199 getExtensionGnssNavigationMessage() generates (IGnssNavigationMessage gnssNavigationIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700200
201 /*
202 * This method returns the IGnssXtra interface.
203 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700204 * @return xtraIface Handle to the IGnssXtra interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700205 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700206 getExtensionXtra() generates (IGnssXtra xtraIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700207
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700208 /*
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700209 * This method returns the IGnssConfiguration interface.
210 *
211 * @return gnssConfigIface Handle to the IGnssConfiguration interface.
212 */
213 getExtensionGnssConfiguration() generates (IGnssConfiguration gnssConfigIface);
214
215 /*
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700216 * This method returns the IGnssDebug interface.
217 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700218 * @return debugIface Handle to the IGnssDebug interface.
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700219 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700220 getExtensionGnssDebug() generates (IGnssDebug debugIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700221};