Builder


class Builder
kotlin.Any
   ↳ android.ranging.uwb.DlTdoaRangingParams.Builder

Builder for DlTdoaRangingParams.

Summary

Public constructors
Builder(sessionId: Int)

Constructor for the Builder.

Public methods
DlTdoaRangingParams

Builds the DlTdoaRangingParams instance.

DlTdoaRangingParams.Builder

Sets the complex channel.

DlTdoaRangingParams.Builder
setDeviceAddress(deviceAddress: UwbAddress)

Sets the UWB address of the device.

DlTdoaRangingParams.Builder
setMeasurementVersion(measurementVersion: Int)

Sets the measurement version.

DlTdoaRangingParams.Builder
setRangingIntervalMillis(rangingIntervalMs: Int)

Sets the ranging interval in milliseconds.

DlTdoaRangingParams.Builder
setRangingRoundIndexes(rangingRoundIndexes: ByteArray)

Sets the active ranging round indexes.

DlTdoaRangingParams.Builder
setSessionKeyInfo(sessionKeyInfo: ByteArray)

Sets the session key information.

DlTdoaRangingParams.Builder
setSlotDuration(slotDuration: Int)

Sets the slot duration.

DlTdoaRangingParams.Builder
setSlotsPerRangingRound(slotsPerRangingRound: Int)

Sets the number of slots per ranging round.

Public constructors

Builder

Builder(sessionId: Int)

Constructor for the Builder.

Parameters
sessionId Int: The session ID.

Public methods

build

fun build(): DlTdoaRangingParams

Builds the DlTdoaRangingParams instance.

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

setComplexChannel

fun setComplexChannel(complexChannel: UwbComplexChannel): DlTdoaRangingParams.Builder

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.
Return
DlTdoaRangingParams.Builder this Builder instance.
This value cannot be null.

setDeviceAddress

fun setDeviceAddress(deviceAddress: UwbAddress): DlTdoaRangingParams.Builder

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.
Return
DlTdoaRangingParams.Builder this Builder instance.
This value cannot be null.

setMeasurementVersion

fun setMeasurementVersion(measurementVersion: Int): DlTdoaRangingParams.Builder

Sets the measurement version.

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

setRangingIntervalMillis

fun setRangingIntervalMillis(rangingIntervalMs: Int): DlTdoaRangingParams.Builder

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
Return
DlTdoaRangingParams.Builder this Builder instance.
This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if the ranging interval is not positive.

setRangingRoundIndexes

fun setRangingRoundIndexes(rangingRoundIndexes: ByteArray): DlTdoaRangingParams.Builder

Sets the active ranging round indexes.

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

Parameters
rangingRoundIndexes ByteArray: The active ranging round indexes.
This value cannot be null.
Return
DlTdoaRangingParams.Builder this Builder instance.
This value cannot be null.

setSessionKeyInfo

fun setSessionKeyInfo(sessionKeyInfo: ByteArray): DlTdoaRangingParams.Builder

Sets the session key information.

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

Parameters
sessionKeyInfo ByteArray: The session key information.
This value cannot be null.
Return
DlTdoaRangingParams.Builder this Builder instance.
This value cannot be null.

setSlotDuration

fun setSlotDuration(slotDuration: Int): DlTdoaRangingParams.Builder

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:
Return
DlTdoaRangingParams.Builder this Builder instance.
This value cannot be null.

setSlotsPerRangingRound

fun setSlotsPerRangingRound(slotsPerRangingRound: Int): DlTdoaRangingParams.Builder

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
Return
DlTdoaRangingParams.Builder this Builder instance.
This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if the slots per ranging round is not positive.