lin
2025-08-21 57113df3a0e2be01232281fad9a5f2c060567981
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
package android.hardware.gnss@1.0;
 
/** Extended interface for DEBUG support. */
interface IGnssDebug {
    enum SatelliteEphemerisType : uint8_t {
        /** Ephemeris is known for this satellite. */
        EPHEMERIS,
        /**
         * Ephemeris is not known, but Almanac (approximate location) is known.
         */
        ALMANAC_ONLY,
        /**
         * Both ephemeris & almanac are not known (e.g. during a cold start
         * blind search.)
         */
        NOT_AVAILABLE
    };
 
    enum SatelliteEphemerisSource : uint8_t {
        /**
         * The ephemeris (or almanac only) information was demodulated from the
         * signal received on the device
         */
        DEMODULATED,
        /**
         * The ephemeris (or almanac only) information was received from a SUPL
         * server.
         */
        SUPL_PROVIDED,
        /**
         * The ephemeris (or almanac only) information was provided by another
         * server.
         */
        OTHER_SERVER_PROVIDED,
        /**
         * The ephemeris (or almanac only) information was provided by another
         * method, e.g. injected via a local debug tool, from build defaults
         * (e.g. almanac), or is from a satellite
         * with SatelliteEphemerisType::NOT_AVAILABLE.
         */
        OTHER
    };
 
    enum SatelliteEphemerisHealth : uint8_t {
        /** The ephemeris is known good. */
        GOOD,
        /** The ephemeris is known bad. */
        BAD,
        /** The ephemeris is unknown to be good or bad. */
        UNKNOWN
    };
 
    /**
     * Provides the current best known position from any
     * source (GNSS or injected assistance).
     */
    struct PositionDebug {
        /**
         * Validity of the data in this struct. False only if no
         * latitude/longitude information is known.
         */
        bool valid;
        /** Latitude expressed in degrees */
        double latitudeDegrees;
        /** Longitude expressed in degrees */
        double longitudeDegrees;
        /** Altitude above ellipsoid expressed in meters */
        float altitudeMeters;
        /** Represents horizontal speed in meters per second. */
        float speedMetersPerSec;
        /** Represents heading in degrees. */
        float bearingDegrees;
        /**
         * Estimated horizontal accuracy of position expressed in meters,
         * radial, 68% confidence.
         */
        double horizontalAccuracyMeters;
        /**
         * Estimated vertical accuracy of position expressed in meters, with
         * 68% confidence.
         */
        double verticalAccuracyMeters;
        /**
         * Estimated speed accuracy in meters per second with 68% confidence.
         */
        double speedAccuracyMetersPerSecond;
        /**
         * estimated bearing accuracy degrees with 68% confidence.
         */
        double bearingAccuracyDegrees;
        /**
         * Time duration before this report that this position information was
         * valid.  This can, for example, be a previous injected location with
         * an age potentially thousands of seconds old, or
         * extrapolated to the current time (with appropriately increased
         * accuracy estimates), with a (near) zero age.
         */
        float ageSeconds;
    };
 
    /**
     * Provides the current best known UTC time estimate.
     * If no fresh information is available, e.g. after a delete all,
     * then whatever the effective defaults are on the device must be
     * provided (e.g. Jan. 1, 2017, with an uncertainty of 5 years) expressed
     * in the specified units.
     */
    struct TimeDebug {
        /** UTC time estimate. */
        GnssUtcTime timeEstimate;
        /** 68% error estimate in time. */
        float timeUncertaintyNs;
        /**
         * 68% error estimate in local clock drift,
         * in nanoseconds per second (also known as parts per billion - ppb.)
         */
        float frequencyUncertaintyNsPerSec;
    };
 
    /**
     * Provides a single satellite info that has decoded navigation data.
     */
    struct SatelliteData {
        /** Satellite vehicle ID number */
        int16_t svid;
        /** Defines the constellation type of the given SV. */
        GnssConstellationType constellation;
 
        /**
         * Defines the standard broadcast ephemeris or almanac availability for
         * the satellite.  To report status of predicted orbit and clock
         * information, see the serverPrediction fields below.
         */
        SatelliteEphemerisType ephemerisType;
        /** Defines the ephemeris source of the satellite. */
        SatelliteEphemerisSource ephemerisSource;
        /**
         * Defines whether the satellite is known healthy
         * (safe for use in location calculation.)
         */
        SatelliteEphemerisHealth ephemerisHealth;
        /**
         * Time duration from this report (current time), minus the
         * effective time of the ephemeris source (e.g. TOE, TOA.)
         * Set to 0 when ephemerisType is NOT_AVAILABLE.
         */
        float ephemerisAgeSeconds;
 
        /**
         * True if a server has provided a predicted orbit and clock model for
         * this satellite.
         */
        bool serverPredictionIsAvailable;
        /**
         * Time duration from this report (current time) minus the time of the
         * start of the server predicted information.  For example, a 1 day
         * old prediction would be reported as 86400 seconds here.
         */
        float serverPredictionAgeSeconds;
    };
 
    /**
     * Provides a set of debug information that is filled by the GNSS chipset
     * when the method getDebugData() is invoked.
     */
    struct DebugData {
        /** Current best known position. */
        PositionDebug position;
        /** Current best know time estimate */
        TimeDebug time;
        /**
         * Provides a list of the available satellite data, for all
         * satellites and constellations the device can track,
         * including GnssConstellationType UNKNOWN.
         */
        vec<SatelliteData> satelliteDataArray;
    };
 
    /**
     * This methods requests position, time and satellite ephemeris debug information
     * from the HAL.
     *
     * @return ret debugData information from GNSS Hal that contains the current best
     * known position, best known time estimate and a complete list of
     * constellations that the device can track.
     */
    getDebugData() generates (DebugData debugData);
};