# Print output for @column tags ?>
public
static
final
class
RangingRequest.Builder
extends Object
java.lang.Object | |
↳ | android.net.wifi.rtt.RangingRequest.Builder |
Builder class used to construct RangingRequest
objects.
Public constructors | |
---|---|
Builder()
|
Public methods | |
---|---|
RangingRequest.Builder
|
addAccessPoint(ScanResult apInfo)
Add the device specified by the |
RangingRequest.Builder
|
addAccessPoints(List<ScanResult> apInfos)
Add the devices specified by the |
RangingRequest.Builder
|
addNon80211mcCapableAccessPoint(ScanResult apInfo)
Add the non-802.11mc capable device specified by the |
RangingRequest.Builder
|
addNon80211mcCapableAccessPoints(List<ScanResult> apInfos)
Add the non-802.11mc capable devices specified by the |
RangingRequest.Builder
|
addWifiAwarePeer(MacAddress peerMacAddress)
Add the device specified by the |
RangingRequest.Builder
|
addWifiAwarePeer(PeerHandle peerHandle)
Add a device specified by a |
RangingRequest
|
build()
Build |
RangingRequest.Builder
|
setRttBurstSize(int rttBurstSize)
Set the RTT Burst size for the ranging request. |
Inherited methods | |
---|---|
public Builder ()
public RangingRequest.Builder addAccessPoint (ScanResult apInfo)
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 RangingRequest.getMaxPeers()
.
Ranging will only be supported if the Access Point supports IEEE 802.11mc, also known as
two-sided RTT. 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 . |
Returns | |
---|---|
RangingRequest.Builder |
The builder to facilitate chaining
builder.setXXX(..).setXXX(..) . |
public RangingRequest.Builder addAccessPoints (List<ScanResult> apInfos)
Add the devices specified by the ScanResult
s 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 RangingRequest.getMaxPeers()
.
Ranging will only be supported if the Access Point supports IEEE 802.11mc, also known as
two-sided RTT. 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 |
List : Information of an Access Points (APs) obtained in a Scan Result.
This value cannot be null . |
Returns | |
---|---|
RangingRequest.Builder |
The builder to facilitate chaining
builder.setXXX(..).setXXX(..) . |
public RangingRequest.Builder addNon80211mcCapableAccessPoint (ScanResult apInfo)
Add the non-802.11mc capable 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 RangingRequest.getMaxPeers()
.
Accurate ranging cannot be supported if the Access Point does not support IEEE 802.11mc,
and instead an alternate protocol called one-sided RTT will be used with lower
accuracy. Use ScanResult#is80211mcResponder()
to verify the Access Point)s) are
not 802.11mc capable.
One-sided RTT does not subtract the RTT turnaround time at the Access Point, which can add hundreds of meters to the estimate. With experimentation it is possible to use this information to make a statistical estimate of the range by taking multiple measurements to several Access Points and normalizing the result. For some applications this can be used to improve range estimates based on Receive Signal Strength Indication (RSSI), but will not be as accurate as IEEE 802.11mc (two-sided RTT).
Note: one-sided RTT should only be used if you are very familiar with statistical estimation techniques.
Parameters | |
---|---|
apInfo |
ScanResult : Information of an Access Point (AP) obtained in a Scan Result.
This value cannot be null . |
Returns | |
---|---|
RangingRequest.Builder |
The builder to facilitate chaining
builder.setXXX(..).setXXX(..) .
This value cannot be null . |
public RangingRequest.Builder addNon80211mcCapableAccessPoints (List<ScanResult> apInfos)
Add the non-802.11mc capable devices 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 RangingRequest.getMaxPeers()
.
Accurate ranging cannot be supported if the Access Point does not support IEEE 802.11mc,
and instead an alternate protocol called one-sided RTT will be used with lower
accuracy. Use ScanResult#is80211mcResponder()
to verify the Access Point)s) are
not 802.11mc capable.
One-sided RTT does not subtract the RTT turnaround time at the Access Point, which can add hundreds of meters to the estimate. With experimentation it is possible to use this information to make a statistical estimate of the range by taking multiple measurements to several Access Points and normalizing the result. For some applications this can be used to improve range estimates based on Receive Signal Strength Indication (RSSI), but will not be as accurate as IEEE 802.11mc (two-sided RTT).
Note: one-sided RTT should only be used if you are very familiar with statistical estimation techniques.
Parameters | |
---|---|
apInfos |
List : Information of an Access Points (APs) obtained in a Scan Result.
This value cannot be null . |
Returns | |
---|---|
RangingRequest.Builder |
The builder to facilitate chaining
builder.setXXX(..).setXXX(..) .
This value cannot be null . |
public RangingRequest.Builder addWifiAwarePeer (MacAddress peerMacAddress)
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:
PublishConfig.PUBLISH_TYPE_UNSOLICITED
.
PublishConfig.Builder.setRangingEnabled(boolean)
.
Parameters | |
---|---|
peerMacAddress |
MacAddress : The MAC address of the Wi-Fi Aware peer.
This value cannot be null . |
Returns | |
---|---|
RangingRequest.Builder |
The builder, to facilitate chaining builder.setXXX(..).setXXX(..) . |
public RangingRequest.Builder addWifiAwarePeer (PeerHandle peerHandle)
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 requesting device can be either publisher or
subscriber in a discovery session. For both requesting device and peer device ranging
must be enabled on the discovery session:
PublishConfig.Builder.setRangingEnabled(boolean)
for
publisher.SubscribeConfig.Builder.setMinDistanceMm(int)
or SubscribeConfig.Builder.setMaxDistanceMm(int)
must be
set to enable ranging on subscriber Parameters | |
---|---|
peerHandle |
PeerHandle : The peer handler of the peer Wi-Fi Aware device.
This value cannot be null . |
Returns | |
---|---|
RangingRequest.Builder |
The builder, to facilitate chaining builder.setXXX(..).setXXX(..) . |
public RangingRequest build ()
Build RangingRequest
given the current configurations made on the
builder.
Returns | |
---|---|
RangingRequest |
public RangingRequest.Builder setRttBurstSize (int rttBurstSize)
Set the RTT Burst size for the ranging request.
If not set, the default RTT burst size given by
RangingRequest.getDefaultRttBurstSize()
is used to determine the default value.
If set, the value must be in the range RangingRequest.getMinRttBurstSize()
and
RangingRequest.getMaxRttBurstSize()
inclusively, or a
IllegalArgumentException
will be thrown.
Parameters | |
---|---|
rttBurstSize |
int : The number of FTM packets used to estimate a range. |
Returns | |
---|---|
RangingRequest.Builder |
The builder to facilitate chaining
builder.setXXX(..).setXXX(..) .
This value cannot be null . |