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 { |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 6 | /** no information is known to the gnss hardware, about this satellite */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 7 | UNKNOWN, |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 8 | /** this satellite is known to exist */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 9 | KNOWN, |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 10 | /** this satellite is not known to exist */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 11 | NONEXISTENT, |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 12 | /** Only Almanac (approximate) location known for this satellite */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 13 | ALMANAC_ONLY, |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 14 | /** Ephemeris is known from demodulating the signal on device */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 15 | DEMODULATED, |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 16 | /** Ephemeris has been provided by SUPL */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 17 | SUPL_PROVIDED, |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 18 | /** Ephemeris has been provided by another server */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 19 | OTHER_SERVER_PROVIDED, |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 20 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 21 | * Predicted ephemeris has been provided by a server |
| 22 | * (e.g. Xtra, Extended Ephemeris, etc...) |
| 23 | */ |
| 24 | SERVER_PREDICTED, |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 25 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 26 | * Predicted ephemeris in use, generated locally on the device (e.g. from prior |
| 27 | * ephemeris) |
| 28 | */ |
| 29 | LOCALLY_PREDICTED |
| 30 | }; |
| 31 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 32 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 33 | * Provides the current best known position from any |
| 34 | * source (GNSS or injected assistance). |
| 35 | */ |
| 36 | struct PositionDebug { |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 37 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 38 | * Validity of the data in this struct. False only if no |
| 39 | * latitude/longitude information is known. |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 40 | */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 41 | bool valid; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 42 | /** Latitude expressed in degrees */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 43 | double latitudeDegrees; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 44 | /** Longitude expressed in degrees */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 45 | double longitudeDegrees; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 46 | /** Altitude above ellipsoid expressed in meters */ |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 47 | float altitudeMeters; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 48 | /** Represents speed in meters per second. */ |
gomo | c3d9278 | 2017-01-11 14:04:21 -0800 | [diff] [blame] | 49 | float speedMetersPerSec; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 50 | /** Represents heading in degrees. */ |
gomo | c3d9278 | 2017-01-11 14:04:21 -0800 | [diff] [blame] | 51 | float bearingDegrees; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 52 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 53 | * estimated horizontal accuracy of position expressed in meters, radial, |
| 54 | * 68% confidence. |
| 55 | */ |
gomo | c3d9278 | 2017-01-11 14:04:21 -0800 | [diff] [blame] | 56 | double horizontalAccuracyMeters; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 57 | /** |
gomo | c3d9278 | 2017-01-11 14:04:21 -0800 | [diff] [blame] | 58 | * estimated vertical accuracy of position expressed in meters, with |
| 59 | * 68% confidence. |
| 60 | */ |
| 61 | double verticalAccuracyMeters; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 62 | /** |
gomo | c3d9278 | 2017-01-11 14:04:21 -0800 | [diff] [blame] | 63 | * estimated speed accuracy in meters per second with 68% confidence. |
| 64 | */ |
| 65 | double speedAccuracyMetersPerSecond; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 66 | /** |
gomo | c3d9278 | 2017-01-11 14:04:21 -0800 | [diff] [blame] | 67 | * estimated bearing accuracy degrees with 68% confidence. |
| 68 | */ |
| 69 | double bearingAccuracyDegrees; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 70 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 71 | * Time duration before this report that this position information was |
| 72 | * valid. |
| 73 | */ |
| 74 | float ageSeconds; |
| 75 | }; |
| 76 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 77 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 78 | * Provides the current best known UTC time estimate. |
| 79 | */ |
| 80 | struct TimeDebug { |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 81 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 82 | * Validity of the data in the struct. |
| 83 | * False if current time is unknown. |
| 84 | */ |
| 85 | bool valid; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 86 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 87 | * UTC time estimate. |
| 88 | */ |
| 89 | GnssUtcTime timeEstimate; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 90 | /** 68% error estimate in time. */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 91 | float timeUncertaintyNs; |
| 92 | }; |
| 93 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 94 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 95 | * Provides a single satellite info that has decoded navigation data. |
| 96 | */ |
| 97 | struct SatelliteData { |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 98 | /** Satellite vehicle ID number */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 99 | int16_t svid; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 100 | /** Defines the constellation type of the given SV. */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 101 | GnssConstellationType constellation; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 102 | /** Defines the ephemeris type of the satellite. */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 103 | SatelliteEphemerisType ephemerisType; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 104 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 105 | * 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 Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 112 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 113 | * 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 Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 117 | /** Current best known position. */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 118 | PositionDebug position; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 119 | /** Current best know time estimate */ |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 120 | TimeDebug time; |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 121 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 122 | * Provides a list of the decoded satellite ephemeris. |
gomo | c3d9278 | 2017-01-11 14:04:21 -0800 | [diff] [blame] | 123 | * Must provide a complete list for all constellations device can track, |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 124 | * including GnssConstellationType UNKNOWN. |
| 125 | */ |
| 126 | vec<SatelliteData> satelliteDataArray; |
| 127 | |
| 128 | }; |
| 129 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame^] | 130 | /** |
Hridya Valsaraju | 49526a7 | 2016-10-13 21:09:22 -0700 | [diff] [blame] | 131 | * 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 | }; |