# 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)

*** ** * ** ***


```
interface UwbControllerSessionScope : UwbClientSessionScope
```

<br />

*** ** * ** ***

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

## Summary

| ### Public functions |
|---|---|
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbControllerSessionScope#addControlee(androidx.core.uwb.UwbAddress)(address: https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbAddress)` Dynamically adds a controlee to an active ranging session. |
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbControllerSessionScope#addControlee(androidx.core.uwb.UwbAddress,androidx.core.uwb.RangingControleeParameters)(address: https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbAddress, parameters: https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingControleeParameters)` Dynamically adds a controlee to an active ranging session. |
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbControllerSessionScope#reconfigureRangingInterval(kotlin.Int)(intervalSkipCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Dynamically reconfigures ranging interval to an active ranging session. |
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbControllerSessionScope#removeControlee(androidx.core.uwb.UwbAddress)(address: https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbAddress)` Dynamically removes a controlee from an active ranging session. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbComplexChannel` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbControllerSessionScope#uwbComplexChannel()` The local device's complex channel which can be used for ranging. |

| ### Extension functions |
|---|---|
| `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/kotlin/androidx/core/uwb/UwbControllerSessionScope.https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbControllerSessionScope#(androidx.core.uwb.UwbControllerSessionScope).addControleeSingle(androidx.core.uwb.UwbAddress)(address: https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbAddress)` 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. |
| `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/kotlin/androidx/core/uwb/UwbControllerSessionScope.https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbControllerSessionScope#(androidx.core.uwb.UwbControllerSessionScope).removeControleeSingle(androidx.core.uwb.UwbAddress)(address: https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbAddress)` 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 functions

From [androidx.core.uwb.UwbClientSessionScope](https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbClientSessionScope) `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult>` `https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbClientSessionScope#prepareSession(androidx.core.uwb.RangingParameters)(parameters: https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters)`

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

Prepare a sensor fusion session, which performs software angle of arrival estimation and adjusts range for local device motion at a high resolution.
`suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbClientSessionScope#reconfigureRangeDataNtf(kotlin.Int,kotlin.Int,kotlin.Int)(
configType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
proximityNear: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html,
proximityFar: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html
)`

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

### Inherited properties

From [androidx.core.uwb.UwbClientSessionScope](https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbClientSessionScope) `https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbAddress` `https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbClientSessionScope#localAddress()`

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

Returns the `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingCapabilities` which the device supports.

## Public functions

### addControlee

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

```
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 |
|---|---|
| `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/kotlin/androidx/core/uwb/RangingResult.RangingResultPosition` or `https://developer.android.com/reference/kotlin/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)

```
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 |
|---|---|
| `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/kotlin/androidx/core/uwb/RangingResult.RangingResultPosition` or `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult.RangingResultPeerDisconnected` to listen for starts or failures. |

### reconfigureRangingInterval

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

```
suspend fun reconfigureRangingInterval(intervalSkipCount: Int): Unit
```

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)

```
suspend fun removeControlee(address: UwbAddress): Unit
```

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/kotlin/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/kotlin/androidx/core/uwb/RangingResult.RangingResultPeerDisconnected` to listen for disconnects. |

## Public properties

### uwbComplexChannel

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

```
val uwbComplexChannel: UwbComplexChannel
```

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

### UwbControllerSessionScope.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)

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

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/kotlin/androidx/core/uwb/UwbControllerSessionScope#addControlee(androidx.core.uwb.UwbAddress)` |   |

### UwbControllerSessionScope.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)

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

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/kotlin/androidx/core/uwb/UwbControllerSessionScope#removeControlee(androidx.core.uwb.UwbAddress)` |   |