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 { |
| 5 | enum SatelliteEphemerisType : uint32_t { |
| 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. |
| 40 | * / |
| 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 */ |
| 47 | float altitudeDegrees; |
| 48 | /* |
| 49 | * estimated horizontal accuracy of position expressed in meters, radial, |
| 50 | * 68% confidence. |
| 51 | */ |
| 52 | double accuracyMeters; |
| 53 | /* |
| 54 | * Time duration before this report that this position information was |
| 55 | * valid. |
| 56 | */ |
| 57 | float ageSeconds; |
| 58 | }; |
| 59 | |
| 60 | /* |
| 61 | * Provides the current best known UTC time estimate. |
| 62 | */ |
| 63 | struct TimeDebug { |
| 64 | /* |
| 65 | * Validity of the data in the struct. |
| 66 | * False if current time is unknown. |
| 67 | */ |
| 68 | bool valid; |
| 69 | /* |
| 70 | * UTC time estimate. |
| 71 | */ |
| 72 | GnssUtcTime timeEstimate; |
| 73 | /* 68% error estimate in time. */ |
| 74 | float timeUncertaintyNs; |
| 75 | }; |
| 76 | |
| 77 | /* |
| 78 | * Provides a single satellite info that has decoded navigation data. |
| 79 | */ |
| 80 | struct SatelliteData { |
| 81 | /* Satellite vehicle ID number */ |
| 82 | int16_t svid; |
| 83 | /* Defines the constellation type of the given SV. */ |
| 84 | GnssConstellationType constellation; |
| 85 | /* Defines the ephemeris type of the satellite. */ |
| 86 | SatelliteEphemerisType ephemerisType; |
| 87 | /* |
| 88 | * Time duration before this report, that the ephemeris source was last |
| 89 | * updated, e.g. latest demodulation, or latest server download. |
| 90 | * Set to 0 when ephemerisType is UNKNOWN. |
| 91 | */ |
| 92 | float ephemerisAgeSeconds; |
| 93 | }; |
| 94 | |
| 95 | /* |
| 96 | * Provides a set of debug information that is filled by the GNSS chipset |
| 97 | * when the method getDebugData() is invoked. |
| 98 | */ |
| 99 | struct DebugData { |
| 100 | /* Current best known position. */ |
| 101 | PositionDebug position; |
| 102 | /* Current best know time estimate */ |
| 103 | TimeDebug time; |
| 104 | /* |
| 105 | * Provides a list of the decoded satellite ephemeris. |
| 106 | * Should provide a complete list for all constellations device can track, |
| 107 | * including GnssConstellationType UNKNOWN. |
| 108 | */ |
| 109 | vec<SatelliteData> satelliteDataArray; |
| 110 | |
| 111 | }; |
| 112 | |
| 113 | /* |
| 114 | * This methods requests position, time and satellite ephemeris debug information |
| 115 | * from the HAL. |
| 116 | * |
| 117 | * @return ret debugData information from GNSS Hal that contains the current best |
| 118 | * known position, best known time estimate and a complete list of |
| 119 | * constellations that the device can track. |
| 120 | */ |
| 121 | getDebugData() generates (DebugData debugData); |
| 122 | }; |