SubscribeConfig.Builder.SetEgressDistanceMm(Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An egress distance is configured to detect when the device exits a defined range.
[Android.Runtime.Register("setEgressDistanceMm", "(I)Landroid/net/wifi/aware/SubscribeConfig$Builder;", "", ApiSince=37)]
public Android.Net.Wifi.Aware.SubscribeConfig.Builder SetEgressDistanceMm(int egressDistanceMm);
[<Android.Runtime.Register("setEgressDistanceMm", "(I)Landroid/net/wifi/aware/SubscribeConfig$Builder;", "", ApiSince=37)>]
member this.SetEgressDistanceMm : int -> Android.Net.Wifi.Aware.SubscribeConfig.Builder
Parameters
- egressDistanceMm
- Int32
Egress distance, in mm, to the publisher above which to trigger discovery.
Returns
The builder to facilitate chaining builder.setXXX(..).setXXX(..). This value cannot be null.
- Attributes
Remarks
An egress distance is configured to detect when the device exits a defined range. A discovery result with range will be reported when the device moves out of the range of the egress distance (outer threshold) to a matching publisher (based on the other matching criteria in this configuration). This can be used in conjunction with setIngressDistanceMm(int) to specify a geofence.
When both ingress (inner threshold) and egress (outer threshold) distances are set for geofence, the ranging result will be reported when the device moves either into the range of the inner threshold or out of the range of the outer threshold.
For ranging to be used in discovery it must also be enabled on the publisher using PublishConfig.Builder.setRangingEnabled(boolean). However, ranging may not be available or enabled on the publisher or may be temporarily disabled on either subscriber or publisher - in such cases discovery will proceed without ranging.
When ranging is enabled and available on both publisher and subscriber and a service is discovered based on geofence constraints the DiscoverySessionCallback.onServiceDiscoveredWithinRange(PeerHandle,byte[],List,int) is called, otherwise the DiscoverySessionCallback.onServiceDiscovered(PeerHandle,byte[],List) is called.
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.SubscribeConfig.Builder.setEgressDistanceMm.
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.