RangingResult
class RangingResult : Parcelable
| kotlin.Any | |
| ↳ | android.net.wifi.rtt.RangingResult |
Ranging result for a request started by WifiRttManager.startRanging(RangingRequest, java.util.concurrent.Executor, RangingResultCallback). Results are returned in RangingResultCallback.onRangingResults(List).
A ranging result is the distance measurement result for a single device specified in the RangingRequest.
Summary
| Nested classes | |
|---|---|
|
Builder class used to construct |
|
| Constants | |
|---|---|
| static Int |
Individual range request status, |
| static Int |
Individual range request status, |
| static Int |
Individual range request status, |
| static Int |
Individual range request status, |
| static Int |
The unspecified value. |
| 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. |
| Int |
Gets LTF repetitions that the initiator station (ISTA) used in the preamble of the initiator to responder (I2R) null data PPDU (NDP) for this result. |
| Int |
Gets number of receive spatial streams that the initiator station (ISTA) used for the initiator to responder (I2R) null data PPDU (NDP) for this result. |
| Int |
Gets number of transmit spatial streams that the initiator station (ISTA) used for the initiator to responder (I2R) null data PPDU (NDP) for this result. |
| Int |
Gets LTF repetitions that the responder station (RSTA) used in the preamble of the responder to initiator (I2R) null data PPDU (NDP) for this result. |
| Long |
Gets availability window between measurements in milliseconds for proximity detection measurements. |
| Int | |
| Int | |
| ByteArray |
getLci() |
| ByteArray |
getLcr() |
| MacAddress? | |
| Long |
Gets maximum time between measurements in microseconds for IEEE 802. |
| Int |
The bandwidth used to transmit the RTT measurement frame. |
| Int |
The center frequency of the primary 20 MHz frequency (in MHz) of the channel over which the measurement frames are sent. |
| Long |
Gets minimum time between measurements in microseconds for IEEE 802. |
| Long |
Get the nominal duration between adjacent availability window in milliseconds for proximity detection measurements. |
| Int | |
| Int |
Get the number of range repetitions carried out for distance calculation in Non Trigger Based (NTB) ranging. |
| Int | |
| Long |
Get Comeback after time in milliseconds. |
| ByteArray? |
Get PASN comeback cookie. |
| PeerHandle? | |
| Long | |
| Int | |
| Int |
getRssi() |
| Int |
Get Secure HE-LTF protocol version used. |
| Int | |
| ResponderLocation? | |
| Int |
Returns the USD peer identifier of the device whose range measurement was requested. |
| Int |
hashCode()Returns a hash code value for the object. |
| Boolean | |
| Boolean | |
| Boolean |
Returns whether the Location Measurement Report (LMR) feedback is delayed. |
| Boolean | |
| Boolean | |
| Boolean | |
| String |
toString() |
| Unit |
writeToParcel(dest: Parcel, flags: Int)Flatten this object in to a Parcel. |
| Properties | |
|---|---|
| static Parcelable.Creator<RangingResult!> | |
Constants
STATUS_BUSY_TRY_LATER
static val STATUS_BUSY_TRY_LATER: Int
Individual range request status, getStatus(). Indicates that the ranging operation failed because the peer is busy and unable to handle the request at this time. The requester should try again after a suggested delay, which can be retrieved with getRetryAfterDurationMillis().
Value: 12STATUS_FAIL
static val STATUS_FAIL: Int
Individual range request status, getStatus(). Indicates ranging operation failed and the distance value is invalid.
Value: 1STATUS_RESPONDER_DOES_NOT_SUPPORT_IEEE80211MC
static val STATUS_RESPONDER_DOES_NOT_SUPPORT_IEEE80211MC: Int
Individual range request status, getStatus(). Indicates that the ranging operation failed because the specified peer does not support IEEE 802.11mc RTT operations. Support by an Access Point can be confirmed using android.net.wifi.ScanResult#is80211mcResponder().
On such a failure, the individual result fields of RangingResult such as RangingResult.getDistanceMm() are invalid.
Value: 2STATUS_SUCCESS
static val STATUS_SUCCESS: Int
Individual range request status, getStatus(). Indicates ranging operation was successful and distance value is valid.
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. |
get80211azInitiatorTxLtfRepetitionsCount
fun get80211azInitiatorTxLtfRepetitionsCount(): Int
Gets LTF repetitions that the initiator station (ISTA) used in the preamble of the initiator to responder (I2R) null data PPDU (NDP) for this result. LTF repetitions is the multiple transmissions of HE-LTF symbols in an HE ranging NDP. An HE-LTF repetition value of 1 indicates no repetitions.
| Return | |
|---|---|
Int |
LTF repetitions count |
get80211azNumberOfRxSpatialStreams
fun get80211azNumberOfRxSpatialStreams(): Int
Gets number of receive spatial streams that the initiator station (ISTA) used for the initiator to responder (I2R) null data PPDU (NDP) for this result.
| Return | |
|---|---|
Int |
Number of spatial streams |
get80211azNumberOfTxSpatialStreams
fun get80211azNumberOfTxSpatialStreams(): Int
Gets number of transmit spatial streams that the initiator station (ISTA) used for the initiator to responder (I2R) null data PPDU (NDP) for this result.
| Return | |
|---|---|
Int |
Number of spatial streams |
get80211azResponderTxLtfRepetitionsCount
fun get80211azResponderTxLtfRepetitionsCount(): Int
Gets LTF repetitions that the responder station (RSTA) used in the preamble of the responder to initiator (I2R) null data PPDU (NDP) for this result. LTF repetitions is the multiple transmissions of HE-LTF symbols in an HE ranging NDP. An HE-LTF repetition value of 1 indicates no repetitions.
| Return | |
|---|---|
Int |
LTF repetitions count |
getAvailabilityWindowDurationMillis
fun getAvailabilityWindowDurationMillis(): Long
Gets availability window between measurements in milliseconds for proximity detection measurements. P2P Proximity Ranging uses two additional time parameters to coordinate availability duration called Availability Windows (AW). These are the Nominal Time and AW Duration that coordinate the time window period, and the start time of the time window period respectively. During AWs the ISTA and RSTA devices shall be available to exchange N successful FTM measurements instances where N equal the negotiated Meas Per AW. The ISTA indicates its preference for an AW duration and nominal time interval in the P2P Proximity Ranging Availability subelement, and the RSTA assigns the values used during the FTM session. The start of an AW duration is Nominal Time from the 1st successful measurement instance of the previous AW. The 1st AW occurs Nominal Time from the beginning of the 1st measurement instance following the initial FTM negotiation.
getDistanceMm
fun getDistanceMm(): Int
| Return | |
|---|---|
Int |
The distance (in mm) to the device specified by getMacAddress() or getPeerHandle().
Note: the measured distance may be negative for very close devices. Only valid if |
getDistanceStdDevMm
fun getDistanceStdDevMm(): Int
| Return | |
|---|---|
Int |
The standard deviation of the measured distance (in mm) to the device specified by getMacAddress() or getPeerHandle(). The standard deviation is calculated over the measurements executed in a single RTT burst. The number of measurements is returned by getNumSuccessfulMeasurements() - 0 successful measurements indicate that the standard deviation is not valid (a valid standard deviation requires at least 2 data points).
Only valid if |
getLci
fun getLci(): ByteArray
| Return | |
|---|---|
ByteArray |
The Location Configuration Information (LCI) as self-reported by the peer. The format is specified in the IEEE 802.11-2016 specifications, section 9.4.2.22.10.
Note: the information is NOT validated - use with caution. Consider validating it with other sources of information before using it. |
getLcr
fun getLcr(): ByteArray
| Return | |
|---|---|
ByteArray |
The Location Civic report (LCR) as self-reported by the peer. The format is specified in the IEEE 802.11-2016 specifications, section 9.4.2.22.13.
Note: the information is NOT validated - use with caution. Consider validating it with other sources of information before using it. |
getMacAddress
fun getMacAddress(): MacAddress?
| Return | |
|---|---|
MacAddress? |
The MAC address of the device whose range measurement was requested. Will correspond to the MAC address of the device in the RangingRequest.
Will return a |
getMaxTimeBetweenNtbMeasurementsMicros
fun getMaxTimeBetweenNtbMeasurementsMicros(): Long
Gets maximum time between measurements in microseconds for IEEE 802.11az non-trigger based ranging. The next 11az ranging request needs to be invoked before the maximum time from the last measurement time getRangingTimestampMillis(). Otherwise, the non-trigger based ranging session will be terminated and a new ranging negotiation will happen with the responding station.
getMeasurementBandwidth
fun getMeasurementBandwidth(): Int
The bandwidth used to transmit the RTT measurement frame.
| Return | |
|---|---|
Int |
one of ScanResult.CHANNEL_WIDTH_20MHZ, ScanResult.CHANNEL_WIDTH_40MHZ, ScanResult.CHANNEL_WIDTH_80MHZ, ScanResult.CHANNEL_WIDTH_160MHZ, CHANNEL_WIDTH_80MHZ_PLUS_MHZ or CHANNEL_WIDTH_320MHZ if available, otherwise UNSPECIFIED is returned.
. |
| Exceptions | |
|---|---|
java.lang.IllegalStateException |
if getStatus() does not return STATUS_SUCCESS. |
getMeasurementChannelFrequencyMHz
fun getMeasurementChannelFrequencyMHz(): Int
The center frequency of the primary 20 MHz frequency (in MHz) of the channel over which the measurement frames are sent.
| Return | |
|---|---|
Int |
center frequency in Mhz of the channel if available, otherwise UNSPECIFIED is returned.
|
| Exceptions | |
|---|---|
java.lang.IllegalStateException |
if getStatus() does not return STATUS_SUCCESS. |
getMinTimeBetweenNtbMeasurementsMicros
fun getMinTimeBetweenNtbMeasurementsMicros(): Long
Gets minimum time between measurements in microseconds for IEEE 802.11az non-trigger based ranging. The next 11az ranging measurement request must be invoked after the minimum time from the last measurement time getRangingTimestampMillis() for the peer. Otherwise, cached ranging result will be returned for the peer.
getNominalTimeMillis
fun getNominalTimeMillis(): Long
Get the nominal duration between adjacent availability window in milliseconds for proximity detection measurements.
getNumAttemptedMeasurements
fun getNumAttemptedMeasurements(): Int
| Return | |
|---|---|
Int |
The number of attempted measurements used in the RTT exchange resulting in this set of results. The number of successful measurements is returned by getNumSuccessfulMeasurements() which at most, if there are no errors, will be 1 less than the number of attempted measurements.
Only valid if |
getNumNtbRepetitionsPerMeasurement
fun getNumNtbRepetitionsPerMeasurement(): Int
Get the number of range repetitions carried out for distance calculation in Non Trigger Based (NTB) ranging. Note: Only applicable for IEEE 802.11az result.
| Return | |
|---|---|
Int |
The number of repetitions. |
getNumSuccessfulMeasurements
fun getNumSuccessfulMeasurements(): Int
| Return | |
|---|---|
Int |
The number of successful measurements used to calculate the distance and standard deviation. If the number of successful measurements if 1 then then standard deviation, returned by getDistanceStdDevMm(), is not valid (a 0 is returned for the standard deviation).
The total number of measurement attempts is returned by Only valid if |
getPasnComebackAfterMillis
fun getPasnComebackAfterMillis(): Long
Get Comeback after time in milliseconds. See getPasnComebackCookie(). A value 0 indicates the ranging request operation can be tried immediately with the cookie.
getPasnComebackCookie
fun getPasnComebackCookie(): ByteArray?
Get PASN comeback cookie. PASN authentication allows an AP to indicate the deferral time and optionally a Cookie. See getPasnComebackAfterMillis()
When an AP receives a large volume of initial PASN Authentication frames, it can use the comeback after field in the PASN Parameters element to indicate a deferral time and optionally provide a comeback cookie which is an opaque sequence of octets. Upon receiving this response, the ranging initiator (STA) must wait for the specified time before retrying secure authentication, presenting the received cookie to the AP.
| Return | |
|---|---|
ByteArray? |
This value may be null. |
getPeerHandle
fun getPeerHandle(): PeerHandle?
| Return | |
|---|---|
PeerHandle? |
The PeerHandle of the device whose range measurement was requested. Will correspond to the PeerHandle of the devices requested using RangingRequest.Builder.addWifiAwarePeer(PeerHandle).
Will return a |
getRangingTimestampMillis
fun getRangingTimestampMillis(): Long
| Return | |
|---|---|
Long |
The timestamp at which the ranging operation was performed. The timestamp is in milliseconds since boot, including time spent in sleep, corresponding to values provided by android.os.SystemClock#elapsedRealtime().
Only valid if |
getRetryAfterDurationMillis
fun getRetryAfterDurationMillis(): Int
| Return | |
|---|---|
Int |
The duration in milliseconds after which the ranging operation may be retried. A value of 0 means an immediate retry, otherwise retry after that much time in millisec. The time offset is from the measurement time getRangingTimestampMillis().
. |
| Exceptions | |
|---|---|
java.lang.IllegalStateException |
if getStatus() does not return STATUS_BUSY_TRY_LATER. |
getRssi
fun getRssi(): Int
| Return | |
|---|---|
Int |
The average RSSI, in units of dBm, observed during the RTT measurement.
Only valid if |
getSecureHeLtfProtocolVersion
fun getSecureHeLtfProtocolVersion(): Int
Get Secure HE-LTF protocol version used. The secure HE-LTF negotiation supports negotiation of the secure HE-LTF protocol version which allows a responder and an initiator to negotiate the highest mutually supported secure HE-LTF protocol version. Refer IEEE 802.11az-2022 spec, section 9.4.2.298 Ranging Parameters element.
| Return | |
|---|---|
Int |
Value is between 0 and 7 inclusive |
getStatus
fun getStatus(): Int
| Return | |
|---|---|
Int |
The status of ranging measurement: STATUS_SUCCESS in case of success, and STATUS_FAIL in case of failure. Value is one of the following: |
getUnverifiedResponderLocation
fun getUnverifiedResponderLocation(): ResponderLocation?
| Return | |
|---|---|
ResponderLocation? |
The unverified responder location represented as ResponderLocation which captures location information the responder is programmed to broadcast. The responder location is referred to as unverified, because we are relying on the device/site administrator to correctly configure its location data.
Will return a Only valid if |
getUsdPeerId
fun getUsdPeerId(): Int
Returns the USD peer identifier of the device whose range measurement was requested.
This value is non-negative if the responder is a USD peer and the range request was placed using android.net.wifi.rtt.RangingRequest.Builder#addWifiUsdPeer(DiscoveryResult,android.net.wifi.rtt.ProximityDetectionConfig,android.net.wifi.rtt.SecureRangingConfig). The peer ID is an opaque identifier for a specific USD peer discovered during USD discovery operations and obtained from the DiscoveryResult#getPeerId()
| Return | |
|---|---|
Int |
Will return a positive peer ID for results corresponding to requests issued using a USD peer ID, otherwise UNSPECIFIED is returned. |
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. |
is80211azNtbMeasurement
fun is80211azNtbMeasurement(): Boolean
| Return | |
|---|---|
Boolean |
The result is true if the IEEE 802.11az non-trigger based protocol was used. If the result is false, and is80211mcMeasurement() is also false a one-side RTT result is provided which does not subtract the turnaround time at the responder.
. Only valid if |
is80211mcMeasurement
fun is80211mcMeasurement(): Boolean
| Return | |
|---|---|
Boolean |
The result is true if the IEEE 802.11mc protocol was used. If the result is false, and is80211azNtbMeasurement() is also false a one-side RTT result is provided which does not subtract the turnaround time at the responder.
Only valid if |
isLmrDelayed
fun isLmrDelayed(): Boolean
Returns whether the Location Measurement Report (LMR) feedback is delayed. Note: Only applicable for IEEE 802.11az result.
| Return | |
|---|---|
Boolean |
true if LMR is delayed, false otherwise. |
isRangingAuthenticated
fun isRangingAuthenticated(): Boolean
| Return | |
|---|---|
Boolean |
whether the ranging is authenticated or not. Refer IEEE 802.11az-2022 spec, section 12 Security. |
isRangingFrameProtected
fun isRangingFrameProtected(): Boolean
| Return | |
|---|---|
Boolean |
whether the ranging frames are protected or not. Refer IEEE 802.11az-2022 spec, section 12 Security. |
isSecureHeLtfEnabled
fun isSecureHeLtfEnabled(): Boolean
| Return | |
|---|---|
Boolean |
whether the secure HE-LTF is enabled or not. Refer IEEE 802.11az-2022 spec, section 9.4.2.298 Ranging Parameters element. |
toString
fun toString(): String
| Return | |
|---|---|
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
dest |
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_WRITE_RETURN_VALUE. Value is either 0 or a combination of the following:
|