Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 1 | package android.hardware.gnss@1.0; |
| 2 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 3 | /** Extended interface for DEBUG support. */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 4 | interface IGnssDebug { |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 5 | enum SatelliteEphemerisType : uint8_t { |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 6 | /** Ephemeris is known for this satellite. */ |
| 7 | EPHEMERIS, |
| 8 | /** |
| 9 | * Ephemeris is not known, but Almanac (approximate location) is known. |
| 10 | */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 11 | ALMANAC_ONLY, |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 12 | /** |
| 13 | * Both ephemeris & almanac are not known (e.g. during a cold start |
| 14 | * blind search.) |
| 15 | */ |
| 16 | NOT_AVAILABLE |
| 17 | }; |
| 18 | |
| 19 | enum SatelliteEphemerisSource : uint8_t { |
| 20 | /** |
| 21 | * The ephemeris (or almanac only) information was demodulated from the |
| 22 | * signal received on the device |
| 23 | */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 24 | DEMODULATED, |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 25 | /** |
| 26 | * The ephemeris (or almanac only) information was received from a SUPL |
| 27 | * server. |
| 28 | */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 29 | SUPL_PROVIDED, |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 30 | /** |
| 31 | * The ephemeris (or almanac only) information was provided by another |
| 32 | * server. |
| 33 | */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 34 | OTHER_SERVER_PROVIDED, |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 35 | /** |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 36 | * The ephemeris (or almanac only) information was provided by another |
| 37 | * method, e.g. injected via a local debug tool, from build defaults |
| 38 | * (e.g. almanac), or is from a satellite |
| 39 | * with SatelliteEphemerisType::NOT_AVAILABLE. |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 40 | */ |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 41 | OTHER |
| 42 | }; |
| 43 | |
| 44 | enum SatelliteEphemerisHealth : uint8_t { |
| 45 | /** The ephemeris is known good. */ |
| 46 | GOOD, |
| 47 | /** The ephemeris is known bad. */ |
| 48 | BAD, |
| 49 | /** The ephemeris is unknown to be good or bad. */ |
| 50 | UNKNOWN |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 51 | }; |
| 52 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 53 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 54 | * Provides the current best known position from any |
| 55 | * source (GNSS or injected assistance). |
| 56 | */ |
| 57 | struct PositionDebug { |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 58 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 59 | * Validity of the data in this struct. False only if no |
| 60 | * latitude/longitude information is known. |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 61 | */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 62 | bool valid; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 63 | /** Latitude expressed in degrees */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 64 | double latitudeDegrees; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 65 | /** Longitude expressed in degrees */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 66 | double longitudeDegrees; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 67 | /** Altitude above ellipsoid expressed in meters */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 68 | float altitudeMeters; |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 69 | /** Represents horizontal speed in meters per second. */ |
gomo | c3d9278 | 2017-01-11 14:04:21 -0800 | [diff] [blame] | 70 | float speedMetersPerSec; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 71 | /** Represents heading in degrees. */ |
gomo | c3d9278 | 2017-01-11 14:04:21 -0800 | [diff] [blame] | 72 | float bearingDegrees; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 73 | /** |
Wyatt Riley | e8a8b29 | 2017-03-31 15:23:00 -0700 | [diff] [blame] | 74 | * Estimated horizontal accuracy of position expressed in meters, |
| 75 | * radial, 68% confidence. |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 76 | */ |
gomo | c3d9278 | 2017-01-11 14:04:21 -0800 | [diff] [blame] | 77 | double horizontalAccuracyMeters; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 78 | /** |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 79 | * Estimated vertical accuracy of position expressed in meters, with |
gomo | c3d9278 | 2017-01-11 14:04:21 -0800 | [diff] [blame] | 80 | * 68% confidence. |
| 81 | */ |
| 82 | double verticalAccuracyMeters; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 83 | /** |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 84 | * Estimated speed accuracy in meters per second with 68% confidence. |
gomo | c3d9278 | 2017-01-11 14:04:21 -0800 | [diff] [blame] | 85 | */ |
| 86 | double speedAccuracyMetersPerSecond; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 87 | /** |
gomo | c3d9278 | 2017-01-11 14:04:21 -0800 | [diff] [blame] | 88 | * estimated bearing accuracy degrees with 68% confidence. |
| 89 | */ |
| 90 | double bearingAccuracyDegrees; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 91 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 92 | * Time duration before this report that this position information was |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 93 | * valid. This can, for example, be a previous injected location with |
| 94 | * an age potentially thousands of seconds old, or |
| 95 | * extrapolated to the current time (with appropriately increased |
| 96 | * accuracy estimates), with a (near) zero age. |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 97 | */ |
| 98 | float ageSeconds; |
| 99 | }; |
| 100 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 101 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 102 | * Provides the current best known UTC time estimate. |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 103 | * If no fresh information is available, e.g. after a delete all, |
| 104 | * then whatever the effective defaults are on the device must be |
| 105 | * provided (e.g. Jan. 1, 2017, with an uncertainty of 5 years) expressed |
| 106 | * in the specified units. |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 107 | */ |
| 108 | struct TimeDebug { |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 109 | /** UTC time estimate. */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 110 | GnssUtcTime timeEstimate; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 111 | /** 68% error estimate in time. */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 112 | float timeUncertaintyNs; |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 113 | /** |
| 114 | * 68% error estimate in local clock drift, |
| 115 | * in nanoseconds per second (also known as parts per billion - ppb.) |
| 116 | */ |
| 117 | float frequencyUncertaintyNsPerSec; |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 118 | }; |
| 119 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 120 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 121 | * Provides a single satellite info that has decoded navigation data. |
| 122 | */ |
| 123 | struct SatelliteData { |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 124 | /** Satellite vehicle ID number */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 125 | int16_t svid; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 126 | /** Defines the constellation type of the given SV. */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 127 | GnssConstellationType constellation; |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 128 | |
Wyatt Riley | e8a8b29 | 2017-03-31 15:23:00 -0700 | [diff] [blame] | 129 | /** |
| 130 | * Defines the standard broadcast ephemeris or almanac availability for |
| 131 | * the satellite. To report status of predicted orbit and clock |
| 132 | * information, see the serverPrediction fields below. |
| 133 | */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 134 | SatelliteEphemerisType ephemerisType; |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 135 | /** Defines the ephemeris source of the satellite. */ |
| 136 | SatelliteEphemerisSource ephemerisSource; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 137 | /** |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 138 | * Defines whether the satellite is known healthy |
| 139 | * (safe for use in location calculation.) |
| 140 | */ |
| 141 | SatelliteEphemerisHealth ephemerisHealth; |
| 142 | /** |
| 143 | * Time duration from this report (current time), minus the |
| 144 | * effective time of the ephemeris source (e.g. TOE, TOA.) |
| 145 | * Set to 0 when ephemerisType is NOT_AVAILABLE. |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 146 | */ |
| 147 | float ephemerisAgeSeconds; |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 148 | |
| 149 | /** |
Wyatt Riley | e8a8b29 | 2017-03-31 15:23:00 -0700 | [diff] [blame] | 150 | * True if a server has provided a predicted orbit and clock model for |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 151 | * this satellite. |
| 152 | */ |
| 153 | bool serverPredictionIsAvailable; |
| 154 | /** |
| 155 | * Time duration from this report (current time) minus the time of the |
| 156 | * start of the server predicted information. For example, a 1 day |
| 157 | * old prediction would be reported as 86400 seconds here. |
| 158 | */ |
| 159 | float serverPredictionAgeSeconds; |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 160 | }; |
| 161 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 162 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 163 | * Provides a set of debug information that is filled by the GNSS chipset |
| 164 | * when the method getDebugData() is invoked. |
| 165 | */ |
| 166 | struct DebugData { |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 167 | /** Current best known position. */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 168 | PositionDebug position; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 169 | /** Current best know time estimate */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 170 | TimeDebug time; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 171 | /** |
Wyatt Riley | 205881e | 2017-03-29 10:11:59 -0700 | [diff] [blame] | 172 | * Provides a list of the available satellite data, for all |
| 173 | * satellites and constellations the device can track, |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 174 | * including GnssConstellationType UNKNOWN. |
| 175 | */ |
| 176 | vec<SatelliteData> satelliteDataArray; |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 177 | }; |
| 178 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 179 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 180 | * This methods requests position, time and satellite ephemeris debug information |
| 181 | * from the HAL. |
| 182 | * |
| 183 | * @return ret debugData information from GNSS Hal that contains the current best |
| 184 | * known position, best known time estimate and a complete list of |
| 185 | * constellations that the device can track. |
| 186 | */ |
| 187 | getDebugData() generates (DebugData debugData); |
| 188 | }; |