UwbControllerSessionScope


public interface UwbControllerSessionScope extends UwbClientSessionScope


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

Summary

Public methods

abstract void

Dynamically adds a controlee to an active ranging session.

abstract void
addControlee(
    @NonNull UwbAddress address,
    @NonNull RangingControleeParameters parameters
)

Dynamically adds a controlee to an active ranging session.

abstract @NonNull UwbComplexChannel

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

abstract void
reconfigureRangingInterval(int intervalSkipCount)

Dynamically reconfigures ranging interval to an active ranging session.

abstract void

Dynamically removes a controlee from an active ranging session.

Extension functions

default final @NonNull Single<Unit>

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

default final @NonNull Single<Unit>

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

Inherited methods

From androidx.core.uwb.UwbClientSessionScope
abstract @NonNull UwbAddress

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

abstract @NonNull RangingCapabilities

Returns the RangingCapabilities which the device supports.

abstract @NonNull Flow<@NonNull RangingResult>

Returns a flow of RangingResult.

abstract void
reconfigureRangeDataNtf(
    int configType,
    int proximityNear,
    int proximityFar
)

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

Public methods

addControlee

Added in 1.0.0-alpha09
abstract void addControlee(@NonNull UwbAddress address)

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-alpha09
abstract void addControlee(
    @NonNull UwbAddress address,
    @NonNull RangingControleeParameters parameters
)

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.

getUwbComplexChannel

Added in 1.0.0-alpha09
abstract @NonNull UwbComplexChannel getUwbComplexChannel()

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.

reconfigureRangingInterval

Added in 1.0.0-alpha09
abstract void reconfigureRangingInterval(int intervalSkipCount)

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-alpha09
abstract void removeControlee(@NonNull UwbAddress address)

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.

Extension functions

UwbControllerSessionScopeRx.addControleeSingle

default final @NonNull Single<UnitUwbControllerSessionScopeRx.addControleeSingle(
    @NonNull UwbControllerSessionScope receiver,
    @NonNull UwbAddress address
)

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

See also
addControlee

UwbControllerSessionScopeRx.removeControleeSingle

default final @NonNull Single<UnitUwbControllerSessionScopeRx.removeControleeSingle(
    @NonNull UwbControllerSessionScope receiver,
    @NonNull UwbAddress address
)

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

See also
removeControlee