# RangingParameters

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/RangingParameters.kt+class:androidx.core.uwb.RangingParameters) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core-uwb#1.0.0)

*** ** * ** ***

<br />

```
class RangingParameters
```

<br />

*** ** * ** ***

Set of parameters which should be passed to the UWB chip to start ranging.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#CONFIG_MULTICAST_DS_TWR() = 2` Pre-defined one-to-many STATIC STS DS-TWR ranging |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#CONFIG_PROVISIONED_INDIVIDUAL_MULTICAST_DS_TWR() = 7` Same as CONFIG_MULTICAST_DS_TWR, except P-STS individual controlee key mode is enabled. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#CONFIG_PROVISIONED_MULTICAST_DS_TWR() = 5` Same as CONFIG_MULTICAST_DS_TWR, except P-STS security mode is enabled. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#CONFIG_PROVISIONED_UNICAST_DS_TWR() = 4` Same as CONFIG_UNICAST_DS_TWR, except P-STS security mode is enabled. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#CONFIG_UNICAST_DS_TWR() = 1` Pre-defined unicast STATIC STS DS-TWR ranging. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#RANGING_SLOT_DURATION_1_MILLIS() = 1` 1 millisecond slot duration |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#RANGING_SLOT_DURATION_2_MILLIS() = 2` 2 millisecond slot duration |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#RANGING_UPDATE_RATE_AUTOMATIC() = 1` The update rate that differs across different config id. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#RANGING_UPDATE_RATE_FREQUENT() = 3` 600 millisecond update rate for all config ids. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#RANGING_UPDATE_RATE_INFREQUENT() = 2` 120 millisecond update rate for all config ids. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#RangingParameters(kotlin.Int,kotlin.Int,kotlin.Int,kotlin.ByteArray,kotlin.ByteArray,androidx.core.uwb.UwbComplexChannel,kotlin.collections.List,kotlin.Int,androidx.core.uwb.UwbRangeDataNtfConfig,kotlin.Long,kotlin.Boolean)( uwbConfigType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, sessionId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, subSessionId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, sessionKeyInfo: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html?, subSessionKeyInfo: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html?, complexChannel: https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbComplexChannel?, peerDevices: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbDevice>, updateRateType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, uwbRangeDataNtfConfig: https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbRangeDataNtfConfig?, slotDurationMillis: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 1, to = 2) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, isAoaDisabled: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbComplexChannel?` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#complexChannel()` Optional. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#isAoaDisabled()` The indicator of whether angle of arrival (AoA) is disabled. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbDevice>` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#peerDevices()` The peers to perform ranging with. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#sessionId()` The ID of the ranging session. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html?` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#sessionKeyInfo()` The session key info to use for the ranging. |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 1, to = 2) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#slotDurationMillis()` The slot duration of the ranging session in millisecond. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#subSessionId()` The ID of the ranging sub-session. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html?` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#subSessionKeyInfo()` The sub-session key info to use for the ranging. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#updateRateType()` The update rate type of the ranging data. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#uwbConfigType()` The UWB configuration type. |
| `https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbRangeDataNtfConfig?` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#uwbRangeDataNtfConfig()` Configurable range data notification reports for a UWB session. |

## Constants

### CONFIG_MULTICAST_DS_TWR

```
const val CONFIG_MULTICAST_DS_TWR = 2: Int
```

Pre-defined one-to-many STATIC STS DS-TWR ranging

deferred mode, ranging interval = 200 ms, slot duration = 2400 RSTU, slots per ranging round = 20, hopping mode is enabled

All other MAC parameters use FiRa/UCI default values.

Typical use case: smart phone interacts with many smart devices

### CONFIG_PROVISIONED_INDIVIDUAL_MULTICAST_DS_TWR

```
const val CONFIG_PROVISIONED_INDIVIDUAL_MULTICAST_DS_TWR = 7: Int
```

Same as CONFIG_MULTICAST_DS_TWR, except P-STS individual controlee key mode is enabled.

### CONFIG_PROVISIONED_MULTICAST_DS_TWR

```
const val CONFIG_PROVISIONED_MULTICAST_DS_TWR = 5: Int
```

Same as CONFIG_MULTICAST_DS_TWR, except P-STS security mode is enabled.

### CONFIG_PROVISIONED_UNICAST_DS_TWR

```
const val CONFIG_PROVISIONED_UNICAST_DS_TWR = 4: Int
```

Same as CONFIG_UNICAST_DS_TWR, except P-STS security mode is enabled.

### CONFIG_UNICAST_DS_TWR

```
const val CONFIG_UNICAST_DS_TWR = 1: Int
```

Pre-defined unicast STATIC STS DS-TWR ranging.

