Language

PublishConfig.Builder.SetRangingEnabled(Boolean) Method

Definition

Configure whether the publish discovery session supports ranging and allows peers to measure distance to it.

[Android.Runtime.Register("setRangingEnabled", "(Z)Landroid/net/wifi/aware/PublishConfig$Builder;", "", ApiSince=28)]
public Android.Net.Wifi.Aware.PublishConfig.Builder? SetRangingEnabled(bool enable);
[<Android.Runtime.Register("setRangingEnabled", "(Z)Landroid/net/wifi/aware/PublishConfig$Builder;", "", ApiSince=28)>]
member this.SetRangingEnabled : bool -> Android.Net.Wifi.Aware.PublishConfig.Builder

Parameters

enable
Boolean

If true, ranging is supported on request of the peer.

Returns

The builder to facilitate chaining builder.setXXX(..).setXXX(..).

Attributes

Remarks

Configure whether the publish discovery session supports ranging and allows peers to measure distance to it. This API is used in conjunction with SubscribeConfig.Builder.setEgressDistanceMm(int) and SubscribeConfig.Builder.setIngressDistanceMm(int) to specify a minimum and/or maximum distance at which discovery will be triggered.

Optional. Disabled by default - i.e. any peer attempt to measure distance to this device will be refused and discovery will proceed without ranging constraints.

The device must support Wi-Fi RTT for this feature to be used. Feature support is checked as described in android.net.wifi.rtt.

Android reference for android.net.wifi.aware.PublishConfig.Builder.setRangingEnabled.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to