DlTdoaRangingParams.Builder


public static final class DlTdoaRangingParams.Builder
extends Object

java.lang.Object
   ↳ android.ranging.uwb.DlTdoaRangingParams.Builder


Builder for DlTdoaRangingParams.

Summary

Public constructors

Builder(int sessionId)

Constructor for the Builder.

Public methods

DlTdoaRangingParams build()

Builds the DlTdoaRangingParams instance.

DlTdoaRangingParams.Builder setComplexChannel(UwbComplexChannel complexChannel)

Sets the complex channel.

DlTdoaRangingParams.Builder setDeviceAddress(UwbAddress deviceAddress)

Sets the UWB address of the device.

DlTdoaRangingParams.Builder setMeasurementVersion(int measurementVersion)

Sets the measurement version.

DlTdoaRangingParams.Builder setRangingIntervalMillis(int rangingIntervalMs)

Sets the ranging interval in milliseconds.

DlTdoaRangingParams.Builder setRangingRoundIndexes(byte[] rangingRoundIndexes)

Sets the active ranging round indexes.

DlTdoaRangingParams.Builder setSessionKeyInfo(byte[] sessionKeyInfo)

Sets the session key information.

DlTdoaRangingParams.Builder setSlotDuration(int slotDuration)

Sets the slot duration.

DlTdoaRangingParams.Builder setSlotsPerRangingRound(int slotsPerRangingRound)

Sets the number of slots per ranging round.

Inherited methods

Public constructors

Builder

public Builder (int sessionId)

Constructor for the Builder.

Parameters
sessionId int: The session ID.

Public methods

build

public DlTdoaRangingParams build ()

Builds the DlTdoaRangingParams instance.

Returns
DlTdoaRangingParams The DlTdoaRangingParams instance.
This value cannot be null.

setComplexChannel

public DlTdoaRangingParams.Builder setComplexChannel (UwbComplexChannel complexChannel)

Sets the complex channel.

If not set, a default channel with channel 9 and preamble index 10 is used.

Parameters
complexChannel UwbComplexChannel: The complex channel.
This value cannot be null.

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

setDeviceAddress

public DlTdoaRangingParams.Builder setDeviceAddress (UwbAddress deviceAddress)

Sets the UWB address of the device.

If not set, a random short address is used as default.

Parameters
deviceAddress UwbAddress: The UWB address of the device.
This value cannot be null.

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

setMeasurementVersion

public DlTdoaRangingParams.Builder setMeasurementVersion (int measurementVersion)

Sets the measurement version.

Parameters
measurementVersion int: The measurement version.
Value is one of the following:
Returns
DlTdoaRangingParams.Builder this Builder instance.
This value cannot be null.

setRangingIntervalMillis

public DlTdoaRangingParams.Builder setRangingIntervalMillis (int rangingIntervalMs)

Sets the ranging interval in milliseconds.

If not set, 200ms is used as default.

Parameters
rangingIntervalMs int: The ranging interval in milliseconds.
Value is 1 or greater

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

Throws
IllegalArgumentException if the ranging interval is not positive.

setRangingRoundIndexes

public DlTdoaRangingParams.Builder setRangingRoundIndexes (byte[] rangingRoundIndexes)

Sets the active ranging round indexes.

If not set, {0} is used as default.

Parameters
rangingRoundIndexes byte: The active ranging round indexes.
This value cannot be null.

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

setSessionKeyInfo

public DlTdoaRangingParams.Builder setSessionKeyInfo (byte[] sessionKeyInfo)

Sets the session key information.

If not set, {7, 8, 1, 2, 3, 4, 5, 6} is used as default.

Parameters
sessionKeyInfo byte: The session key information.
This value cannot be null.

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

setSlotDuration

public DlTdoaRangingParams.Builder setSlotDuration (int slotDuration)

Sets the slot duration.

If not set, UwbRangingParams.DURATION_2_MS is used as default.

Parameters
slotDuration int: The slot duration.
Value is one of the following:
Returns
DlTdoaRangingParams.Builder this Builder instance.
This value cannot be null.

setSlotsPerRangingRound

public DlTdoaRangingParams.Builder setSlotsPerRangingRound (int slotsPerRangingRound)

Sets the number of slots per ranging round.

If not set, 25 is used as default.

Parameters
slotsPerRangingRound int: The number of slots per ranging round.
Value is 1 or greater

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

Throws
IllegalArgumentException if the slots per ranging round is not positive.