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