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