Added in API level 36

Builder


class Builder
kotlin.Any
   ↳ android.ranging.oob.OobInitiatorRangingConfig.Builder

Builder class for creating instances of OobInitiatorRangingConfig.

Summary

Public constructors

Public methods
OobInitiatorRangingConfig.Builder

Adds a DeviceHandle to the list of devices for the ranging session.

OobInitiatorRangingConfig.Builder

Adds a list of DeviceHandle to the list of devices for the ranging session.

OobInitiatorRangingConfig

Builds an instance of OobInitiatorRangingConfig with the provided parameters.

OobInitiatorRangingConfig.Builder

Sets the fastest ranging interval in milliseconds.

OobInitiatorRangingConfig.Builder
setRangingMode(rangingMode: Int)

Sets the ranging mode for the session.

OobInitiatorRangingConfig.Builder
setRangingTechnologyFilter(rangingTechnologies: MutableSet<Int!>)

Sets a filter for the ranging technologies that can be used for the session.

OobInitiatorRangingConfig.Builder
setSecurityLevel(securityLevel: Int)

Sets the security level for the ranging session.

OobInitiatorRangingConfig.Builder

Sets the slowest ranging interval in milliseconds.

Public constructors

Builder

Added in API level 36
Builder()

Public methods

addDeviceHandle

Added in API level 36
fun addDeviceHandle(deviceHandle: DeviceHandle): OobInitiatorRangingConfig.Builder

Adds a DeviceHandle to the list of devices for the ranging session.

Parameters
deviceHandle DeviceHandle: The DeviceHandle to add. This value cannot be null.
Return
OobInitiatorRangingConfig.Builder The Builder instance. This value cannot be null.

addDeviceHandles

Added in API level 36
fun addDeviceHandles(deviceHandles: MutableList<DeviceHandle!>): OobInitiatorRangingConfig.Builder

Adds a list of DeviceHandle to the list of devices for the ranging session.

Parameters
deviceHandles MutableList<DeviceHandle!>: The list of DeviceHandles to add. This value cannot be null.
Return
OobInitiatorRangingConfig.Builder The Builder instance. This value cannot be null.

build

Added in API level 36
fun build(): OobInitiatorRangingConfig

Builds an instance of OobInitiatorRangingConfig with the provided parameters.

Return
OobInitiatorRangingConfig A new OobInitiatorRangingConfig instance. This value cannot be null.

setFastestRangingInterval

Added in API level 36
fun setFastestRangingInterval(intervalMs: Duration): OobInitiatorRangingConfig.Builder

Sets the fastest ranging interval in milliseconds.

Parameters
intervalMs Duration: The fastest interval in milliseconds. Defaults to 100ms This value cannot be null.
Return
OobInitiatorRangingConfig.Builder The Builder instance, for chaining calls. This value cannot be null.

setRangingTechnologyFilter

fun setRangingTechnologyFilter(rangingTechnologies: MutableSet<Int!>): OobInitiatorRangingConfig.Builder

Sets a filter for the ranging technologies that can be used for the session.

If this set is empty (the default), the system will attempt to use any available and suitable ranging technology. If the set is non-empty, the system will restrict its choice of technology to those specified in this set.

Parameters
rangingTechnologies MutableSet<Int!>: A Set of Ranging Technology integers. Must not be null. To indicate no preference (allow any technology), pass an empty set.
Return
OobInitiatorRangingConfig.Builder this Builder instance. This value cannot be null.

setSecurityLevel

Added in API level 36
fun setSecurityLevel(securityLevel: Int): OobInitiatorRangingConfig.Builder

Sets the security level for the ranging session.

Parameters
securityLevel Int: The security level to set. Defaults to SECURITY_LEVEL_BASIC Value is android.ranging.oob.OobInitiatorRangingConfig#SECURITY_LEVEL_BASIC, or android.ranging.oob.OobInitiatorRangingConfig#SECURITY_LEVEL_SECURE
Return
OobInitiatorRangingConfig.Builder The Builder instance. This value cannot be null.

setSlowestRangingInterval

Added in API level 36
fun setSlowestRangingInterval(intervalMs: Duration): OobInitiatorRangingConfig.Builder

Sets the slowest ranging interval in milliseconds.

Parameters
intervalMs Duration: The slowest interval in milliseconds. Defaults to 5000ms This value cannot be null.
Return
OobInitiatorRangingConfig.Builder The Builder instance, for chaining calls. This value cannot be null.