deferred mode, ranging interval = 240 ms, slot duration = 2400 RSTU, slots per ranging round = 6, hopping mode is enabled

All other MAC parameters use FiRa/UCI default values.

Typical use case: device tracking tags

### RANGING_SLOT_DURATION_1_MILLIS

```
const val RANGING_SLOT_DURATION_1_MILLIS = 1: Long
```

1 millisecond slot duration

### RANGING_SLOT_DURATION_2_MILLIS

```
const val RANGING_SLOT_DURATION_2_MILLIS = 2: Long
```

2 millisecond slot duration

### RANGING_UPDATE_RATE_AUTOMATIC

```
const val RANGING_UPDATE_RATE_AUTOMATIC = 1: Int
```

The update rate that differs across different config id. It is 240 millisecond for `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#CONFIG_UNICAST_DS_TWR()` and `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#CONFIG_PROVISIONED_UNICAST_DS_TWR()`, and is 200 millisecond for other config ids.

### RANGING_UPDATE_RATE_FREQUENT

```
const val RANGING_UPDATE_RATE_FREQUENT = 3: Int
```

600 millisecond update rate for all config ids.

### RANGING_UPDATE_RATE_INFREQUENT

```
const val RANGING_UPDATE_RATE_INFREQUENT = 2: Int
```

120 millisecond update rate for all config ids.

## Public constructors

### RangingParameters

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

```
RangingParameters(
    uwbConfigType: Int,
    sessionId: Int,
    subSessionId: Int,
    sessionKeyInfo: ByteArray?,
    subSessionKeyInfo: ByteArray?,
    complexChannel: UwbComplexChannel?,
    peerDevices: List<UwbDevice>,
    updateRateType: Int,
    uwbRangeDataNtfConfig: UwbRangeDataNtfConfig? = null,
    slotDurationMillis: @IntRange(from = 1, to = 2) Long = RANGING_SLOT_DURATION_2_MILLIS,
    isAoaDisabled: Boolean = false
)
```

## Public properties

### complexChannel

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

```
val complexChannel: UwbComplexChannel?
```

Optional. If device type is ROLE_CONTROLEE then complex channel should be set.

### isAoaDisabled

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

```
val isAoaDisabled: Boolean
```

The indicator of whether angle of arrival (AoA) is disabled. Default to false.

### peerDevices

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

```
val peerDevices: List<UwbDevice>
```

The peers to perform ranging with. If using unicast, length should be 1.

### sessionId

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

```
val sessionId: Int
```

The ID of the ranging session. If the value is SESSION_ID_UNSET (0), it will be created from the hash of controller address and complex channel values.

The same session IDs should be used at both ends (Controller and controlee).

### sessionKeyInfo

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

```
val sessionKeyInfo: ByteArray?
```

The session key info to use for the ranging. If the profile uses STATIC STS, this byte array is 8-byte long with first two bytes as Vendor_ID and next six bytes as STATIC_STS_IV. If the profile uses PROVISIONED STS, this byte array is 16 or 32-byte long which represent session key.

The same session keys should be used at both ends (Controller and controlee).

### slotDurationMillis

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

```
val slotDurationMillis: @IntRange(from = 1, to = 2) Long
```

The slot duration of the ranging session in millisecond. The available slot durations are `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#RANGING_SLOT_DURATION_1_MILLIS()` and `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#RANGING_SLOT_DURATION_2_MILLIS()`. Default to `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#RANGING_SLOT_DURATION_2_MILLIS()`.

### subSessionId

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

```
val subSessionId: Int
```

The ID of the ranging sub-session. This value should be set when the Provisioned STS individual responder case is used. If other config is used, it should remain SUB_SESSION_UNSET (0)

### subSessionKeyInfo

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

```
val subSessionKeyInfo: ByteArray?
```

The sub-session key info to use for the ranging. This byte array is 16 or 32-byte long when the profile uses PROVISIONED STS individual responder cases. If other STS is used, this field should remain null.

### updateRateType

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

```
val updateRateType: Int
```

The update rate type of the ranging data. The update rate types include `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#RANGING_UPDATE_RATE_AUTOMATIC()`, `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#RANGING_UPDATE_RATE_FREQUENT()`, and `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#RANGING_UPDATE_RATE_INFREQUENT()`.

### uwbConfigType

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

```
val uwbConfigType: Int
```

The UWB configuration type. One type specifies one fixed set of pre-defined parameters. The UWB config type includes `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#CONFIG_UNICAST_DS_TWR()` and `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingParameters#CONFIG_MULTICAST_DS_TWR()`.

### uwbRangeDataNtfConfig

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

```
val uwbRangeDataNtfConfig: UwbRangeDataNtfConfig?
```

Configurable range data notification reports for a UWB session.