blob: 5cde79e6f7cf03184b1863be64a2ba56b2cda033 [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;
Wyatt Rileyad03ab22016-12-14 14:54:29 -080021import IGnssBatching;
Hridya Valsaraju49526a72016-10-13 21:09:22 -070022import IGnssCallback;
Hridya Valsaraju273c6d22016-11-02 10:04:35 -070023import IGnssConfiguration;
Hridya Valsaraju49526a72016-10-13 21:09:22 -070024import IGnssDebug;
Hridya Valsarajue596a712016-09-22 14:07:22 -070025import IGnssMeasurement;
26import IGnssNavigationMessage;
Hridya Valsarajue596a712016-09-22 14:07:22 -070027import IGnssGeofencing;
28import IGnssNi;
29import IGnssXtra;
30
Hridya Valsaraju529331c2016-11-22 08:17:23 -080031/* Represents the standard GNSS (Global Navigation Satellite System) interface. */
Hridya Valsarajue596a712016-09-22 14:07:22 -070032interface IGnss {
33 /* Requested operational mode for GNSS operation. */
Hridya Valsaraju529331c2016-11-22 08:17:23 -080034 @export(name="", value_prefix="GPS_POSITION_MODE_")
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070035 enum GnssPositionMode : uint8_t {
Hridya Valsarajue596a712016-09-22 14:07:22 -070036 /** Mode for running GNSS standalone (no assistance). */
37 STANDALONE = 0,
38 /** AGNSS MS-Based mode. */
39 MS_BASED = 1,
40 /*
41 * AGNSS MS-Assisted mode. This mode is not maintained by the platform anymore.
42 * It is strongly recommended to use MS_BASED instead.
43 */
44 MS_ASSISTED = 2,
45 };
46
47 /* Requested recurrence mode for GNSS operation. */
Hridya Valsaraju529331c2016-11-22 08:17:23 -080048 @export(name="", value_prefix="GPS_POSITION_")
Hridya Valsarajue596a712016-09-22 14:07:22 -070049 enum GnssPositionRecurrence : uint32_t {
50 /** Receive GNSS fixes on a recurring basis at a specified period. */
51 RECURRENCE_PERIODIC = 0,
52 /** Request a single shot GNSS fix. */
53 RECURRENCE_SINGLE = 1
54 };
55
56 /*
57 * Flags used to specify which aiding data to delete when calling
58 * deleteAidingData().
59 */
Hridya Valsaraju529331c2016-11-22 08:17:23 -080060 @export(name="", value_prefix="GPS_")
Hridya Valsarajue596a712016-09-22 14:07:22 -070061 enum GnssAidingData : uint16_t {
62 DELETE_EPHEMERIS = 0x0001,
63 DELETE_ALMANAC = 0x0002,
64 DELETE_POSITION = 0x0004,
65 DELETE_TIME = 0x0008,
66 DELETE_IONO = 0x0010,
67 DELETE_UTC = 0x0020,
68 DELETE_HEALTH = 0x0040,
69 DELETE_SVDIR = 0x0080,
70 DELETE_SVSTEER = 0x0100,
71 DELETE_SADATA = 0x0200,
72 DELETE_RTI = 0x0400,
73 DELETE_CELLDB_INFO = 0x8000,
74 DELETE_ALL = 0xFFFF
75 };
76
77 /*
78 * Opens the interface and provides the callback routines
79 * to the implementation of this interface.
80 *
81 * @param callback Callback interface for IGnss.
82 *
83 * @return success Returns true on success.
84 */
85 setCallback(IGnssCallback callback) generates (bool success);
86
87 /*
Wyatt Rileyad03ab22016-12-14 14:54:29 -080088 * Starts a location output stream using the IGnssCallback
89 * gnssLocationCb(), following the settings from the most recent call to
90 * setPositionMode().
91 *
92 * This output must operate independently of any GNSS location batching
93 * operations, see the IGnssBatching.hal for details.
Hridya Valsarajue596a712016-09-22 14:07:22 -070094 *
95 * @return success Returns true on success.
96 */
97 start() generates (bool success);
98
99 /*
Wyatt Rileyad03ab22016-12-14 14:54:29 -0800100 * Stops the location output stream.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700101 *
102 * @return success Returns true on success.
103 */
104 stop() generates (bool success);
105
106 /*
107 * Closes the interface.
108 */
109 cleanup();
110
111 /*
112 * Injects the current time.
113 *
114 * @param timeMs This is the UTC time received from the NTP server, its value
115 * is given in milliseconds since January 1, 1970.
116 * @param timeReferenceMs The corresponding value of
117 * SystemClock.elapsedRealtime() from the device when the NTP response was
118 * received in milliseconds.
119 * @param uncertaintyMs Uncertainty associated with the value represented by
120 * time. Represented in milliseconds.
121 *
122 * @return success Returns true if the operation is successful.
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700123 */
Hridya Valsarajue596a712016-09-22 14:07:22 -0700124 injectTime(GnssUtcTime timeMs, int64_t timeReferenceMs, int32_t uncertaintyMs)
125 generates (bool success);
126
127 /*
128 * Injects current location from another location provider (typically cell
129 * ID).
130 *
131 * @param latitudeDegrees Measured in Degrees.
132 * @param longitudeDegrees Measured in Degrees.
133 * @param accuracyMeters Measured in meters.
134 *
135 * @return success Returns true if successful.
136 */
137 injectLocation(double latitudeDegrees, double longitudeDegrees, float accuracyMeters)
138 generates (bool success);
139
140 /*
141 * Specifies that the next call to start will not use the
142 * information defined in the flags. GnssAidingData value of DELETE_ALL is
143 * passed for a cold start.
144 *
145 * @param aidingDataFlags Flags specifying the aiding data to be deleted.
146 */
147 deleteAidingData(GnssAidingData aidingDataFlags);
148
149 /*
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700150 * Sets the GnssPositionMode parameter,its associated recurrence value,
151 * the time between fixes,requested fix accuracy and time to first fix.
152 *
Hridya Valsarajue596a712016-09-22 14:07:22 -0700153 * @param mode Parameter must be one of MS_BASED or STANDALONE.
154 * It is allowed by the platform (and it is recommended) to fallback to
155 * MS_BASED if MS_ASSISTED is passed in, and MS_BASED is supported.
156 * @recurrence GNSS postion recurrence value, either periodic or single.
157 * @param minIntervalMs Represents the time between fixes in milliseconds.
158 * @param preferredAccuracyMeters Represents the requested fix accuracy in meters.
159 * @param preferredTimeMs Represents the requested time to first fix in milliseconds.
160
161 * @return success Returns true if successful.
162 */
163 setPositionMode(GnssPositionMode mode, GnssPositionRecurrence recurrence,
164 uint32_t minIntervalMs, uint32_t preferredAccuracyMeters,
165 uint32_t preferredTimeMs)
166 generates (bool success);
167
168 /*
169 * This method returns the IAGnssRil Interface.
170 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700171 * @return aGnssRilIface Handle to the IAGnssRil interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700172 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700173 getExtensionAGnssRil() generates (IAGnssRil aGnssRilIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700174
175 /*
176 * This method returns the IGnssGeofencing Interface.
177 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700178 * @return gnssGeofencingIface Handle to the IGnssGeofencing interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700179 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700180 getExtensionGnssGeofencing() generates(IGnssGeofencing gnssGeofencingIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700181
182 /*
183 * This method returns the IAGnss Interface.
184 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700185 * @return aGnssIface Handle to the IAGnss interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700186 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700187 getExtensionAGnss() generates (IAGnss aGnssIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700188
189 /*
190 * This method returns the IGnssNi interface.
191 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700192 * @return gnssNiIface Handle to the IGnssNi interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700193 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700194 getExtensionGnssNi() generates (IGnssNi gnssNiIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700195
196 /*
197 * This method returns the IGnssMeasurement interface.
198 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700199 * @return gnssMeasurementIface Handle to the IGnssMeasurement interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700200 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700201 getExtensionGnssMeasurement() generates (IGnssMeasurement gnssMeasurementIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700202
203 /*
204 * This method returns the IGnssNavigationMessage interface.
205 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700206 * @return gnssNavigationIface gnssNavigationIface to the IGnssNavigationMessage interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700207 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700208 getExtensionGnssNavigationMessage() generates (IGnssNavigationMessage gnssNavigationIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700209
210 /*
211 * This method returns the IGnssXtra interface.
212 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700213 * @return xtraIface Handle to the IGnssXtra interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700214 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700215 getExtensionXtra() generates (IGnssXtra xtraIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700216
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700217 /*
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700218 * This method returns the IGnssConfiguration interface.
219 *
220 * @return gnssConfigIface Handle to the IGnssConfiguration interface.
221 */
222 getExtensionGnssConfiguration() generates (IGnssConfiguration gnssConfigIface);
223
224 /*
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700225 * This method returns the IGnssDebug interface.
226 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700227 * @return debugIface Handle to the IGnssDebug interface.
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700228 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700229 getExtensionGnssDebug() generates (IGnssDebug debugIface);
Wyatt Rileyad03ab22016-12-14 14:54:29 -0800230
231 /*
232 * This method returns the IGnssBatching interface.
233 *
234 * @return batchingIface Handle to the IGnssBatching interface.
235 */
236 getExtensionGnssBatching() generates (IGnssBatching batchingIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700237};