blob: 9c1038fb879139db1b22c977c0a23333cf9080d2 [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 {
Andreas Huber40d3a9b2017-03-28 16:19:16 -07006 /** no information is known to the gnss hardware, about this satellite */
Hridya Valsaraju49526a72016-10-13 21:09:22 -07007 UNKNOWN,
Andreas Huber40d3a9b2017-03-28 16:19:16 -07008 /** this satellite is known to exist */
Hridya Valsaraju49526a72016-10-13 21:09:22 -07009 KNOWN,
Andreas Huber40d3a9b2017-03-28 16:19:16 -070010 /** this satellite is not known to exist */
Hridya Valsaraju49526a72016-10-13 21:09:22 -070011 NONEXISTENT,
Andreas Huber40d3a9b2017-03-28 16:19:16 -070012 /** Only Almanac (approximate) location known for this satellite */
Hridya Valsaraju49526a72016-10-13 21:09:22 -070013 ALMANAC_ONLY,
Andreas Huber40d3a9b2017-03-28 16:19:16 -070014 /** Ephemeris is known from demodulating the signal on device */
Hridya Valsaraju49526a72016-10-13 21:09:22 -070015 DEMODULATED,
Andreas Huber40d3a9b2017-03-28 16:19:16 -070016 /** Ephemeris has been provided by SUPL */
Hridya Valsaraju49526a72016-10-13 21:09:22 -070017 SUPL_PROVIDED,
Andreas Huber40d3a9b2017-03-28 16:19:16 -070018 /** Ephemeris has been provided by another server */
Hridya Valsaraju49526a72016-10-13 21:09:22 -070019 OTHER_SERVER_PROVIDED,
Andreas Huber40d3a9b2017-03-28 16:19:16 -070020 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -070021 * Predicted ephemeris has been provided by a server
22 * (e.g. Xtra, Extended Ephemeris, etc...)
23 */
24 SERVER_PREDICTED,
Andreas Huber40d3a9b2017-03-28 16:19:16 -070025 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -070026 * Predicted ephemeris in use, generated locally on the device (e.g. from prior
27 * ephemeris)
28 */
29 LOCALLY_PREDICTED
30 };
31
Andreas Huber40d3a9b2017-03-28 16:19:16 -070032 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -070033 * Provides the current best known position from any
34 * source (GNSS or injected assistance).
35 */
36 struct PositionDebug {
Andreas Huber40d3a9b2017-03-28 16:19:16 -070037 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -070038 * Validity of the data in this struct. False only if no
39 * latitude/longitude information is known.
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070040 */
Hridya Valsaraju49526a72016-10-13 21:09:22 -070041 bool valid;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070042 /** Latitude expressed in degrees */
Hridya Valsaraju49526a72016-10-13 21:09:22 -070043 double latitudeDegrees;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070044 /** Longitude expressed in degrees */
Hridya Valsaraju49526a72016-10-13 21:09:22 -070045 double longitudeDegrees;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070046 /** Altitude above ellipsoid expressed in meters */
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070047 float altitudeMeters;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070048 /** Represents speed in meters per second. */
gomoc3d92782017-01-11 14:04:21 -080049 float speedMetersPerSec;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070050 /** Represents heading in degrees. */
gomoc3d92782017-01-11 14:04:21 -080051 float bearingDegrees;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070052 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -070053 * estimated horizontal accuracy of position expressed in meters, radial,
54 * 68% confidence.
55 */
gomoc3d92782017-01-11 14:04:21 -080056 double horizontalAccuracyMeters;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070057 /**
gomoc3d92782017-01-11 14:04:21 -080058 * estimated vertical accuracy of position expressed in meters, with
59 * 68% confidence.
60 */
61 double verticalAccuracyMeters;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070062 /**
gomoc3d92782017-01-11 14:04:21 -080063 * estimated speed accuracy in meters per second with 68% confidence.
64 */
65 double speedAccuracyMetersPerSecond;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070066 /**
gomoc3d92782017-01-11 14:04:21 -080067 * estimated bearing accuracy degrees with 68% confidence.
68 */
69 double bearingAccuracyDegrees;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070070 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -070071 * Time duration before this report that this position information was
72 * valid.
73 */
74 float ageSeconds;
75 };
76
Andreas Huber40d3a9b2017-03-28 16:19:16 -070077 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -070078 * Provides the current best known UTC time estimate.
79 */
80 struct TimeDebug {
Andreas Huber40d3a9b2017-03-28 16:19:16 -070081 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -070082 * Validity of the data in the struct.
83 * False if current time is unknown.
84 */
85 bool valid;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070086 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -070087 * UTC time estimate.
88 */
89 GnssUtcTime timeEstimate;
Andreas Huber40d3a9b2017-03-28 16:19:16 -070090 /** 68% error estimate in time. */
Hridya Valsaraju49526a72016-10-13 21:09:22 -070091 float timeUncertaintyNs;
92 };
93
Andreas Huber40d3a9b2017-03-28 16:19:16 -070094 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -070095 * Provides a single satellite info that has decoded navigation data.
96 */
97 struct SatelliteData {
Andreas Huber40d3a9b2017-03-28 16:19:16 -070098 /** Satellite vehicle ID number */
Hridya Valsaraju49526a72016-10-13 21:09:22 -070099 int16_t svid;
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700100 /** Defines the constellation type of the given SV. */
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700101 GnssConstellationType constellation;
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700102 /** Defines the ephemeris type of the satellite. */
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700103 SatelliteEphemerisType ephemerisType;
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700104 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700105 * Time duration before this report, that the ephemeris source was last
106 * updated, e.g. latest demodulation, or latest server download.
107 * Set to 0 when ephemerisType is UNKNOWN.
108 */
109 float ephemerisAgeSeconds;
110 };
111
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700112 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700113 * Provides a set of debug information that is filled by the GNSS chipset
114 * when the method getDebugData() is invoked.
115 */
116 struct DebugData {
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700117 /** Current best known position. */
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700118 PositionDebug position;
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700119 /** Current best know time estimate */
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700120 TimeDebug time;
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700121 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700122 * Provides a list of the decoded satellite ephemeris.
gomoc3d92782017-01-11 14:04:21 -0800123 * Must provide a complete list for all constellations device can track,
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700124 * including GnssConstellationType UNKNOWN.
125 */
126 vec<SatelliteData> satelliteDataArray;
127
128 };
129
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700130 /**
Hridya Valsaraju49526a72016-10-13 21:09:22 -0700131 * This methods requests position, time and satellite ephemeris debug information
132 * from the HAL.
133 *
134 * @return ret debugData information from GNSS Hal that contains the current best
135 * known position, best known time estimate and a complete list of
136 * constellations that the device can track.
137 */
138 getDebugData() generates (DebugData debugData);
139};