Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.hardware.gnss@1.0; |
| 18 | |
| 19 | import IAGnss; |
| 20 | import IAGnssRil; |
Wyatt Riley | ad03ab2 | 2016-12-14 14:54:29 -0800 | [diff] [blame] | 21 | import IGnssBatching; |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 22 | import IGnssCallback; |
Hridya Valsaraju | 273c6d2 | 2016-11-02 10:04:35 -0700 | [diff] [blame] | 23 | import IGnssConfiguration; |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 24 | import IGnssDebug; |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 25 | import IGnssMeasurement; |
| 26 | import IGnssNavigationMessage; |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 27 | import IGnssGeofencing; |
| 28 | import IGnssNi; |
| 29 | import IGnssXtra; |
| 30 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 31 | /** Represents the standard GNSS (Global Navigation Satellite System) interface. */ |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 32 | interface IGnss { |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 33 | /** Requested operational mode for GNSS operation. */ |
Hridya Valsaraju | 529331c | 2016-11-22 08:17:23 -0800 | [diff] [blame] | 34 | @export(name="", value_prefix="GPS_POSITION_MODE_") |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 35 | enum GnssPositionMode : uint8_t { |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 36 | /** Mode for running GNSS standalone (no assistance). */ |
| 37 | STANDALONE = 0, |
| 38 | /** AGNSS MS-Based mode. */ |
| 39 | MS_BASED = 1, |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 40 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 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 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 47 | /** Requested recurrence mode for GNSS operation. */ |
Hridya Valsaraju | 529331c | 2016-11-22 08:17:23 -0800 | [diff] [blame] | 48 | @export(name="", value_prefix="GPS_POSITION_") |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 49 | 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 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 56 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 57 | * Flags used to specify which aiding data to delete when calling |
| 58 | * deleteAidingData(). |
| 59 | */ |
Hridya Valsaraju | 529331c | 2016-11-22 08:17:23 -0800 | [diff] [blame] | 60 | @export(name="", value_prefix="GPS_") |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 61 | 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 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 77 | /** |
Anil Admal | 2f28bb0 | 2019-05-09 09:19:54 -0700 | [diff] [blame] | 78 | * Opens the interface and provides the callback routines to the implementation of this |
| 79 | * interface. |
| 80 | * |
| 81 | * The framework calls this method to instruct the GPS engine to prepare for serving requests |
| 82 | * from the framework. The GNSS HAL implementation must respond to all GNSS requests from the |
| 83 | * framework upon successful return from this method until cleanup() method is called to |
| 84 | * close this interface. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 85 | * |
| 86 | * @param callback Callback interface for IGnss. |
| 87 | * |
| 88 | * @return success Returns true on success. |
| 89 | */ |
| 90 | setCallback(IGnssCallback callback) generates (bool success); |
| 91 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 92 | /** |
Wyatt Riley | ad03ab2 | 2016-12-14 14:54:29 -0800 | [diff] [blame] | 93 | * Starts a location output stream using the IGnssCallback |
| 94 | * gnssLocationCb(), following the settings from the most recent call to |
| 95 | * setPositionMode(). |
| 96 | * |
| 97 | * This output must operate independently of any GNSS location batching |
| 98 | * operations, see the IGnssBatching.hal for details. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 99 | * |
| 100 | * @return success Returns true on success. |
| 101 | */ |
| 102 | start() generates (bool success); |
| 103 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 104 | /** |
Wyatt Riley | ad03ab2 | 2016-12-14 14:54:29 -0800 | [diff] [blame] | 105 | * Stops the location output stream. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 106 | * |
| 107 | * @return success Returns true on success. |
| 108 | */ |
| 109 | stop() generates (bool success); |
| 110 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 111 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 112 | * Closes the interface. |
Anil Admal | 2f28bb0 | 2019-05-09 09:19:54 -0700 | [diff] [blame] | 113 | * |
| 114 | * The cleanup() method is called by the framework to tell the GNSS HAL implementation to |
| 115 | * not expect any GNSS requests in the immediate future - e.g. this may be called when |
| 116 | * location is disabled by a user setting or low battery conditions. The GNSS HAL |
| 117 | * implementation must immediately stop responding to any existing requests until the |
| 118 | * setCallback() method is called again and the requests are re-initiated by the framework. |
| 119 | * |
| 120 | * After this method is called, the GNSS HAL implementation may choose to modify GNSS hardware |
| 121 | * states to save power. It is expected that when setCallback() method is called again to |
| 122 | * reopen this interface, to serve requests, there may be some minor delays in GNSS response |
| 123 | * requests as hardware readiness states are restored, not to exceed those that occur on normal |
| 124 | * device boot up. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 125 | */ |
| 126 | cleanup(); |
| 127 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 128 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 129 | * Injects the current time. |
| 130 | * |
| 131 | * @param timeMs This is the UTC time received from the NTP server, its value |
| 132 | * is given in milliseconds since January 1, 1970. |
| 133 | * @param timeReferenceMs The corresponding value of |
| 134 | * SystemClock.elapsedRealtime() from the device when the NTP response was |
| 135 | * received in milliseconds. |
| 136 | * @param uncertaintyMs Uncertainty associated with the value represented by |
| 137 | * time. Represented in milliseconds. |
| 138 | * |
| 139 | * @return success Returns true if the operation is successful. |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 140 | */ |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 141 | injectTime(GnssUtcTime timeMs, int64_t timeReferenceMs, int32_t uncertaintyMs) |
| 142 | generates (bool success); |
| 143 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 144 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 145 | * Injects current location from another location provider (typically cell |
| 146 | * ID). |
| 147 | * |
| 148 | * @param latitudeDegrees Measured in Degrees. |
| 149 | * @param longitudeDegrees Measured in Degrees. |
| 150 | * @param accuracyMeters Measured in meters. |
| 151 | * |
| 152 | * @return success Returns true if successful. |
| 153 | */ |
| 154 | injectLocation(double latitudeDegrees, double longitudeDegrees, float accuracyMeters) |
| 155 | generates (bool success); |
| 156 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 157 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 158 | * Specifies that the next call to start will not use the |
| 159 | * information defined in the flags. GnssAidingData value of DELETE_ALL is |
| 160 | * passed for a cold start. |
| 161 | * |
| 162 | * @param aidingDataFlags Flags specifying the aiding data to be deleted. |
| 163 | */ |
| 164 | deleteAidingData(GnssAidingData aidingDataFlags); |
| 165 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 166 | /** |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 167 | * Sets the GnssPositionMode parameter,its associated recurrence value, |
| 168 | * the time between fixes,requested fix accuracy and time to first fix. |
| 169 | * |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 170 | * @param mode Parameter must be one of MS_BASED or STANDALONE. |
| 171 | * It is allowed by the platform (and it is recommended) to fallback to |
| 172 | * MS_BASED if MS_ASSISTED is passed in, and MS_BASED is supported. |
Anil Admal | 2f28bb0 | 2019-05-09 09:19:54 -0700 | [diff] [blame] | 173 | * @recurrence GNSS position recurrence value, either periodic or single. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 174 | * @param minIntervalMs Represents the time between fixes in milliseconds. |
| 175 | * @param preferredAccuracyMeters Represents the requested fix accuracy in meters. |
| 176 | * @param preferredTimeMs Represents the requested time to first fix in milliseconds. |
| 177 | |
| 178 | * @return success Returns true if successful. |
| 179 | */ |
| 180 | setPositionMode(GnssPositionMode mode, GnssPositionRecurrence recurrence, |
| 181 | uint32_t minIntervalMs, uint32_t preferredAccuracyMeters, |
| 182 | uint32_t preferredTimeMs) |
| 183 | generates (bool success); |
| 184 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 185 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 186 | * This method returns the IAGnssRil Interface. |
| 187 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 188 | * @return aGnssRilIface Handle to the IAGnssRil interface. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 189 | */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 190 | getExtensionAGnssRil() generates (IAGnssRil aGnssRilIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 191 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 192 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 193 | * This method returns the IGnssGeofencing Interface. |
| 194 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 195 | * @return gnssGeofencingIface Handle to the IGnssGeofencing interface. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 196 | */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 197 | getExtensionGnssGeofencing() generates(IGnssGeofencing gnssGeofencingIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 198 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 199 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 200 | * This method returns the IAGnss Interface. |
| 201 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 202 | * @return aGnssIface Handle to the IAGnss interface. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 203 | */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 204 | getExtensionAGnss() generates (IAGnss aGnssIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 205 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 206 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 207 | * This method returns the IGnssNi interface. |
| 208 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 209 | * @return gnssNiIface Handle to the IGnssNi interface. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 210 | */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 211 | getExtensionGnssNi() generates (IGnssNi gnssNiIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 212 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 213 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 214 | * This method returns the IGnssMeasurement interface. |
| 215 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 216 | * @return gnssMeasurementIface Handle to the IGnssMeasurement interface. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 217 | */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 218 | getExtensionGnssMeasurement() generates (IGnssMeasurement gnssMeasurementIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 219 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 220 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 221 | * This method returns the IGnssNavigationMessage interface. |
| 222 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 223 | * @return gnssNavigationIface gnssNavigationIface to the IGnssNavigationMessage interface. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 224 | */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 225 | getExtensionGnssNavigationMessage() generates (IGnssNavigationMessage gnssNavigationIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 226 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 227 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 228 | * This method returns the IGnssXtra interface. |
| 229 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 230 | * @return xtraIface Handle to the IGnssXtra interface. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 231 | */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 232 | getExtensionXtra() generates (IGnssXtra xtraIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 233 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 234 | /** |
Hridya Valsaraju | 273c6d2 | 2016-11-02 10:04:35 -0700 | [diff] [blame] | 235 | * This method returns the IGnssConfiguration interface. |
| 236 | * |
| 237 | * @return gnssConfigIface Handle to the IGnssConfiguration interface. |
| 238 | */ |
| 239 | getExtensionGnssConfiguration() generates (IGnssConfiguration gnssConfigIface); |
| 240 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 241 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 242 | * This method returns the IGnssDebug interface. |
| 243 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 244 | * @return debugIface Handle to the IGnssDebug interface. |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 245 | */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 246 | getExtensionGnssDebug() generates (IGnssDebug debugIface); |
Wyatt Riley | ad03ab2 | 2016-12-14 14:54:29 -0800 | [diff] [blame] | 247 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 248 | /** |
Wyatt Riley | ad03ab2 | 2016-12-14 14:54:29 -0800 | [diff] [blame] | 249 | * This method returns the IGnssBatching interface. |
| 250 | * |
| 251 | * @return batchingIface Handle to the IGnssBatching interface. |
| 252 | */ |
| 253 | getExtensionGnssBatching() generates (IGnssBatching batchingIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 254 | }; |