GnssClock Struct Reference
Sub-nanosecond bias. The error estimate for the sum of this and the full_bias_ns is the bias_uncertainty_ns
If the data is available 'flags' must contain GNSS_CLOCK_HAS_BIAS. If GPS has computed a position fix. This value is mandatory if the receiver has estimated GPS time.
1-Sigma uncertainty associated with the local estimate of GPS time (clock bias) in nanoseconds. The uncertainty is represented as an absolute (single sided) value.
If the data is available 'flags' must contain GNSS_CLOCK_HAS_BIAS_UNCERTAINTY. This value is mandatory if the receiver has estimated GPS time.
The clock's drift in nanoseconds (per second).
A positive value means that the frequency is higher than the nominal frequency, and that the (full_bias_ns + bias_ns) is growing more positive over time.
The value contains the 'drift uncertainty' in it. If the data is available 'flags' must contain GNSS_CLOCK_HAS_DRIFT.
This value is mandatory if the receiver has estimated GNSS time
1-Sigma uncertainty associated with the clock's drift in nanoseconds (per second). The uncertainty is represented as an absolute (single sided) value.
If the data is available 'flags' must contain GNSS_CLOCK_HAS_DRIFT_UNCERTAINTY. If GPS has computed a position fix this field is mandatory and must be populated.
The difference between hardware clock ('time' field) inside GPS receiver and the true GPS time since 0000Z, January 6, 1980, in nanoseconds.
The sign of the value is defined by the following equation: local estimate of GPS time = time_ns - (full_bias_ns + bias_ns)
This value is mandatory if the receiver has estimated GPS time. If the computed time is for a non-GPS constellation, the time offset of that constellation to GPS has to be applied to fill this value. The error estimate for the sum of this and the bias_ns is the bias_uncertainty_ns, and the caller is responsible for using this uncertainty (it can be very large before the GPS time has been solved for.) If the data is available 'flags' must contain GNSS_CLOCK_HAS_FULL_BIAS.
When there are any discontinuities in the HW clock, this field is mandatory.
A "discontinuity" is meant to cover the case of a switch from one source of clock to another. A single free-running crystal oscillator (XO) should generally not have any discontinuities, and this can be set and left at 0.
If, however, the time_ns value (HW clock) is derived from a composite of sources, that is not as smooth as a typical XO, or is otherwise stopped & restarted, then this value shall be incremented each time a discontinuity occurs. (E.g. this value may start at zero at device boot-up and increment each time there is a change in clock continuity. In the unlikely event that this value reaches full scale, rollover (not clamping) is required, such that this value continues to change, during subsequent discontinuity events.)
While this number stays the same, between GnssClock reports, it can be safely assumed that the time_ns value has been running continuously, e.g. derived from a single, high quality clock (XO like, or better, that's typically used during continuous GNSS signal sampling.)
It is expected, esp. during periods where there are few GNSS signals available, that the HW clock be discontinuity-free as long as possible, as this avoids the need to use (waste) a GNSS measurement to fully re-solve for the GPS clock bias and drift, when using the accompanying measurements, from consecutive GnssData reports.
The GNSS receiver internal clock value. This is the local hardware clock value.
For local hardware clock, this value is expected to be monotonically increasing while the hardware clock remains power on. (For the case of a HW clock that is not continuously on, see the hw_clock_discontinuity_count field). The receiver's estimate of GPS time can be derived by substracting the sum of full_bias_ns and bias_ns (when available) from this value.
This GPS time is expected to be the best estimate of current GPS time that GNSS receiver can achieve.
Sub-nanosecond accuracy can be provided by means of the 'bias_ns' field. The value contains the 'time uncertainty' in it.
This field is mandatory.
1-Sigma uncertainty associated with the clock's time in nanoseconds. The uncertainty is represented as an absolute (single sided) value.
If the data is available, 'flags' must contain GNSS_CLOCK_HAS_TIME_UNCERTAINTY. This value is effectively zero (it is the reference local clock, by which all other times and time uncertainties are measured.) (And thus this field can be not provided, per GNSS_CLOCK_HAS_TIME_UNCERTAINTY flag, or provided & set to 0.)
The documentation for this struct was generated from the following file:
- hardware/libhardware/include/hardware/ gps.h