GnssClock Struct Reference

GnssClock Struct Reference

#include < gps.h >

Data Fields

size_t  size
 
GnssClockFlags   flags
 
int16_t  leap_second
 
int64_t  time_ns
 
double  time_uncertainty_ns
 
int64_t  full_bias_ns
 
double  bias_ns
 
double  bias_uncertainty_ns
 
double  drift_nsps
 
double  drift_uncertainty_nsps
 
uint32_t  hw_clock_discontinuity_count
 

Detailed Description

Represents an estimate of the GPS clock time.

Definition at line 1455 of file gps.h .

Field Documentation

double bias_ns

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.

Definition at line 1534 of file gps.h .

double bias_uncertainty_ns

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.

Definition at line 1545 of file gps.h .

double drift_nsps

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

Definition at line 1559 of file gps.h .

double drift_uncertainty_nsps

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.

Definition at line 1569 of file gps.h .

A set of flags indicating the validity of the fields in this data structure.

Definition at line 1463 of file gps.h .

int64_t full_bias_ns

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.

Definition at line 1523 of file gps.h .

uint32_t hw_clock_discontinuity_count

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.

Definition at line 1600 of file gps.h .

int16_t leap_second

Leap second data. The sign of the value is defined by the following equation: utc_time_ns = time_ns - (full_bias_ns + bias_ns) - leap_second * 1,000,000,000

If the data is available 'flags' must contain GNSS_CLOCK_HAS_LEAP_SECOND.

Definition at line 1473 of file gps.h .

size_t size

set to sizeof(GnssClock)

Definition at line 1457 of file gps.h .

int64_t time_ns

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.

Definition at line 1494 of file gps.h .

double time_uncertainty_ns

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.)

Definition at line 1506 of file gps.h .


The documentation for this struct was generated from the following file:
  • hardware/libhardware/include/hardware/ gps.h