RttRangingParams.Builder


public static final class RttRangingParams.Builder
extends Object

java.lang.Object
   ↳ android.ranging.wifi.rtt.RttRangingParams.Builder


Builder class for RttRangingParams.

Summary

Public constructors

Builder(String serviceName)

Constructs a new Builder for creating a Wifi NAN-RTT ranging session.

Public methods

RttRangingParams build()

Builds and returns a new RttRangingParams instance.

RttRangingParams.Builder setMatchFilter(byte[] matchFilter)

Sets the match filter to identify specific devices or services for RTT.

RttRangingParams.Builder setPeriodicRangingHwFeatureEnabled(boolean periodicRangingHwFeatureEnabled)

Sets whether to use hardware supported periodic ranging feature in WiFi Nan-RTT.

RttRangingParams.Builder setRangingUpdateRate(int updateRate)

Sets the update rate for the RTT ranging session.

Inherited methods

Public constructors

Builder

public Builder (String serviceName)

Constructs a new Builder for creating a Wifi NAN-RTT ranging session.

Parameters
serviceName String: The service name associated with this session This value cannot be null.

Throws
IllegalArgumentException if serviceName is null.

Public methods

build

public RttRangingParams build ()

Builds and returns a new RttRangingParams instance.

Returns
RttRangingParams a new RttRangingParams object configured with the provided parameters. This value cannot be null.

setMatchFilter

public RttRangingParams.Builder setMatchFilter (byte[] matchFilter)

Sets the match filter to identify specific devices or services for RTT.

Parameters
matchFilter byte: a byte array representing the filter. This value cannot be null.

Returns
RttRangingParams.Builder this Builder instance. This value cannot be null.

Throws
NullPointerException if either parameter is matchFilter is null.

setPeriodicRangingHwFeatureEnabled

public RttRangingParams.Builder setPeriodicRangingHwFeatureEnabled (boolean periodicRangingHwFeatureEnabled)

Sets whether to use hardware supported periodic ranging feature in WiFi Nan-RTT.

Parameters
periodicRangingHwFeatureEnabled boolean: true to enable periodic ranging; false otherwise.

Returns
RttRangingParams.Builder this Builder instance. This value cannot be null.

setRangingUpdateRate

public RttRangingParams.Builder setRangingUpdateRate (int updateRate)

Sets the update rate for the RTT ranging session.

Defaults to ERROR(RangingUpdateRate.UPDATE_RATE_NORMAL/android.ranging.raw.RawRangingDevice.RangingUpdateRate#UPDATE_RATE_NORMAL RangingUpdateRate.UPDATE_RATE_NORMAL)

Parameters
updateRate int: the reporting frequency.

Possible values: ERROR(RangingUpdateRate.UPDATE_RATE_NORMAL/android.ranging.raw.RawRangingDevice.RangingUpdateRate#UPDATE_RATE_NORMAL RangingUpdateRate.UPDATE_RATE_NORMAL) ERROR(RangingUpdateRate.UPDATE_RATE_INFREQUENT/android.ranging.raw.RawRangingDevice.RangingUpdateRate#UPDATE_RATE_INFREQUENT RangingUpdateRate.UPDATE_RATE_INFREQUENT) ERROR(RangingUpdateRate.UPDATE_RATE_FREQUENT/android.ranging.raw.RawRangingDevice.RangingUpdateRate#UPDATE_RATE_FREQUENT RangingUpdateRate.UPDATE_RATE_FREQUENT) Value is RawRangingDevice.UPDATE_RATE_NORMAL, RawRangingDevice.UPDATE_RATE_INFREQUENT, or RawRangingDevice.UPDATE_RATE_FREQUENT

Returns
RttRangingParams.Builder this Builder instance. This value cannot be null.