ResponderLocation
public
final
class
ResponderLocation
extends Object
implements
Parcelable
java.lang.Object | |
↳ | android.net.wifi.rtt.ResponderLocation |
ResponderLocation is both a Location Configuration Information (LCI) decoder and a Location Civic Report (LCR) decoder for information received from a Wi-Fi Access Point (AP) during Wi-Fi RTT ranging process.
This is based on the IEEE P802.11-REVmc/D8.0 spec section 9.4.2.22, under Measurement Report Element. Subelement location data-fields parsed from separate input LCI and LCR Information Elements are unified in this class.
Note: The information provided by this class is broadcast by a responder (usually an Access Point), and passed on as-is. There is no guarantee this information is accurate or correct, and as a result developers should carefully consider how this information should be used and provide corresponding advice to users.
Summary
Constants | |
---|---|
int |
ALTITUDE_FLOORS
Responder Altitude is measured in floors. |
int |
ALTITUDE_METERS
Responder Altitude is measured in meters. |
int |
ALTITUDE_UNDEFINED
Altitude is not defined for the Responder. |
int |
DATUM_NAD83_MLLW
Datum used is NAD83 MLLW. |
int |
DATUM_NAD83_NAV88
Datum used is NAD83 NAV88. |
int |
DATUM_UNDEFINED
Datum is not defined. |
int |
DATUM_WGS84
Datum used is WGS84. |
int |
LCI_VERSION_1
Version of the LCI protocol is 1.0, the only defined protocol at this time. |
int |
LOCATION_FIXED
Location of responder is fixed (does not move) |
int |
LOCATION_MOVEMENT_UNKNOWN
Location of the responder is not known to be either fixed or variable. |
int |
LOCATION_RESERVED
Location of the responder status is a reserved value |
int |
LOCATION_VARIABLE
Location of the responder is variable, and may move |
Inherited constants |
---|
Fields | |
---|---|
public
static
final
Creator<ResponderLocation> |
CREATOR
|
Inherited methods | |
---|---|
Constants
ALTITUDE_FLOORS
public static final int ALTITUDE_FLOORS
Responder Altitude is measured in floors.
Constant Value: 2 (0x00000002)
ALTITUDE_METERS
public static final int ALTITUDE_METERS
Responder Altitude is measured in meters.
Constant Value: 1 (0x00000001)
ALTITUDE_UNDEFINED
public static final int ALTITUDE_UNDEFINED
Altitude is not defined for the Responder. The altitude and altitude uncertainty should not be used: see section 2.4 of IETF RFC 6225.
Constant Value: 0 (0x00000000)
DATUM_NAD83_MLLW
public static final int DATUM_NAD83_MLLW
Datum used is NAD83 MLLW.
Constant Value: 3 (0x00000003)
DATUM_NAD83_NAV88
public static final int DATUM_NAD83_NAV88
Datum used is NAD83 NAV88.
Constant Value: 2 (0x00000002)
DATUM_UNDEFINED
public static final int DATUM_UNDEFINED
Datum is not defined.
Constant Value: 0 (0x00000000)
DATUM_WGS84
public static final int DATUM_WGS84
Datum used is WGS84.
Constant Value: 1 (0x00000001)
LCI_VERSION_1
public static final int LCI_VERSION_1
Version of the LCI protocol is 1.0, the only defined protocol at this time.
Constant Value: 1 (0x00000001)
LOCATION_FIXED
public static final int LOCATION_FIXED
Location of responder is fixed (does not move)
Constant Value: 0 (0x00000000)
LOCATION_MOVEMENT_UNKNOWN
public static final int LOCATION_MOVEMENT_UNKNOWN
Location of the responder is not known to be either fixed or variable.
Constant Value: 2 (0x00000002)
LOCATION_RESERVED
public static final int LOCATION_RESERVED
Location of the responder status is a reserved value
Constant Value: 3 (0x00000003)
LOCATION_VARIABLE
public static final int LOCATION_VARIABLE
Location of the responder is variable, and may move
Constant Value: 1 (0x00000001)
Fields
Public methods
describeContents
public int describeContents ()
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.
Returns | |
---|---|
int |
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0 or CONTENTS_FILE_DESCRIPTOR |
equals
public boolean equals (Object obj)
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
x
andy
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any non-null reference values
x
,y
, andz
, ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
. - It is consistent: for any non-null reference values
x
andy
, multiple invocations ofx.equals(y)
consistently returntrue
or consistently returnfalse
, provided no information used inequals
comparisons 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 |
Object : the reference object with which to compare. |
Returns | |
---|---|
boolean |
true if this object is the same as the obj
argument; false otherwise. |
getAltitude
public double getAltitude ()
Returns | |
---|---|
double |
the Altitude in units defined by the altitude type.
Only valid if |
getAltitudeType
public int getAltitudeType ()
Returns | |
---|---|
int |
the Altitude type.
Only valid if |
getAltitudeUncertainty
public double getAltitudeUncertainty ()
Returns | |
---|---|
double |
the Altitude uncertainty in meters.
Only valid if An unknown uncertainty is indicated by 0. |
getColocatedBssids
public List<MacAddress> getColocatedBssids ()
Returns | |
---|---|
List<MacAddress> |
the Immutable list of colocated BSSIDs at the responder.
Will return an empty list when there are no bssids listed. |
getDatum
public int getDatum ()
Returns | |
---|---|
int |
the Datum used for the LCI positioning information.
Only valid if |
getExpectedToMove
public int getExpectedToMove ()
Returns | |
---|---|
int |
an integer representing the mobility of the responder.
Only valid if |
getFloorNumber
public double getFloorNumber ()
Returns | |
---|---|
double |
the Z sub element Floor Number.
Only valid if Note: this number can be positive or negative, with value increments of +/- 1/16 of a floor. . |
getHeightAboveFloorMeters
public double getHeightAboveFloorMeters ()
Returns | |
---|---|
double |
the Z subelement Height above the floor in meters.
Only valid if This value can be positive or negative. |
getHeightAboveFloorUncertaintyMeters
public double getHeightAboveFloorUncertaintyMeters ()
Returns | |
---|---|
double |
the Z subelement Height above the floor uncertainty in meters.
Only valid if An unknown uncertainty is indicated by 0. |
getLatitude
public double getLatitude ()
Returns | |
---|---|
double |
the latitude in degrees
Only valid if |
getLatitudeUncertainty
public double getLatitudeUncertainty ()
Returns | |
---|---|
double |
the latitude uncertainty in degrees.
Only valid if An unknown uncertainty is indicated by 0. |
getLciVersion
public int getLciVersion ()
Returns | |
---|---|
int |
a value greater or equal to 1, indicating the current version number
of the LCI protocol.
Only valid if |
getLongitude
public double getLongitude ()
Returns | |
---|---|
double |
the Longitude in degrees..
Only valid if |
getLongitudeUncertainty
public double getLongitudeUncertainty ()
Returns | |
---|---|
double |
the Longitude uncertainty in degrees.
Only valid if An unknown uncertainty is indicated by 0. |
getMapImageMimeType
public String getMapImageMimeType ()
Returns | |
---|---|
String |
the Map Image file Mime type, referred to by getMapImageUrl().
This value may be null . |
getMapImageUri
public Uri getMapImageUri ()
Returns | |
---|---|
Uri |
a URI referencing a map-file showing the local floor plan.
Will return a |
getRegisteredLocationAgreementIndication
public boolean getRegisteredLocationAgreementIndication ()
Returns | |
---|---|
boolean |
true if the station is operating within a national policy area or an international
agreement area near a national border, otherwise false
(see 802.11REVmc Section 11.12.3 - Registered STA Operation).
Only valid if |
hashCode
public int hashCode ()
Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
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
hashCode
method must consistently return the same integer, provided no information used inequals
comparisons 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
equals
method, then calling thehashCode
method 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
equals
method, then calling thehashCode
method 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.
Returns | |
---|---|
int |
a hash code value for this object. |
isLciSubelementValid
public boolean isLciSubelementValid ()
Returns | |
---|---|
boolean |
true if the LCI subelement (containing Latitude, Longitude and Altitude) is valid.
This method tells us if the responder has provided its Location Configuration Information (LCI) directly, and is useful when an external database of responder locations is not available If isLciSubelementValid() returns true, all the LCI values provided by the corresponding getter methods will have been set as described by the responder, or else if false, they should not be used and will throw an IllegalStateException. |
isZaxisSubelementValid
public boolean isZaxisSubelementValid ()
Returns | |
---|---|
boolean |
if the Z subelement (containing mobility, Floor, Height above floor) is valid. |
toCivicLocationAddress
public Address toCivicLocationAddress ()
Returns | |
---|---|
Address |
the civic location represented as an Address object (best effort).
Will return a |
toCivicLocationSparseArray
public SparseArray<String> toCivicLocationSparseArray ()
Returns | |
---|---|
SparseArray<String> |
the civic location represented as a SparseArray
Valid keys to access the SparseArray can be found in Will return a |
toLocation
public Location toLocation ()
Returns | |
---|---|
Location |
the LCI location represented as a Location object (best effort).
Only valid if |
writeToParcel
public void writeToParcel (Parcel parcel, int flags)
Flatten this object in to a Parcel.
Parameters | |
---|---|
parcel |
Parcel : 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.PARCELABLE_WRITE_RETURN_VALUE .
Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |