blob: 0f16124070db9dfc29211cead55484fa7e9ecbf7 [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;
21import IGnssMeasurement;
22import IGnssNavigationMessage;
23import IGnssCallback;
24import IGnssGeofencing;
25import IGnssNi;
26import IGnssXtra;
27
28/* Represents the standard GNSS interface. */
29interface IGnss {
30 /* Requested operational mode for GNSS operation. */
31 enum GnssPositionMode : uint32_t {
32 /** Mode for running GNSS standalone (no assistance). */
33 STANDALONE = 0,
34 /** AGNSS MS-Based mode. */
35 MS_BASED = 1,
36 /*
37 * AGNSS MS-Assisted mode. This mode is not maintained by the platform anymore.
38 * It is strongly recommended to use MS_BASED instead.
39 */
40 MS_ASSISTED = 2,
41 };
42
43 /* Requested recurrence mode for GNSS operation. */
44 enum GnssPositionRecurrence : uint32_t {
45 /** Receive GNSS fixes on a recurring basis at a specified period. */
46 RECURRENCE_PERIODIC = 0,
47 /** Request a single shot GNSS fix. */
48 RECURRENCE_SINGLE = 1
49 };
50
51 /*
52 * Flags used to specify which aiding data to delete when calling
53 * deleteAidingData().
54 */
55 enum GnssAidingData : uint16_t {
56 DELETE_EPHEMERIS = 0x0001,
57 DELETE_ALMANAC = 0x0002,
58 DELETE_POSITION = 0x0004,
59 DELETE_TIME = 0x0008,
60 DELETE_IONO = 0x0010,
61 DELETE_UTC = 0x0020,
62 DELETE_HEALTH = 0x0040,
63 DELETE_SVDIR = 0x0080,
64 DELETE_SVSTEER = 0x0100,
65 DELETE_SADATA = 0x0200,
66 DELETE_RTI = 0x0400,
67 DELETE_CELLDB_INFO = 0x8000,
68 DELETE_ALL = 0xFFFF
69 };
70
71 /*
72 * Opens the interface and provides the callback routines
73 * to the implementation of this interface.
74 *
75 * @param callback Callback interface for IGnss.
76 *
77 * @return success Returns true on success.
78 */
79 setCallback(IGnssCallback callback) generates (bool success);
80
81 /*
82 * Starts navigating.
83 *
84 * @return success Returns true on success.
85 */
86 start() generates (bool success);
87
88 /*
89 * Stops navigating.
90 *
91 * @return success Returns true on success.
92 */
93 stop() generates (bool success);
94
95 /*
96 * Closes the interface.
97 */
98 cleanup();
99
100 /*
101 * Injects the current time.
102 *
103 * @param timeMs This is the UTC time received from the NTP server, its value
104 * is given in milliseconds since January 1, 1970.
105 * @param timeReferenceMs The corresponding value of
106 * SystemClock.elapsedRealtime() from the device when the NTP response was
107 * received in milliseconds.
108 * @param uncertaintyMs Uncertainty associated with the value represented by
109 * time. Represented in milliseconds.
110 *
111 * @return success Returns true if the operation is successful.
112 *
113 injectTime(GnssUtcTime timeMs, int64_t timeReferenceMs, int32_t uncertaintyMs)
114 generates (bool success);
115
116 /*
117 * Injects current location from another location provider (typically cell
118 * ID).
119 *
120 * @param latitudeDegrees Measured in Degrees.
121 * @param longitudeDegrees Measured in Degrees.
122 * @param accuracyMeters Measured in meters.
123 *
124 * @return success Returns true if successful.
125 */
126 injectLocation(double latitudeDegrees, double longitudeDegrees, float accuracyMeters)
127 generates (bool success);
128
129 /*
130 * Specifies that the next call to start will not use the
131 * information defined in the flags. GnssAidingData value of DELETE_ALL is
132 * passed for a cold start.
133 *
134 * @param aidingDataFlags Flags specifying the aiding data to be deleted.
135 */
136 deleteAidingData(GnssAidingData aidingDataFlags);
137
138 /*
139 * @param mode Parameter must be one of MS_BASED or STANDALONE.
140 * It is allowed by the platform (and it is recommended) to fallback to
141 * MS_BASED if MS_ASSISTED is passed in, and MS_BASED is supported.
142 * @recurrence GNSS postion recurrence value, either periodic or single.
143 * @param minIntervalMs Represents the time between fixes in milliseconds.
144 * @param preferredAccuracyMeters Represents the requested fix accuracy in meters.
145 * @param preferredTimeMs Represents the requested time to first fix in milliseconds.
146
147 * @return success Returns true if successful.
148 */
149 setPositionMode(GnssPositionMode mode, GnssPositionRecurrence recurrence,
150 uint32_t minIntervalMs, uint32_t preferredAccuracyMeters,
151 uint32_t preferredTimeMs)
152 generates (bool success);
153
154 /*
155 * This method returns the IAGnssRil Interface.
156 *
157 * @return infc Handle to the IAGnssRil interface.
158 */
159 getExtensionAGnssRil() generates (IAGnssRil infc);
160
161 /*
162 * This method returns the IGnssGeofencing Interface.
163 *
164 * @return infc Handle to the IGnssGeofencing interface.
165 */
166 getExtensionGnssGeofencing() generates(IGnssGeofencing infc);
167
168 /*
169 * This method returns the IAGnss Interface.
170 *
171 * @return infc Handle to the IAGnss interface.
172 */
173 getExtensionAGnss() generates (IAGnss infc);
174
175 /*
176 * This method returns the IGnssNi interface.
177 *
178 * @return infc Handle to the IGnssNi interface.
179 */
180 getExtensionGnssNi() generates (IGnssNi infc);
181
182 /*
183 * This method returns the IGnssMeasurement interface.
184 *
185 * @return infc Handle to the IGnssMeasurement interface.
186 */
187 getExtensionGnssMeasurement() generates (IGnssMeasurement infc);
188
189 /*
190 * This method returns the IGnssNavigationMessage interface.
191 *
192 * @return infc Handle to the IGnssNavigationMessage interface.
193 */
194 getExtensionGnssNavigationMessage() generates (IGnssNavigationMessage infc);
195
196 /*
197 * This method returns the IGnssXtra interface.
198 *
199 * @return infc Handle to the IGnssXtra interface.
200 */
201 getExtensionXtra() generates (IGnssXtra infc);
202
203};