UwbManager

interface UwbManager


Interface for getting UWB capabilities and interacting with nearby UWB devices to perform ranging.

Summary

Public companion functions

UwbManager

Creates a new UwbManager that is used for creating UWB client sessions.

Public functions

suspend UwbClientSessionScope

This function is deprecated. Renamed to controleeSessionScope

suspend UwbControleeSessionScope
suspend UwbControllerSessionScope

Public companion functions

createInstance

Added in 1.0.0-alpha08
fun createInstance(context: Context): UwbManager

Creates a new UwbManager that is used for creating UWB client sessions.

Public functions

clientSessionScope

suspend fun clientSessionScope(): UwbClientSessionScope
Returns
UwbClientSessionScope

a new UwbClientSessionScope that tracks the lifecycle of a UWB connection.

Throws
androidx.core.uwb.exceptions.UwbServiceNotAvailableException

if the UWB is turned off.

androidx.core.uwb.exceptions.UwbHardwareNotAvailableException

if the hardware is not available on the device.

controleeSessionScope

suspend fun controleeSessionScope(): UwbControleeSessionScope
Returns
UwbControleeSessionScope

a new UwbControleeSessionScope that tracks the lifecycle of a UWB connection.

Throws
androidx.core.uwb.exceptions.UwbServiceNotAvailableException

if the UWB is turned off.

androidx.core.uwb.exceptions.UwbHardwareNotAvailableException

if the hardware is not available on the device.

controllerSessionScope

suspend fun controllerSessionScope(): UwbControllerSessionScope
Returns
UwbControllerSessionScope

a new UwbControllerSessionScope that tracks the lifecycle of a UWB connection.

Throws
androidx.core.uwb.exceptions.UwbServiceNotAvailableException

if the UWB is turned off.

androidx.core.uwb.exceptions.UwbHardwareNotAvailableException

if the hardware is not available on the device.

Extension functions

clientSessionScopeSingle

fun UwbManager.clientSessionScopeSingle(): Single<UwbClientSessionScope>

Returns a Single of UwbClientSessionScope.