# UwbControllerSessionScope

Artifact: [androidx.core.uwb:uwb](https://developer.android.com/jetpack/androidx/releases/core-uwb) [View Source](https://cs.android.com/search?q=file:androidx/core/uwb/UwbControllerSessionScope.kt+class:androidx.core.uwb.UwbControllerSessionScope) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core-uwb#1.0.0)

*** ** * ** ***


```
public interface UwbControllerSessionScope extends UwbClientSessionScope
```

<br />

*** ** * ** ***

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

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/core/uwb/UwbControllerSessionScope#addControlee(androidx.core.uwb.UwbAddress)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/uwb/UwbAddress address)` Dynamically adds a controlee to an active ranging session. |
| `abstract void` | `https://developer.android.com/reference/androidx/core/uwb/UwbControllerSessionScope#addControlee(androidx.core.uwb.UwbAddress,androidx.core.uwb.RangingControleeParameters)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/uwb/UwbAddress address, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/uwb/RangingControleeParameters parameters )` Dynamically adds a controlee to an active ranging session. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/uwb/UwbComplexChannel` | `https://developer.android.com/reference/androidx/core/uwb/UwbControllerSessionScope#getUwbComplexChannel()()` The local device's complex channel which can be used for ranging. |
| `abstract void` | `https://developer.android.com/reference/androidx/core/uwb/UwbControllerSessionScope#reconfigureRangingInterval(kotlin.Int)(int intervalSkipCount)` Dynamically reconfigures ranging interval to an active ranging session. |
| `abstract void` | `https://developer.android.com/reference/androidx/core/uwb/UwbControllerSessionScope#removeControlee(androidx.core.uwb.UwbAddress)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/uwb/UwbAddress address)` Dynamically removes a controlee from an active ranging session. |

| ### Extension functions |
|---|---|
| `default final @https://developer.android.com/reference/androidx/annotation/NonNull http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Single.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html>` | `https://developer.android.com/reference/androidx/core/uwb/UwbControllerSessionScopeRx.https://developer.android.com/reference/androidx/core/uwb/UwbControllerSessionScope#(androidx.core.uwb.UwbControllerSessionScope).addControleeSingle(androidx.core.uwb.UwbAddress)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/uwb/UwbControllerSessionScope receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/uwb/UwbAddress address )` Returns a `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Single.html` that will run in a given block to add a controlee. |
| `default final @https://developer.android.com/reference/androidx/annotation/NonNull http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Single.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html>` | `https://developer.android.com/reference/androidx/core/uwb/UwbControllerSessionScopeRx.https://developer.android.com/reference/androidx/core/uwb/UwbControllerSessionScope#(androidx.core.uwb.UwbControllerSessionScope).removeControleeSingle(androidx.core.uwb.UwbAddress)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/uwb/UwbControllerSessionScope receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/uwb/UwbAddress address )` Returns a `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Single.html` that will run in a given block to remove a controlee. |

### Inherited methods

From [androidx.core.uwb.UwbClientSessionScope](https://developer.android.com/reference/androidx/core/uwb/UwbClientSessionScope) `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/uwb/UwbAddress` `https://developer.android.com/reference/androidx/core/uwb/UwbClientSessionScope#getLocalAddress()()`

A local address can only be used for a single ranging session.
`abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/uwb/RangingCapabilities` `https://developer.android.com/reference/androidx/core/uwb/UwbClientSessionScope#getRangingCapabilities()()`

Returns the `https://developer.android.com/reference/androidx/core/uwb/RangingCapabilities` which the device supports.
`abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/uwb/RangingResult>` `https://developer.android.com/reference/androidx/core/uwb/UwbClientSessionScope#prepareSession(androidx.core.uwb.RangingParameters)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/uwb/RangingParameters parameters)`

Returns a flow of `https://developer.android.com/reference/androidx/core/uwb/RangingResult`.
`default @https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/uwb/SensorFusionResult>` `https://developer.android.com/reference/androidx/core/uwb/UwbClientSessionScope#prepareSession(androidx.core.uwb.SensorFusionParameters)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/uwb/SensorFusionParameters parameters)`

Prepare a sensor fusion session, which performs software angle of arrival estimation and adjusts range for local device motion at a high resolution.
`abstract void` `https://developer.android.com/reference/androidx/core/uwb/UwbClientSessionScope#reconfigureRangeDataNtf(kotlin.Int,kotlin.Int,kotlin.Int)(
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](https://developer.android.com/jetpack/androidx/releases/core-uwb#1.0.0)

```
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 |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | 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 `https://developer.android.com/reference/androidx/core/uwb/RangingResult.RangingResultPosition` or `https://developer.android.com/reference/androidx/core/uwb/RangingResult.RangingResultFailure` to listen for starts or failures. |

### addControlee

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core-uwb#1.0.0)

```
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 |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | 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 `https://developer.android.com/reference/androidx/core/uwb/RangingResult.RangingResultPosition` or `https://developer.android.com/reference/androidx/core/uwb/RangingResult.RangingResultPeerDisconnected` to listen for starts or failures. |

### getUwbComplexChannel

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core-uwb#1.0.0)

```
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](https://developer.android.com/jetpack/androidx/releases/core-uwb#1.0.0)

```
abstract void reconfigureRangingInterval(int intervalSkipCount)
```

Dynamically reconfigures ranging interval to an active ranging session.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | 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](https://developer.android.com/jetpack/androidx/releases/core-uwb#1.0.0)

```
abstract void removeControlee(@NonNull UwbAddress address)
```

Dynamically removes a controlee from an active ranging session.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | 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. |
| `https://developer.android.com/reference/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 `https://developer.android.com/reference/androidx/core/uwb/RangingResult.RangingResultPeerDisconnected` to listen for disconnects. |

## Extension functions

### UwbControllerSessionScopeRx.addControleeSingle

Artifact: [androidx.core.uwb:uwb-rxjava3](https://developer.android.com/jetpack/androidx/releases/core-uwb) [View Source](https://cs.android.com/search?q=file:androidx/core/uwb/rxjava3/UwbControllerSessionScopeRx.kt+function:addControleeSingle)

```
default final @NonNull Single<Unit> UwbControllerSessionScopeRx.addControleeSingle(
    @NonNull UwbControllerSessionScope receiver,
    @NonNull UwbAddress address
)
```

Returns a `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Single.html` that will run in a given block to add a controlee.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/uwb/UwbControllerSessionScope#addControlee(androidx.core.uwb.UwbAddress)` |   |

### UwbControllerSessionScopeRx.removeControleeSingle

Artifact: [androidx.core.uwb:uwb-rxjava3](https://developer.android.com/jetpack/androidx/releases/core-uwb) [View Source](https://cs.android.com/search?q=file:androidx/core/uwb/rxjava3/UwbControllerSessionScopeRx.kt+function:removeControleeSingle)

```
default final @NonNull Single<Unit> UwbControllerSessionScopeRx.removeControleeSingle(
    @NonNull UwbControllerSessionScope receiver,
    @NonNull UwbAddress address
)
```

Returns a `http://reactivex.io/RxJava/3.x/javadoc/io/reactivex/rxjava3/core/Single.html` that will run in a given block to remove a controlee.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/uwb/UwbControllerSessionScope#removeControlee(androidx.core.uwb.UwbAddress)` |   |