blob: 24a537133202f76b6791a834ccbc5366805986f9 [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
31/* Represents the standard GNSS interface. */
32interface IGnss {
33 /* Requested operational mode for GNSS operation. */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070034 enum GnssPositionMode : uint8_t {
Hridya Valsarajue596a712016-09-22 14:07:22 -070035 /** Mode for running GNSS standalone (no assistance). */
36 STANDALONE = 0,
37 /** AGNSS MS-Based mode. */
38 MS_BASED = 1,
39 /*
40 * AGNSS MS-Assisted mode. This mode is not maintained by the platform anymore.
41 * It is strongly recommended to use MS_BASED instead.
42 */
43 MS_ASSISTED = 2,
44 };
45
46 /* Requested recurrence mode for GNSS operation. */
47 enum GnssPositionRecurrence : uint32_t {
48 /** Receive GNSS fixes on a recurring basis at a specified period. */
49 RECURRENCE_PERIODIC = 0,
50 /** Request a single shot GNSS fix. */
51 RECURRENCE_SINGLE = 1
52 };
53
54 /*
55 * Flags used to specify which aiding data to delete when calling
56 * deleteAidingData().
57 */
58 enum GnssAidingData : uint16_t {
59 DELETE_EPHEMERIS = 0x0001,
60 DELETE_ALMANAC = 0x0002,
61 DELETE_POSITION = 0x0004,
62 DELETE_TIME = 0x0008,
63 DELETE_IONO = 0x0010,
64 DELETE_UTC = 0x0020,
65 DELETE_HEALTH = 0x0040,
66 DELETE_SVDIR = 0x0080,
67 DELETE_SVSTEER = 0x0100,
68 DELETE_SADATA = 0x0200,
69 DELETE_RTI = 0x0400,
70 DELETE_CELLDB_INFO = 0x8000,
71 DELETE_ALL = 0xFFFF
72 };
73
74 /*
75 * Opens the interface and provides the callback routines
76 * to the implementation of this interface.
77 *
78 * @param callback Callback interface for IGnss.
79 *
80 * @return success Returns true on success.
81 */
82 setCallback(IGnssCallback callback) generates (bool success);
83
84 /*
Wyatt Rileyad03ab22016-12-14 14:54:29 -080085 * Starts a location output stream using the IGnssCallback
86 * gnssLocationCb(), following the settings from the most recent call to
87 * setPositionMode().
88 *
89 * This output must operate independently of any GNSS location batching
90 * operations, see the IGnssBatching.hal for details.
Hridya Valsarajue596a712016-09-22 14:07:22 -070091 *
92 * @return success Returns true on success.
93 */
94 start() generates (bool success);
95
96 /*
Wyatt Rileyad03ab22016-12-14 14:54:29 -080097 * Stops the location output stream.
Hridya Valsarajue596a712016-09-22 14:07:22 -070098 *
99 * @return success Returns true on success.
100 */
101 stop() generates (bool success);
102
103 /*
104 * Closes the interface.
105 */
106 cleanup();
107
108 /*
109 * Injects the current time.
110 *
111 * @param timeMs This is the UTC time received from the NTP server, its value
112 * is given in milliseconds since January 1, 1970.
113 * @param timeReferenceMs The corresponding value of
114 * SystemClock.elapsedRealtime() from the device when the NTP response was
115 * received in milliseconds.
116 * @param uncertaintyMs Uncertainty associated with the value represented by
117 * time. Represented in milliseconds.
118 *
119 * @return success Returns true if the operation is successful.
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700120 */
Hridya Valsarajue596a712016-09-22 14:07:22 -0700121 injectTime(GnssUtcTime timeMs, int64_t timeReferenceMs, int32_t uncertaintyMs)
122 generates (bool success);
123
124 /*
125 * Injects current location from another location provider (typically cell
126 * ID).
127 *
128 * @param latitudeDegrees Measured in Degrees.
129 * @param longitudeDegrees Measured in Degrees.
130 * @param accuracyMeters Measured in meters.
131 *
132 * @return success Returns true if successful.
133 */
134 injectLocation(double latitudeDegrees, double longitudeDegrees, float accuracyMeters)
135 generates (bool success);
136
137 /*
138 * Specifies that the next call to start will not use the
139 * information defined in the flags. GnssAidingData value of DELETE_ALL is
140 * passed for a cold start.
141 *
142 * @param aidingDataFlags Flags specifying the aiding data to be deleted.
143 */
144 deleteAidingData(GnssAidingData aidingDataFlags);
145
146 /*
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700147 * Sets the GnssPositionMode parameter,its associated recurrence value,
148 * the time between fixes,requested fix accuracy and time to first fix.
149 *
Hridya Valsarajue596a712016-09-22 14:07:22 -0700150 * @param mode Parameter must be one of MS_BASED or STANDALONE.
151 * It is allowed by the platform (and it is recommended) to fallback to
152 * MS_BASED if MS_ASSISTED is passed in, and MS_BASED is supported.
153 * @recurrence GNSS postion recurrence value, either periodic or single.
154 * @param minIntervalMs Represents the time between fixes in milliseconds.
155 * @param preferredAccuracyMeters Represents the requested fix accuracy in meters.
156 * @param preferredTimeMs Represents the requested time to first fix in milliseconds.
157
158 * @return success Returns true if successful.
159 */
160 setPositionMode(GnssPositionMode mode, GnssPositionRecurrence recurrence,
161 uint32_t minIntervalMs, uint32_t preferredAccuracyMeters,
162 uint32_t preferredTimeMs)
163 generates (bool success);
164
165 /*
166 * This method returns the IAGnssRil Interface.
167 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700168 * @return aGnssRilIface Handle to the IAGnssRil interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700169 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700170 getExtensionAGnssRil() generates (IAGnssRil aGnssRilIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700171
172 /*
173 * This method returns the IGnssGeofencing Interface.
174 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700175 * @return gnssGeofencingIface Handle to the IGnssGeofencing interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700176 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700177 getExtensionGnssGeofencing() generates(IGnssGeofencing gnssGeofencingIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700178
179 /*
180 * This method returns the IAGnss Interface.
181 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700182 * @return aGnssIface Handle to the IAGnss interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700183 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700184 getExtensionAGnss() generates (IAGnss aGnssIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700185
186 /*
187 * This method returns the IGnssNi interface.
188 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700189 * @return gnssNiIface Handle to the IGnssNi interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700190 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700191 getExtensionGnssNi() generates (IGnssNi gnssNiIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700192
193 /*
194 * This method returns the IGnssMeasurement interface.
195 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700196 * @return gnssMeasurementIface Handle to the IGnssMeasurement interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700197 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700198 getExtensionGnssMeasurement() generates (IGnssMeasurement gnssMeasurementIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700199
200 /*
201 * This method returns the IGnssNavigationMessage interface.
202 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700203 * @return gnssNavigationIface gnssNavigationIface to the IGnssNavigationMessage interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700204 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700205 getExtensionGnssNavigationMessage() generates (IGnssNavigationMessage gnssNavigationIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700206
207 /*
208 * This method returns the IGnssXtra interface.
209 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700210 * @return xtraIface Handle to the IGnssXtra interface.
Hridya Valsarajue596a712016-09-22 14:07:22 -0700211 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700212 getExtensionXtra() generates (IGnssXtra xtraIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700213
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700214 /*
Hridya Valsaraju273c6d22016-11-02 10:04:35 -0700215 * This method returns the IGnssConfiguration interface.
216 *
217 * @return gnssConfigIface Handle to the IGnssConfiguration interface.
218 */
219 getExtensionGnssConfiguration() generates (IGnssConfiguration gnssConfigIface);
220
221 /*
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700222 * This method returns the IGnssDebug interface.
223 *
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700224 * @return debugIface Handle to the IGnssDebug interface.
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700225 */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -0700226 getExtensionGnssDebug() generates (IGnssDebug debugIface);
Wyatt Rileyad03ab22016-12-14 14:54:29 -0800227
228 /*
229 * This method returns the IGnssBatching interface.
230 *
231 * @return batchingIface Handle to the IGnssBatching interface.
232 */
233 getExtensionGnssBatching() generates (IGnssBatching batchingIface);
Hridya Valsarajue596a712016-09-22 14:07:22 -0700234};