public class GpsClock extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<GpsClock> |
CREATOR |
static byte |
TYPE_GPS_TIME
The source of the time value reported by this class is the 'GPS time' derived from
satellites (epoch = Jan 6, 1980).
|
static byte |
TYPE_LOCAL_HW_TIME
The source of the time value reported by this class is the 'Local Hardware Clock'.
|
static byte |
TYPE_UNKNOWN
The type of the time stored is not available or it is unknown.
|
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_ELIDE_DUPLICATES, PARCELABLE_WRITE_RETURN_VALUE
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation.
|
double |
getBiasInNs()
Gets the clock's sub-nanosecond bias.
|
double |
getBiasUncertaintyInNs()
Gets the clock's Bias Uncertainty (1-Sigma) in nanoseconds.
|
double |
getDriftInNsPerSec()
Gets the clock's Drift in nanoseconds per second.
|
double |
getDriftUncertaintyInNsPerSec()
Gets the clock's Drift Uncertainty (1-Sigma) in nanoseconds per second.
|
long |
getFullBiasInNs()
Gets the difference between hardware clock (
getTimeInNs() ) inside GPS receiver and
the true GPS time since 0000Z, January 6, 1980, in nanoseconds. |
short |
getLeapSecond()
Gets the leap second associated with the clock's time.
|
long |
getTimeInNs()
Gets the GPS receiver internal clock value in nanoseconds.
|
double |
getTimeUncertaintyInNs()
Gets the clock's time Uncertainty (1-Sigma) in nanoseconds.
|
byte |
getType()
Gets the type of time reported by
getTimeInNs() . |
boolean |
hasBiasInNs()
Returns true if
getBiasInNs() is available, false otherwise. |
boolean |
hasBiasUncertaintyInNs()
Returns true if
getBiasUncertaintyInNs() is available, false otherwise. |
boolean |
hasDriftInNsPerSec()
Returns true if
getDriftInNsPerSec() is available, false otherwise. |
boolean |
hasDriftUncertaintyInNsPerSec()
Returns true if
getDriftUncertaintyInNsPerSec() is available, false otherwise. |
boolean |
hasFullBiasInNs()
Returns true if
@getFullBiasInNs() is available, false otherwise. |
boolean |
hasLeapSecond()
Returns true if
getLeapSecond() is available, false otherwise. |
boolean |
hasTimeUncertaintyInNs()
Returns true if
getTimeUncertaintyInNs() is available, false otherwise. |
void |
reset()
Resets all the contents to its original state.
|
void |
resetBiasInNs()
Resets the clock's Bias in nanoseconds.
|
void |
resetBiasUncertaintyInNs()
Resets the clock's Bias Uncertainty (1-Sigma) in nanoseconds.
|
void |
resetDriftInNsPerSec()
Resets the clock's Drift in nanoseconds per second.
|
void |
resetDriftUncertaintyInNsPerSec()
Resets the clock's Drift Uncertainty (1-Sigma) in nanoseconds per second.
|
void |
resetFullBiasInNs()
Resets the full bias in nanoseconds.
|
void |
resetLeapSecond()
Resets the leap second associated with the clock's time.
|
void |
resetTimeUncertaintyInNs()
Resets the clock's Time Uncertainty (1-Sigma) in nanoseconds.
|
void |
set(GpsClock clock)
Sets all contents to the values stored in the provided object.
|
void |
setBiasInNs(double biasInNs)
Sets the sub-nanosecond bias.
|
void |
setBiasUncertaintyInNs(double biasUncertaintyInNs)
Sets the clock's Bias Uncertainty (1-Sigma) in nanoseconds.
|
void |
setDriftInNsPerSec(double driftInNsPerSec)
Sets the clock's Drift in nanoseconds per second.
|
void |
setDriftUncertaintyInNsPerSec(double driftUncertaintyInNsPerSec)
Sets the clock's Drift Uncertainty (1-Sigma) in nanoseconds per second.
|
void |
setFullBiasInNs(long value)
Sets the full bias in nanoseconds.
|
void |
setLeapSecond(short leapSecond)
Sets the leap second associated with the clock's time.
|
void |
setTimeInNs(long timeInNs)
Sets the GPS receiver internal clock in nanoseconds.
|
void |
setTimeUncertaintyInNs(double timeUncertaintyInNs)
Sets the clock's Time Uncertainty (1-Sigma) in nanoseconds.
|
void |
setType(byte value)
Sets the type of time reported.
|
String |
toString()
Returns a string representation of the object.
|
void |
writeToParcel(Parcel parcel,
int flags)
Flatten this object in to a Parcel.
|
public static final byte TYPE_UNKNOWN
public static final byte TYPE_LOCAL_HW_TIME
public static final byte TYPE_GPS_TIME
public static final Parcelable.Creator<GpsClock> CREATOR
public void set(GpsClock clock)
public void reset()
public byte getType()
getTimeInNs()
.public void setType(byte value)
public boolean hasLeapSecond()
getLeapSecond()
is available, false otherwise.public short getLeapSecond()
hasLeapSecond()
is true.public void setLeapSecond(short leapSecond)
public void resetLeapSecond()
public long getTimeInNs()
TYPE_LOCAL_HW_TIME
), or the
current GPS time derived inside GPS receiver (TYPE_GPS_TIME
).
getType()
defines the time reported.
For 'local hardware clock' this value is expected to be monotonically increasing during the
reporting session. The real GPS time can be derived by compensating
getFullBiasInNs()
(when it is available) from this value.
For 'GPS time' this value is expected to be the best estimation of current GPS time that GPS
receiver can achieve. getTimeUncertaintyInNs()
should be available when GPS time is
specified.
Sub-nanosecond accuracy can be provided by means of getBiasInNs()
.
The reported time includes getTimeUncertaintyInNs()
.public void setTimeInNs(long timeInNs)
public boolean hasTimeUncertaintyInNs()
getTimeUncertaintyInNs()
is available, false otherwise.public double getTimeUncertaintyInNs()
hasTimeUncertaintyInNs()
is true.public void setTimeUncertaintyInNs(double timeUncertaintyInNs)
public void resetTimeUncertaintyInNs()
public boolean hasFullBiasInNs()
@getFullBiasInNs()
is available, false otherwise.public long getFullBiasInNs()
getTimeInNs()
) inside GPS receiver and
the true GPS time since 0000Z, January 6, 1980, in nanoseconds.
This value is available if TYPE_LOCAL_HW_TIME
is set, and GPS receiver has solved
the clock for GPS time.
getBiasUncertaintyInNs()
should be used for quality check.
The sign of the value is defined by the following equation:
true time (GPS time) = time_ns + (full_bias_ns + bias_ns)
The reported full bias includes getBiasUncertaintyInNs()
.
The value is onl available if hasFullBiasInNs()
is true.public void setFullBiasInNs(long value)
public void resetFullBiasInNs()
public boolean hasBiasInNs()
getBiasInNs()
is available, false otherwise.public double getBiasInNs()
getBiasUncertaintyInNs()
.
The value is only available if hasBiasInNs()
is true.public void setBiasInNs(double biasInNs)
public void resetBiasInNs()
public boolean hasBiasUncertaintyInNs()
getBiasUncertaintyInNs()
is available, false otherwise.public double getBiasUncertaintyInNs()
hasBiasUncertaintyInNs()
is true.public void setBiasUncertaintyInNs(double biasUncertaintyInNs)
public void resetBiasUncertaintyInNs()
public boolean hasDriftInNsPerSec()
getDriftInNsPerSec()
is available, false otherwise.public double getDriftInNsPerSec()
getDriftUncertaintyInNsPerSec()
.
The value is only available if hasDriftInNsPerSec()
is true.public void setDriftInNsPerSec(double driftInNsPerSec)
public void resetDriftInNsPerSec()
public boolean hasDriftUncertaintyInNsPerSec()
getDriftUncertaintyInNsPerSec()
is available, false otherwise.public double getDriftUncertaintyInNsPerSec()
hasDriftUncertaintyInNsPerSec()
is true.public void setDriftUncertaintyInNsPerSec(double driftUncertaintyInNsPerSec)
public void resetDriftUncertaintyInNsPerSec()
public void writeToParcel(Parcel parcel, int flags)
Parcelable
writeToParcel
in interface Parcelable
parcel
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE
.public int describeContents()
Parcelable
Parcelable.writeToParcel(Parcel, int)
,
the return value of this method must include the
Parcelable.CONTENTS_FILE_DESCRIPTOR
bit.describeContents
in interface Parcelable
Parcelable.CONTENTS_FILE_DESCRIPTOR
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())