Builder


class Builder
kotlin.Any
   ↳ android.net.wifi.rtt.RangingResult.Builder

Builder class used to construct RangingResult objects.

Summary

Public constructors

Public methods
RangingResult

Build RangingResult

RangingResult.Builder

Sets LTF repetitions that the initiator station used in the preamble.

RangingResult.Builder
set80211azNtbMeasurement(is80211azNtbMeasurement: Boolean)

Sets whether the ranging measurement was performed using IEEE 802.

RangingResult.Builder

Sets number of receive spatial streams that the initiator station used for the ranging result.

RangingResult.Builder

Sets number of transmit spatial streams that the initiator station used for the ranging result.

RangingResult.Builder

Sets LTF repetitions that the responder station used in the preamble.

RangingResult.Builder
set80211mcMeasurement(is80211mcMeasurement: Boolean)

Sets whether the ranging measurement was performed using IEEE 802.

RangingResult.Builder
setDistanceMm(distanceMm: Int)

Sets the distance in millimeter.

RangingResult.Builder
setDistanceStdDevMm(distanceStdDevMm: Int)

Sets the standard deviation of the distance in millimeter.

RangingResult.Builder

Sets the Location Configuration Information (LCI).

RangingResult.Builder

Sets the Location Civic Report (LCR).

RangingResult.Builder
setMacAddress(macAddress: MacAddress?)

Sets the MAC address of the ranging result.

RangingResult.Builder

Sets maximum time between measurements in microseconds for IEEE 802.

RangingResult.Builder
setMeasurementBandwidth(measurementBandwidth: Int)

Sets the bandwidth used to transmit the RTT measurement frame.

RangingResult.Builder

Sets the center frequency of the primary 20 MHz frequency (in MHz) of the channel over which the measurement frames are sent.

RangingResult.Builder

Sets minimum time between measurements in microseconds for IEEE 802.

RangingResult.Builder
setNumAttemptedMeasurements(numAttemptedMeasurements: Int)

Sets the total number of RTT measurements attempted.

RangingResult.Builder
setNumSuccessfulMeasurements(numSuccessfulMeasurements: Int)

Sets the total number of successful RTT measurements.

RangingResult.Builder
setPeerHandle(peerHandle: PeerHandle?)

Sets the peer handle.

RangingResult.Builder

Sets the time stamp at which the ranging operation was performed.

RangingResult.Builder
setRssi(rssi: Int)

Sets the average RSSI.

RangingResult.Builder
setStatus(status: Int)

Sets the Range result status.

RangingResult.Builder

Sets Responder Location.

Public constructors

Builder

Builder()

Public methods

build

fun build(): RangingResult

Build RangingResult

Return
RangingResult an instance of RangingResult This value cannot be null.

set80211azInitiatorTxLtfRepetitionsCount

fun set80211azInitiatorTxLtfRepetitionsCount(i2rTxLtfRepetitions: Int): RangingResult.Builder

Sets LTF repetitions that the initiator station used in the preamble. If not set, defaults to RangingResult#UNSPECIFIED.

Parameters
i2rTxLtfRepetitions Int: LFT repetition count.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

set80211azNtbMeasurement

fun set80211azNtbMeasurement(is80211azNtbMeasurement: Boolean): RangingResult.Builder

Sets whether the ranging measurement was performed using IEEE 802.11az non-trigger ranging method. If set80211azNtbMeasurement(boolean) is set as false and set80211mcMeasurement(boolean) is also set as false, ranging measurement was performed using one-side RTT. If not set defaults to false.

Parameters
is80211azNtbMeasurement Boolean: true for IEEE 802.11az non-trigger based measurement, otherwise false.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

set80211azNumberOfRxSpatialStreams

fun set80211azNumberOfRxSpatialStreams(numRxSpatialStreams: Int): RangingResult.Builder

Sets number of receive spatial streams that the initiator station used for the ranging result. If not set, defaults to RangingResult#UNSPECIFIED.

Parameters
numRxSpatialStreams Int: Number of receive spatial streams.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

set80211azNumberOfTxSpatialStreams

fun set80211azNumberOfTxSpatialStreams(numTxSpatialStreams: Int): RangingResult.Builder

Sets number of transmit spatial streams that the initiator station used for the ranging result. If not set, defaults to RangingResult#UNSPECIFIED.

Parameters
numTxSpatialStreams Int: Number of transmit spatial streams.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

set80211azResponderTxLtfRepetitionsCount

fun set80211azResponderTxLtfRepetitionsCount(r2iTxLtfRepetitions: Int): RangingResult.Builder

Sets LTF repetitions that the responder station used in the preamble. If not set, defaults to RangingResult#UNSPECIFIED.

Parameters
r2iTxLtfRepetitions Int: LFT repetition count.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

set80211mcMeasurement

fun set80211mcMeasurement(is80211mcMeasurement: Boolean): RangingResult.Builder

Sets whether the ranging measurement was performed using IEEE 802.11mc ranging method. If set80211mcMeasurement(boolean) is set as false and set80211azNtbMeasurement(boolean) is also set as false, ranging measurement was performed using one-side RTT. If not set, default to false.

Parameters
is80211mcMeasurement Boolean: true for IEEE 802.11mc measure, otherwise false.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

setDistanceMm

fun setDistanceMm(distanceMm: Int): RangingResult.Builder

Sets the distance in millimeter.

Parameters
distanceMm Int: distance. If not set, defaults to 0.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

setDistanceStdDevMm

