UwbClientSessionScope
interface UwbClientSessionScope
UwbControleeSessionScope |
Interface for controlee client session that is established between nearby UWB devices. |
UwbControllerSessionScope |
Interface for controller client session that is established between nearby UWB devices. |
Interface for client session that is established between nearby UWB devices.
Summary
Public functions |
|
|---|---|
Flow<RangingResult> |
prepareSession(parameters: RangingParameters)Returns a flow of |
suspend Unit |
reconfigureRangeDataNtf(Dynamically reconfigures range data notification config to an active ranging session. |
Public properties |
|
|---|---|
UwbAddress |
A local address can only be used for a single ranging session. |
RangingCapabilities |
Returns the |
Extension functions |
|
|---|---|
Flowable<RangingResult> |
UwbClientSessionScope.rangingResultsFlowable(Returns a |
Observable<RangingResult> |
UwbClientSessionScope.rangingResultsObservable(Returns an |
Public functions
prepareSession
fun prepareSession(parameters: RangingParameters): Flow<RangingResult>
Returns a flow of RangingResult. Consuming the flow will initiate the UWB ranging and only one flow can be initiated. To consume the flow from multiple consumers, convert the flow to a SharedFlow.
| Throws | |
|---|---|
kotlin.IllegalStateException |
if a new flow was consumed again after the UWB ranging is already initiated. |
androidx.core.uwb.exceptions.UwbSystemCallbackException |
if the backend UWB system has resulted in an error. |
java.lang.SecurityException |
if ranging does not have the android.permission.UWB_RANGING permission. Apps must have requested and been granted this permission before calling this method. |
kotlin.IllegalArgumentException |
if the client starts a ranging session without setting complex channel and peer address. |
kotlin.IllegalArgumentException |
if the client starts a ranging session with invalid config id or ranging update type. |
reconfigureRangeDataNtf
suspend fun reconfigureRangeDataNtf(
configType: Int,
proximityNear: Int,
proximityFar: Int
): Unit
Dynamically reconfigures range data notification config to an active ranging session.
| Throws | |
|---|---|
kotlin.IllegalStateException |
if the ranging is inactive. Otherwise, this method will return successfully, then clients are expected to handle |
Public properties
localAddress
val localAddress: UwbAddress
A local address can only be used for a single ranging session. After a ranging session is ended, a new address will be allocated.
Ranging session duration may also be limited to prevent addresses from being used for too long. In this case, your ranging session would be suspended and clients would need to exchange the new address with their peer before starting again.
rangingCapabilities
val rangingCapabilities: RangingCapabilities
Returns the RangingCapabilities which the device supports.
Extension functions
rangingResultsFlowable
fun UwbClientSessionScope.rangingResultsFlowable(
parameters: RangingParameters
): Flowable<RangingResult>
Returns a Flowable of RangingResult.
| See also | |
|---|---|
prepareSession |
rangingResultsObservable
fun UwbClientSessionScope.rangingResultsObservable(
parameters: RangingParameters
): Observable<RangingResult>
Returns an Observable stream of RangingResult.
| See also | |
|---|---|
prepareSession |