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; |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 21 | import IGnssCallback; |
| 22 | import IGnssDebug; |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 23 | import IGnssMeasurement; |
| 24 | import IGnssNavigationMessage; |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 25 | import IGnssGeofencing; |
| 26 | import IGnssNi; |
| 27 | import IGnssXtra; |
| 28 | |
| 29 | /* Represents the standard GNSS interface. */ |
| 30 | interface IGnss { |
| 31 | /* Requested operational mode for GNSS operation. */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame^] | 32 | enum GnssPositionMode : uint8_t { |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 33 | /** 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 Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame^] | 113 | */ |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 114 | 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 Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame^] | 140 | * Sets the GnssPositionMode parameter,its associated recurrence value, |
| 141 | * the time between fixes,requested fix accuracy and time to first fix. |
| 142 | * |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 143 | * @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 Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame^] | 161 | * @return aGnssRilIface Handle to the IAGnssRil interface. |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 162 | */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame^] | 163 | getExtensionAGnssRil() generates (IAGnssRil aGnssRilIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 164 | |
| 165 | /* |
| 166 | * This method returns the IGnssGeofencing Interface. |
| 167 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame^] | 168 | * @return gnssGeofencingIface Handle to the IGnssGeofencing 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 | getExtensionGnssGeofencing() generates(IGnssGeofencing gnssGeofencingIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 171 | |
| 172 | /* |
| 173 | * This method returns the IAGnss Interface. |
| 174 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame^] | 175 | * @return aGnssIface Handle to the IAGnss 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 | getExtensionAGnss() generates (IAGnss aGnssIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 178 | |
| 179 | /* |
| 180 | * This method returns the IGnssNi interface. |
| 181 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame^] | 182 | * @return gnssNiIface Handle to the IGnssNi 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 | getExtensionGnssNi() generates (IGnssNi gnssNiIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 185 | |
| 186 | /* |
| 187 | * This method returns the IGnssMeasurement interface. |
| 188 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame^] | 189 | * @return gnssMeasurementIface Handle to the IGnssMeasurement 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 | getExtensionGnssMeasurement() generates (IGnssMeasurement gnssMeasurementIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 192 | |
| 193 | /* |
| 194 | * This method returns the IGnssNavigationMessage interface. |
| 195 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame^] | 196 | * @return gnssNavigationIface gnssNavigationIface to the IGnssNavigationMessage 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 | getExtensionGnssNavigationMessage() generates (IGnssNavigationMessage gnssNavigationIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 199 | |
| 200 | /* |
| 201 | * This method returns the IGnssXtra interface. |
| 202 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame^] | 203 | * @return xtraIface Handle to the IGnssXtra 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 | getExtensionXtra() generates (IGnssXtra xtraIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 206 | |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 207 | /* |
| 208 | * This method returns the IGnssDebug interface. |
| 209 | * |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame^] | 210 | * @return debugIface Handle to the IGnssDebug interface. |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 211 | */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame^] | 212 | getExtensionGnssDebug() generates (IGnssDebug debugIface); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 213 | }; |