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

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

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)

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