UwbControllerSessionScope


interface UwbControllerSessionScope : UwbClientSessionScope


Interface for controller client session that is established between nearby UWB devices.

Summary

Public functions

suspend Unit

Dynamically adds a controlee to an active ranging session.

suspend Unit

Dynamically adds a controlee to an active ranging session.

suspend Unit
reconfigureRangingInterval(intervalSkipCount: Int)

Dynamically reconfigures ranging interval to an active ranging session.

suspend Unit

Dynamically removes a controlee from an active ranging session.

Public properties

UwbComplexChannel

The local device's complex channel which can be used for ranging.

Extension functions

Single<Unit>

Returns a Single that will run in a given block to add a controlee.

Single<Unit>

Returns a Single that will run in a given block to remove a controlee.

Inherited functions

From androidx.core.uwb.UwbClientSessionScope
Flow<RangingResult>

Returns a flow of RangingResult.

suspend Unit
reconfigureRangeDataNtf(
    configType: Int,
    proximityNear: Int,
    proximityFar: Int
)

Dynamically reconfigures range data notification config to an active ranging session.

Inherited properties

From androidx.core.uwb.UwbClientSessionScope
UwbAddress

A local address can only be used for a single ranging session.

RangingCapabilities

Returns the RangingCapabilities which the device supports.

Public functions

addControlee

Added in 1.0.0-alpha10
suspend fun addControlee(address: UwbAddress): Unit

Dynamically adds a controlee to an active ranging session. The controlee to be added must be configured with the a set of parameters that can join the existing connection.

Throws
kotlin.IllegalStateException

if the ranging is inactive or if the ranging profile is that of a unicast profile.

Otherwise, this method will return successfully, and clients are expected to handle either RangingResult.RangingResultPosition or RangingResult.RangingResultPeerDisconnected to listen for starts or failures.

addControlee

Added in 1.0.0-alpha10
suspend fun addControlee(address: UwbAddress, parameters: RangingControleeParameters): Unit

Dynamically adds a controlee to an active ranging session. The controlee to be added must be configured with the a set of parameters that can join the existing connection.

Throws
kotlin.IllegalStateException

if the ranging is inactive or if the ranging profile is not the provisioned STS individual key case.

Otherwise, this method will return successfully, and clients are expected to handle either RangingResult.RangingResultPosition or RangingResult.RangingResultPeerDisconnected to listen for starts or failures.

reconfigureRangingInterval

Added in 1.0.0-alpha10
suspend fun reconfigureRangingInterval(intervalSkipCount: Int): Unit

Dynamically reconfigures ranging interval to an active ranging session.

Throws
kotlin.IllegalStateException

if the ranging is inactive.

Otherwise, this method will return successfully with the ranging session reconfigured to skip number of ranging intervals set in intervalSkipCount. If intervalSkipCount is set to 0, the ranging interval will be set to the interval used when startRanging was called.

removeControlee

Added in 1.0.0-alpha10
suspend fun removeControlee(address: UwbAddress): Unit

Dynamically removes a controlee from an active ranging session.

Throws
kotlin.IllegalStateException

if the ranging is inactive, if the ranging profile is that of a unicast profile, or if the requested device is not being ranged to.

androidx.core.uwb.exceptions.UwbSystemCallbackException

if the operation failed due to hardware or firmware issues.

Otherwise, this method will return successfully, and clients are expected to handle RangingResult.RangingResultPeerDisconnected to listen for disconnects.

Public properties

uwbComplexChannel

Added in 1.0.0-alpha10
val uwbComplexChannelUwbComplexChannel

The local device's complex channel which can be used for ranging.

A complex channel can only be used for a single ranging session. After the ranging session is ended, a new channel will be allocated.

Ranging session duration may also be limited to prevent channels from being used for too long. In this case, your ranging session would be suspended and clients would need to exchange the new channel with their peer before starting again.

Extension functions

addControleeSingle

fun UwbControllerSessionScope.addControleeSingle(address: UwbAddress): Single<Unit>

Returns a Single that will run in a given block to add a controlee.

See also
addControlee

removeControleeSingle

fun UwbControllerSessionScope.removeControleeSingle(address: UwbAddress): Single<Unit>

Returns a Single that will run in a given block to remove a controlee.

See also
removeControlee