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. */ |
| 32 | enum GnssPositionMode : uint32_t { |
| 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. |
| 113 | * |
| 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 | /* |
| 140 | * @param mode Parameter must be one of MS_BASED or STANDALONE. |
| 141 | * It is allowed by the platform (and it is recommended) to fallback to |
| 142 | * MS_BASED if MS_ASSISTED is passed in, and MS_BASED is supported. |
| 143 | * @recurrence GNSS postion recurrence value, either periodic or single. |
| 144 | * @param minIntervalMs Represents the time between fixes in milliseconds. |
| 145 | * @param preferredAccuracyMeters Represents the requested fix accuracy in meters. |
| 146 | * @param preferredTimeMs Represents the requested time to first fix in milliseconds. |
| 147 | |
| 148 | * @return success Returns true if successful. |
| 149 | */ |
| 150 | setPositionMode(GnssPositionMode mode, GnssPositionRecurrence recurrence, |
| 151 | uint32_t minIntervalMs, uint32_t preferredAccuracyMeters, |
| 152 | uint32_t preferredTimeMs) |
| 153 | generates (bool success); |
| 154 | |
| 155 | /* |
| 156 | * This method returns the IAGnssRil Interface. |
| 157 | * |
| 158 | * @return infc Handle to the IAGnssRil interface. |
| 159 | */ |
| 160 | getExtensionAGnssRil() generates (IAGnssRil infc); |
| 161 | |
| 162 | /* |
| 163 | * This method returns the IGnssGeofencing Interface. |
| 164 | * |
| 165 | * @return infc Handle to the IGnssGeofencing interface. |
| 166 | */ |
| 167 | getExtensionGnssGeofencing() generates(IGnssGeofencing infc); |
| 168 | |
| 169 | /* |
| 170 | * This method returns the IAGnss Interface. |
| 171 | * |
| 172 | * @return infc Handle to the IAGnss interface. |
| 173 | */ |
| 174 | getExtensionAGnss() generates (IAGnss infc); |
| 175 | |
| 176 | /* |
| 177 | * This method returns the IGnssNi interface. |
| 178 | * |
| 179 | * @return infc Handle to the IGnssNi interface. |
| 180 | */ |
| 181 | getExtensionGnssNi() generates (IGnssNi infc); |
| 182 | |
| 183 | /* |
| 184 | * This method returns the IGnssMeasurement interface. |
| 185 | * |
| 186 | * @return infc Handle to the IGnssMeasurement interface. |
| 187 | */ |
| 188 | getExtensionGnssMeasurement() generates (IGnssMeasurement infc); |
| 189 | |
| 190 | /* |
| 191 | * This method returns the IGnssNavigationMessage interface. |
| 192 | * |
| 193 | * @return infc Handle to the IGnssNavigationMessage interface. |
| 194 | */ |
| 195 | getExtensionGnssNavigationMessage() generates (IGnssNavigationMessage infc); |
| 196 | |
| 197 | /* |
| 198 | * This method returns the IGnssXtra interface. |
| 199 | * |
| 200 | * @return infc Handle to the IGnssXtra interface. |
| 201 | */ |
| 202 | getExtensionXtra() generates (IGnssXtra infc); |
| 203 | |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame^] | 204 | /* |
| 205 | * This method returns the IGnssDebug interface. |
| 206 | * |
| 207 | * @return infc Handle to the IGnssDebug interface. |
| 208 | */ |
| 209 | getExtensionGnssDebug() generates (IGnssDebug infc); |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 210 | }; |