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 | |
| 31 | /* Represents the standard GNSS interface. */ |
| 32 | interface IGnss { |
| 33 | /* Requested operational mode for GNSS operation. */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 34 | enum GnssPositionMode : uint8_t { |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 35 | /** 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 Riley | ad03ab2 | 2016-12-14 14:54:29 -0800 | [diff] [blame^] | 85 | * 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 Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 91 | * |
| 92 | * @return success Returns true on success. |
| 93 | */ |
| 94 | start() generates (bool success); |
| 95 | |
| 96 | /* |
Wyatt Riley | ad03ab2 | 2016-12-14 14:54:29 -0800 | [diff] [blame^] | 97 | * Stops the location output stream. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 98 | * |
| 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 Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 120 | */ |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 121 | 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 Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 147 | * Sets the GnssPositionMode parameter,its associated recurrence value, |
| 148 | * the time between fixes,requested fix accuracy and time to first fix. |
| 149 | * |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 150 | * @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 Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 168 | * @return aGnssRilIface Handle to the IAGnssRil interface. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 169 | */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 170 | getExtensionAGnssRil() generates (IAGnssRil aGnssRilIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 171 | |
| 172 | /* |
| 173 | * This method returns the IGnssGeofencing Interface. |
| 174 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 175 | * @return gnssGeofencingIface Handle to the IGnssGeofencing interface. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 176 | */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 177 | getExtensionGnssGeofencing() generates(IGnssGeofencing gnssGeofencingIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 178 | |
| 179 | /* |
| 180 | * This method returns the IAGnss Interface. |
| 181 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 182 | * @return aGnssIface Handle to the IAGnss interface. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 183 | */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 184 | getExtensionAGnss() generates (IAGnss aGnssIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 185 | |
| 186 | /* |
| 187 | * This method returns the IGnssNi interface. |
| 188 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 189 | * @return gnssNiIface Handle to the IGnssNi interface. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 190 | */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 191 | getExtensionGnssNi() generates (IGnssNi gnssNiIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 192 | |
| 193 | /* |
| 194 | * This method returns the IGnssMeasurement interface. |
| 195 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 196 | * @return gnssMeasurementIface Handle to the IGnssMeasurement interface. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 197 | */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 198 | getExtensionGnssMeasurement() generates (IGnssMeasurement gnssMeasurementIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 199 | |
| 200 | /* |
| 201 | * This method returns the IGnssNavigationMessage interface. |
| 202 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 203 | * @return gnssNavigationIface gnssNavigationIface to the IGnssNavigationMessage interface. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 204 | */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 205 | getExtensionGnssNavigationMessage() generates (IGnssNavigationMessage gnssNavigationIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 206 | |
| 207 | /* |
| 208 | * This method returns the IGnssXtra interface. |
| 209 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 210 | * @return xtraIface Handle to the IGnssXtra interface. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 211 | */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 212 | getExtensionXtra() generates (IGnssXtra xtraIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 213 | |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 214 | /* |
Hridya Valsaraju | 273c6d2 | 2016-11-02 10:04:35 -0700 | [diff] [blame] | 215 | * This method returns the IGnssConfiguration interface. |
| 216 | * |
| 217 | * @return gnssConfigIface Handle to the IGnssConfiguration interface. |
| 218 | */ |
| 219 | getExtensionGnssConfiguration() generates (IGnssConfiguration gnssConfigIface); |
| 220 | |
| 221 | /* |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 222 | * This method returns the IGnssDebug interface. |
| 223 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 224 | * @return debugIface Handle to the IGnssDebug interface. |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 225 | */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 226 | getExtensionGnssDebug() generates (IGnssDebug debugIface); |
Wyatt Riley | ad03ab2 | 2016-12-14 14:54:29 -0800 | [diff] [blame^] | 227 | |
| 228 | /* |
| 229 | * This method returns the IGnssBatching interface. |
| 230 | * |
| 231 | * @return batchingIface Handle to the IGnssBatching interface. |
| 232 | */ |
| 233 | getExtensionGnssBatching() generates (IGnssBatching batchingIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 234 | }; |