Builder
class Builder
| kotlin.Any | |
| ↳ | android.net.wifi.rtt.RangingRequest.Builder |
Builder class used to construct RangingRequest objects.
Summary
Public constructors |
|
|---|---|
<init>() |
|
Public methods |
|
|---|---|
| RangingRequest.Builder! |
addAccessPoint(apInfo: ScanResult)Add the device specified by the |
| RangingRequest.Builder! |
addAccessPoints(apInfos: MutableList<ScanResult!>)Add the devices specified by the |
| RangingRequest.Builder! |
addWifiAwarePeer(peerMacAddress: MacAddress)Add the device specified by the |
| RangingRequest.Builder! |
addWifiAwarePeer(peerHandle: PeerHandle)Add a device specified by a |
| RangingRequest! |
build()Build |
Public constructors
<init>
Builder()
Public methods
addAccessPoint
fun addAccessPoint(apInfo: ScanResult): RangingRequest.Builder!
Add the device specified by the ScanResult to the list of devices with which to measure range. The total number of peers added to a request cannot exceed the limit specified by getMaxPeers().
Ranging may not be supported if the Access Point does not support IEEE 802.11mc. Use ScanResult#is80211mcResponder() to verify the Access Point's capabilities. If not supported the result status will be RangingResult#STATUS_RESPONDER_DOES_NOT_SUPPORT_IEEE80211MC.
| Parameters | |
|---|---|
apInfo |
ScanResult: Information of an Access Point (AP) obtained in a Scan Result. This value cannot be null. |
| Return | |
|---|---|
RangingRequest.Builder! |
The builder to facilitate chaining builder.setXXX(..).setXXX(..). |
addAccessPoints
fun addAccessPoints(apInfos: MutableList<ScanResult!>): RangingRequest.Builder!
Add the devices specified by the ScanResults to the list of devices with which to measure range. The total number of peers added to a request cannot exceed the limit specified by getMaxPeers().
Ranging may not be supported if the Access Point does not support IEEE 802.11mc. Use ScanResult#is80211mcResponder() to verify the Access Point's capabilities. If not supported the result status will be RangingResult#STATUS_RESPONDER_DOES_NOT_SUPPORT_IEEE80211MC.
| Parameters | |
|---|---|
apInfos |
MutableList<ScanResult!>: Information of an Access Points (APs) obtained in a Scan Result. This value cannot be null. |
| Return | |
|---|---|
RangingRequest.Builder! |
The builder to facilitate chaining builder.setXXX(..).setXXX(..). |
addWifiAwarePeer
fun addWifiAwarePeer(peerMacAddress: MacAddress): RangingRequest.Builder!
Add the device specified by the peerMacAddress to the list of devices with which to measure range.
The MAC address may be obtained out-of-band from a peer Wi-Fi Aware device. A Wi-Fi Aware device may obtain its MAC address using the IdentityChangedListener provided to WifiAwareManager#attach(AttachCallback, IdentityChangedListener, Handler).
Note: in order to use this API the device must support Wi-Fi Aware android.net.wifi.aware. The peer device which is being ranged to must be configured to publish a service (with any name) with:
android.net.wifi.aware.PublishConfig#PUBLISH_TYPE_UNSOLICITED. android.net.wifi.aware.PublishConfig.Builder#setRangingEnabled(boolean).| Parameters | |
|---|---|
peerMacAddress |
MacAddress: The MAC address of the Wi-Fi Aware peer. This value cannot be null. |
| Return | |
|---|---|
RangingRequest.Builder! |
The builder, to facilitate chaining builder.setXXX(..).setXXX(..). |
addWifiAwarePeer
fun addWifiAwarePeer(peerHandle: PeerHandle): RangingRequest.Builder!
Add a device specified by a PeerHandle to the list of devices with which to measure range.
The PeerHandle may be obtained as part of the Wi-Fi Aware discovery process. E.g. using DiscoverySessionCallback#onServiceDiscovered(PeerHandle, byte[], List).
Note: in order to use this API the device must support Wi-Fi Aware android.net.wifi.aware. The peer device which is being ranged to must be configured to publish a service (with any name) with:
android.net.wifi.aware.PublishConfig#PUBLISH_TYPE_UNSOLICITED. android.net.wifi.aware.PublishConfig.Builder#setRangingEnabled(boolean).| Parameters | |
|---|---|
peerHandle |
PeerHandle: The peer handler of the peer Wi-Fi Aware device. This value cannot be null. |
| Return | |
|---|---|
RangingRequest.Builder! |
The builder, to facilitate chaining builder.setXXX(..).setXXX(..). |
build
fun build(): RangingRequest!
Build RangingRequest given the current configurations made on the builder.

