GnssStatus
class GnssStatus : Parcelable
| kotlin.Any | |
| ↳ | android.location.GnssStatus |
This class represents the current state of the GNSS engine and is used in conjunction with GnssStatus.Callback.
Summary
| Nested classes | |
|---|---|
|
Builder class to help create new GnssStatus instances. |
|
| abstract |
Used for receiving notifications when GNSS events happen. |
| Constants | |
|---|---|
| static Int |
Constellation type constant for Beidou. |
| static Int |
Constellation type constant for Galileo. |
| static Int |
Constellation type constant for Glonass. |
| static Int |
Constellation type constant for GPS. |
| static Int |
Constellation type constant for IRNSS. |
| static Int |
Constellation type constant for QZSS. |
| static Int |
Constellation type constant for SBAS. |
| static Int |
Unknown constellation type. |
| Inherited constants | |
|---|---|
| Public methods | |
|---|---|
| Int |
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| Boolean |
Indicates whether some other object is "equal to" this one. |
| Float |
getAzimuthDegrees(satelliteIndex: Int)Retrieves the azimuth the satellite at the specified index. |
| Float |
getBasebandCn0DbHz(satelliteIndex: Int)Retrieves the baseband carrier-to-noise density of the satellite at the specified index in dB-Hz. |
| Float |
getCarrierFrequencyHz(satelliteIndex: Int)Gets the carrier frequency of the signal tracked. |
| Float |
getCn0DbHz(satelliteIndex: Int)Retrieves the carrier-to-noise density at the antenna of the satellite at the specified index in dB-Hz. |
| Int |
getConstellationType(satelliteIndex: Int)Retrieves the constellation type of the satellite at the specified index. |
| Float |
getElevationDegrees(satelliteIndex: Int)Retrieves the elevation of the satellite at the specified index. |
| Int |
Gets the total number of satellites in satellite list. |
| Int |
Gets the identification number for the satellite at the specific index. |
| Boolean |
hasAlmanacData(satelliteIndex: Int)Reports whether the satellite at the specified index has almanac data. |
| Boolean |
hasBasebandCn0DbHz(satelliteIndex: Int)Reports whether a valid |
| Boolean |
hasCarrierFrequencyHz(satelliteIndex: Int)Reports whether a valid |
| Boolean |
hasEphemerisData(satelliteIndex: Int)Reports whether the satellite at the specified index has ephemeris data. |
| Int |
hashCode()Returns a hash code value for the object. |
| Boolean |
Reports whether the satellite at the specified index was used in the calculation of the most recent position fix. |
| Unit |
writeToParcel(parcel: Parcel, flags: Int)Flatten this object in to a Parcel. |
| Properties | |
|---|---|
| static Parcelable.Creator<GnssStatus!> | |
Constants
CONSTELLATION_BEIDOU
static val CONSTELLATION_BEIDOU: Int
Constellation type constant for Beidou.
Value: 5CONSTELLATION_GALILEO
static val CONSTELLATION_GALILEO: Int
Constellation type constant for Galileo.
Value: 6CONSTELLATION_GLONASS
static val CONSTELLATION_GLONASS: Int
Constellation type constant for Glonass.
Value: 3CONSTELLATION_GPS
static val CONSTELLATION_GPS: Int
Constellation type constant for GPS.
Value: 1CONSTELLATION_IRNSS
static val CONSTELLATION_IRNSS: Int
Constellation type constant for IRNSS.
Value: 7CONSTELLATION_QZSS
static val CONSTELLATION_QZSS: Int
Constellation type constant for QZSS.
Value: 4CONSTELLATION_SBAS
static val CONSTELLATION_SBAS: Int
Constellation type constant for SBAS.
Value: 2CONSTELLATION_UNKNOWN
static val CONSTELLATION_UNKNOWN: Int
Unknown constellation type.
Value: 0Public methods
describeContents
fun describeContents(): Int
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or
|
equals
fun equals(other: Any?): Boolean
Indicates whether some other object is "equal to" this one.
The equals method implements an equivalence relation on non-null object references:
- It is reflexive: for any non-null reference value
x,x.equals(x)should returntrue. - It is symmetric: for any non-null reference values
xandy,x.equals(y)should returntrueif and only ify.equals(x)returnstrue. - It is transitive: for any non-null reference values
x,y, andz, ifx.equals(y)returnstrueandy.equals(z)returnstrue, thenx.equals(z)should returntrue. - It is consistent: for any non-null reference values
xandy, multiple invocations ofx.equals(y)consistently returntrueor consistently returnfalse, provided no information used inequalscomparisons on the objects is modified. - For any non-null reference value
x,x.equals(null)should returnfalse.
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| Parameters | |
|---|---|
obj |
the reference object with which to compare. |
| Return | |
|---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getAzimuthDegrees
fun getAzimuthDegrees(satelliteIndex: Int): Float
Retrieves the azimuth the satellite at the specified index.
| Parameters | |
|---|---|
satelliteIndex |
Int: An index from zero to getSatelliteCount() - 1. Value is 0 or greater |
| Return | |
|---|---|
Float |
Value is between 0.0f and 360.0f inclusive |
getBasebandCn0DbHz
fun getBasebandCn0DbHz(satelliteIndex: Int): Float
Retrieves the baseband carrier-to-noise density of the satellite at the specified index in dB-Hz.
| Parameters | |
|---|---|
satelliteIndex |
Int: An index from zero to getSatelliteCount() - 1. Value is 0 or greater |
| Return | |
|---|---|
Float |
Value is between 0.0f and 63.0f inclusive |
getCarrierFrequencyHz
fun getCarrierFrequencyHz(satelliteIndex: Int): Float
Gets the carrier frequency of the signal tracked.
For example it can be the GPS central frequency for L1 = 1575.45 MHz, or L2 = 1227.60 MHz, L5 = 1176.45 MHz, varying GLO channels, etc.
The value is only available if hasCarrierFrequencyHz(int satelliteIndex) is true.
| Parameters | |
|---|---|
satelliteIndex |
Int: An index from zero to getSatelliteCount() - 1. Value is 0 or greater |
| Return | |
|---|---|
Float |
Value is 0.0f or greater |
getCn0DbHz
fun getCn0DbHz(satelliteIndex: Int): Float
Retrieves the carrier-to-noise density at the antenna of the satellite at the specified index in dB-Hz.
| Parameters | |
|---|---|
satelliteIndex |
Int: An index from zero to getSatelliteCount() - 1. Value is 0 or greater |
| Return | |
|---|---|
Float |
Value is between 0.0f and 63.0f inclusive |
getConstellationType
fun getConstellationType(satelliteIndex: Int): Int
Retrieves the constellation type of the satellite at the specified index.
| Parameters | |
|---|---|
satelliteIndex |
Int: An index from zero to getSatelliteCount() - 1. Value is 0 or greater |
| Return | |
|---|---|
Int |
Value is one of the following: |
getElevationDegrees
fun getElevationDegrees(satelliteIndex: Int): Float
Retrieves the elevation of the satellite at the specified index.
| Parameters | |
|---|---|
satelliteIndex |
Int: An index from zero to getSatelliteCount() - 1. Value is 0 or greater |
| Return | |
|---|---|
Float |
Value is between -90.0f and 90.0f inclusive |
getSatelliteCount
fun getSatelliteCount(): Int
Gets the total number of satellites in satellite list.
| Return | |
|---|---|
Int |
Value is 0 or greater |
getSvid
fun getSvid(satelliteIndex: Int): Int
Gets the identification number for the satellite at the specific index.
This svid is pseudo-random number for most constellations. It is FCN & OSN number for Glonass.
The distinction is made by looking at constellation field getConstellationType(int) Expected values are in the range of:
- GPS: 1-32
- SBAS: 120-151, 183-192
- GLONASS: One of: OSN, or FCN+100
- 1-25 as the orbital slot number (OSN) (preferred, if known)
- 93-106 as the frequency channel number (FCN) (-7 to +6) plus 100. i.e. encode FCN of -7 as 93, 0 as 100, and +6 as 106
- QZSS: 183-206
- Galileo: 1-36
- Beidou: 1-63
- IRNSS: 1-14
| Parameters | |
|---|---|
satelliteIndex |
Int: An index from zero to getSatelliteCount() - 1. Value is 0 or greater |
| Return | |
|---|---|
Int |
Value is between 1 and 206 inclusive |
hasAlmanacData
fun hasAlmanacData(satelliteIndex: Int): Boolean
Reports whether the satellite at the specified index has almanac data.
| Parameters | |
|---|---|
satelliteIndex |
Int: An index from zero to getSatelliteCount() - 1. Value is 0 or greater |
hasBasebandCn0DbHz
fun hasBasebandCn0DbHz(satelliteIndex: Int): Boolean
Reports whether a valid getBasebandCn0DbHz(int satelliteIndex) is available.
| Parameters | |
|---|---|
satelliteIndex |
Int: An index from zero to getSatelliteCount() - 1. Value is 0 or greater |
hasCarrierFrequencyHz
fun hasCarrierFrequencyHz(satelliteIndex: Int): Boolean
Reports whether a valid getCarrierFrequencyHz(int satelliteIndex) is available.
| Parameters | |
|---|---|
satelliteIndex |
Int: An index from zero to getSatelliteCount() - 1. Value is 0 or greater |
hasEphemerisData
fun hasEphemerisData(satelliteIndex: Int): Boolean
Reports whether the satellite at the specified index has ephemeris data.
| Parameters | |
|---|---|
satelliteIndex |
Int: An index from zero to getSatelliteCount() - 1. Value is 0 or greater |
hashCode
fun hashCode(): Int
Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.
The general contract of hashCode is:
- Whenever it is invoked on the same object more than once during an execution of a Java application, the
hashCodemethod must consistently return the same integer, provided no information used inequalscomparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. - If two objects are equal according to the
equalsmethod, then calling thehashCodemethod on each of the two objects must produce the same integer result. - It is not required that if two objects are unequal according to the
equalsmethod, then calling thehashCodemethod on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
| Return | |
|---|---|
Int |
a hash code value for this object. |
usedInFix
fun usedInFix(satelliteIndex: Int): Boolean
Reports whether the satellite at the specified index was used in the calculation of the most recent position fix.
| Parameters | |
|---|---|
satelliteIndex |
Int: An index from zero to getSatelliteCount() - 1. Value is 0 or greater |
writeToParcel
fun writeToParcel(
parcel: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
dest |
The Parcel in which the object should be written. This value cannot be null. |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of the following:
|
parcel |
Parcel: This value cannot be null. |