blob: 4c4cfb8bcdad6d9cbca26f7bb7584514106e557a [file] [log] [blame]
Hridya Valsaraju49526a72016-10-13 21:09:22 -07001package android.hardware.gnss@1.0;
2
Andreas Huber40d3a9b2017-03-28 16:19:16 -07003/** Extended interface for DEBUG support. */
Hridya Valsaraju49526a72016-10-13 21:09:22 -07004interface IGnssDebug {
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -07005 enum SatelliteEphemerisType : uint8_t {
Wyatt Riley205881e2017-03-29 10:11:59 -07006 /** Ephemeris is known for this satellite. */
7 EPHEMERIS,
8 /**
9 * Ephemeris is not known, but Almanac (approximate location) is known.
10 */
Hridya Valsaraju49526a72016-10-13 21:09:22 -070011 ALMANAC_ONLY,
Wyatt Riley205881e2017-03-29 10:11:59 -070012 /**
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 Valsaraju49526a72016-10-13 21:09:22 -070024 DEMODULATED,
Wyatt Riley205881e2017-03-29 10:11:59 -070025 /**
26 * The ephemeris (or almanac only) information was received from a SUPL
27 * server.
28 */
Hridya Valsaraju49526a72016-10-13 21:09:22 -070029 SUPL_PROVIDED,
Wyatt Riley205881e2017-03-29 10:11:59 -070030 /**
31 * The ephemeris (or almanac only) information was provided by another
32 * server.
33 */
Hridya Valsaraju49526a72016-10-13 21:09:22 -070034 OTHER_SERVER_PROVIDED,
Andreas Huber40d3a9b2017-03-28 16:19:16 -070035 /**
Wyatt Riley205881e2017-03-29 10:11:59 -070036 * 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 Valsaraju49526a72016-10-13 21:09:22 -070040 */
Wyatt Riley205881e2017-03-29 10:11:59 -070041 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 Valsaraju49526a72016-10-13 21:09:22 -070051 };
52
Andreas Huber40d3a9b2017-03-28 16:19:16 -070053 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -070054 * Provides the current best known position from any
55 * source (GNSS or injected assistance).
56 */
57 struct PositionDebug {
Andreas Huber40d3a9b2017-03-28 16:19:16 -070058 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -070059 * Validity of the data in this struct. False only if no
60 * latitude/longitude information is known.
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070061 */
Hridya Valsaraju49526a72016-10-13 21:09:22 -070062 bool valid;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070063 /** Latitude expressed in degrees */
Hridya Valsaraju49526a72016-10-13 21:09:22 -070064 double latitudeDegrees;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070065 /** Longitude expressed in degrees */
Hridya Valsaraju49526a72016-10-13 21:09:22 -070066 double longitudeDegrees;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070067 /** Altitude above ellipsoid expressed in meters */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070068 float altitudeMeters;
Wyatt Riley205881e2017-03-29 10:11:59 -070069 /** Represents horizontal speed in meters per second. */
gomoc3d92782017-01-11 14:04:21 -080070 float speedMetersPerSec;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070071 /** Represents heading in degrees. */
gomoc3d92782017-01-11 14:04:21 -080072 float bearingDegrees;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070073 /**
Wyatt Rileye8a8b292017-03-31 15:23:00 -070074 * Estimated horizontal accuracy of position expressed in meters,
75 * radial, 68% confidence.
Hridya Valsaraju49526a72016-10-13 21:09:22 -070076 */
gomoc3d92782017-01-11 14:04:21 -080077 double horizontalAccuracyMeters;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070078 /**
Wyatt Riley205881e2017-03-29 10:11:59 -070079 * Estimated vertical accuracy of position expressed in meters, with
gomoc3d92782017-01-11 14:04:21 -080080 * 68% confidence.
81 */
82 double verticalAccuracyMeters;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070083 /**
Wyatt Riley205881e2017-03-29 10:11:59 -070084 * Estimated speed accuracy in meters per second with 68% confidence.
gomoc3d92782017-01-11 14:04:21 -080085 */
86 double speedAccuracyMetersPerSecond;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070087 /**
gomoc3d92782017-01-11 14:04:21 -080088 * estimated bearing accuracy degrees with 68% confidence.
89 */
90 double bearingAccuracyDegrees;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070091 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -070092 * Time duration before this report that this position information was
Wyatt Riley205881e2017-03-29 10:11:59 -070093 * 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 Valsaraju49526a72016-10-13 21:09:22 -070097 */
98 float ageSeconds;
99 };
100
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700101 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700102 * Provides the current best known UTC time estimate.
Wyatt Riley205881e2017-03-29 10:11:59 -0700103 * 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 Valsaraju49526a72016-10-13 21:09:22 -0700107 */
108 struct TimeDebug {
Wyatt Riley205881e2017-03-29 10:11:59 -0700109 /** UTC time estimate. */
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700110 GnssUtcTime timeEstimate;
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700111 /** 68% error estimate in time. */
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700112 float timeUncertaintyNs;
Wyatt Riley205881e2017-03-29 10:11:59 -0700113 /**
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 Valsaraju49526a72016-10-13 21:09:22 -0700118 };
119
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700120 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700121 * Provides a single satellite info that has decoded navigation data.
122 */
123 struct SatelliteData {
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700124 /** Satellite vehicle ID number */
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700125 int16_t svid;
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700126 /** Defines the constellation type of the given SV. */
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700127 GnssConstellationType constellation;
Wyatt Riley205881e2017-03-29 10:11:59 -0700128
Wyatt Rileye8a8b292017-03-31 15:23:00 -0700129 /**
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 Valsaraju49526a72016-10-13 21:09:22 -0700134 SatelliteEphemerisType ephemerisType;
Wyatt Riley205881e2017-03-29 10:11:59 -0700135 /** Defines the ephemeris source of the satellite. */
136 SatelliteEphemerisSource ephemerisSource;
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700137 /**
Wyatt Riley205881e2017-03-29 10:11:59 -0700138 * 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 Valsaraju49526a72016-10-13 21:09:22 -0700146 */
147 float ephemerisAgeSeconds;
Wyatt Riley205881e2017-03-29 10:11:59 -0700148
149 /**
Wyatt Rileye8a8b292017-03-31 15:23:00 -0700150 * True if a server has provided a predicted orbit and clock model for
Wyatt Riley205881e2017-03-29 10:11:59 -0700151 * 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 Valsaraju49526a72016-10-13 21:09:22 -0700160 };
161
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700162 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700163 * 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 Huber40d3a9b2017-03-28 16:19:16 -0700167 /** Current best known position. */
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700168 PositionDebug position;
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700169 /** Current best know time estimate */
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700170 TimeDebug time;
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700171 /**
Wyatt Riley205881e2017-03-29 10:11:59 -0700172 * Provides a list of the available satellite data, for all
173 * satellites and constellations the device can track,
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700174 * including GnssConstellationType UNKNOWN.
175 */
176 vec<SatelliteData> satelliteDataArray;
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700177 };
178
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700179 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700180 * 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};