fun setDistanceStdDevMm(distanceStdDevMm: Int): RangingResult.Builder

Sets the standard deviation of the distance in millimeter.

Parameters
distanceStdDevMm Int: Standard deviation of the distance measurement. If not set defaults to 0.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

setLci

fun setLci(lci: ByteArray?): RangingResult.Builder

Sets the Location Configuration Information (LCI). LCI provides data about the access point's (AP) physical location, such as its latitude, longitude, and altitude. The format is specified in the IEEE 802.11-2016 specifications, section 9.4.2.22.10.

Parameters
lci ByteArray?: Location configuration information. If not set, defaults to null.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

setLcr

fun setLcr(lcr: ByteArray?): RangingResult.Builder

Sets the Location Civic Report (LCR). LCR provides additional details about the AP's location in a human-readable format, such as the street address, building name, or floor number. This can be helpful for users to understand the context of their location within a building or complex. The format is specified in the IEEE 802.11-2016 specifications, section 9.4.2.22.13.

Parameters
lcr ByteArray?: Location civic report. If not set, defaults to null.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

setMacAddress

fun setMacAddress(macAddress: MacAddress?): RangingResult.Builder

Sets the MAC address of the ranging result.

Parameters
macAddress MacAddress?: Mac address, if not defaults to null.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

setMaxTimeBetweenNtbMeasurementsMicros

fun setMaxTimeBetweenNtbMeasurementsMicros(ntbMaxMeasurementTime: Long): RangingResult.Builder

Sets maximum time between measurements in microseconds for IEEE 802.11az non-trigger based ranging. If not set, defaults to RangingResult#UNSPECIFIED.

Parameters
ntbMaxMeasurementTime Long: non-trigger based ranging maximum measurement time.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

setMeasurementBandwidth

fun setMeasurementBandwidth(measurementBandwidth: Int): RangingResult.Builder

Sets the bandwidth used to transmit the RTT measurement frame. If not set, default to RangingResult#UNSPECIFIED.

Parameters
measurementBandwidth Int: Measurement bandwidth. Value is android.net.wifi.ScanResult#CHANNEL_WIDTH_20MHZ, android.net.wifi.ScanResult#CHANNEL_WIDTH_40MHZ, android.net.wifi.ScanResult#CHANNEL_WIDTH_80MHZ, android.net.wifi.ScanResult#CHANNEL_WIDTH_160MHZ, android.net.wifi.ScanResult#CHANNEL_WIDTH_80MHZ_PLUS_MHZ, or android.net.wifi.ScanResult#CHANNEL_WIDTH_320MHZ
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

setMeasurementChannelFrequencyMHz

fun setMeasurementChannelFrequencyMHz(frequencyMHz: Int): RangingResult.Builder

Sets the center frequency of the primary 20 MHz frequency (in MHz) of the channel over which the measurement frames are sent. If not set, default to RangingResult#UNSPECIFIED

Parameters
frequencyMHz Int: Frequency.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

setMinTimeBetweenNtbMeasurementsMicros

fun setMinTimeBetweenNtbMeasurementsMicros(ntbMinMeasurementTime: Long): RangingResult.Builder

Sets minimum time between measurements in microseconds for IEEE 802.11az non-trigger based ranging. If not set, defaults to RangingResult#UNSPECIFIED.

Parameters
ntbMinMeasurementTime Long: non-trigger based ranging minimum measurement time.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

setNumAttemptedMeasurements

fun setNumAttemptedMeasurements(numAttemptedMeasurements: Int): RangingResult.Builder

Sets the total number of RTT measurements attempted.

Parameters
numAttemptedMeasurements Int: Number of attempted measurements. If not set, default to 0.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

setNumSuccessfulMeasurements

fun setNumSuccessfulMeasurements(numSuccessfulMeasurements: Int): RangingResult.Builder

Sets the total number of successful RTT measurements.

Parameters
numSuccessfulMeasurements Int: Number of successful measurements. If not set, default to 0.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

setPeerHandle

fun setPeerHandle(peerHandle: PeerHandle?): RangingResult.Builder

Sets the peer handle. Applicable only for NAN Ranging.

Parameters
peerHandle PeerHandle?: Opaque object used to represent a Wi-Fi Aware peer. If not set, defaults to null.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

setRangingTimestampMillis

fun setRangingTimestampMillis(timestamp: Long): RangingResult.Builder

Sets the time stamp 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().

Parameters
timestamp Long: time stamp in milliseconds. If not set, default to 0. Value is a non-negative timestamp in the android.os.SystemClock#elapsedRealtime() time base.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

setRssi

fun setRssi(rssi: Int): RangingResult.Builder

Sets the average RSSI.

Parameters
rssi Int: Average RSSI. If not set, defaults to -127.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

setStatus

fun setStatus(status: Int): RangingResult.Builder

Sets the Range result status.

Parameters
status Int: Ranging result status, if not set defaults to STATUS_FAIL. Value is android.net.wifi.rtt.RangingResult#STATUS_SUCCESS, android.net.wifi.rtt.RangingResult#STATUS_FAIL, or android.net.wifi.rtt.RangingResult#STATUS_RESPONDER_DOES_NOT_SUPPORT_IEEE80211MC
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.

setUnverifiedResponderLocation

fun setUnverifiedResponderLocation(responderLocation: ResponderLocation?): RangingResult.Builder

Sets Responder Location. 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.

Parameters
responderLocation ResponderLocation?: Responder location. If not set, defaults to null.
Return
RangingResult.Builder The builder to facilitate chaining. This value cannot be null.