# RangingResult

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

*** ** * ** ***


```
sealed class RangingResult : SensorFusionResult
```

<br />

Known direct subclasses [RangingResult.RangingResultFailure](https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult.RangingResultFailure), [RangingResult.RangingResultInitialized](https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult.RangingResultInitialized), [RangingResult.RangingResultPeerDisconnected](https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult.RangingResultPeerDisconnected), [RangingResult.RangingResultPosition](https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult.RangingResultPosition)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult.RangingResultFailure` | A ranging result indicating failure or suspension of a ranging session. |
| `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult.RangingResultInitialized` | A ranging result when a ranging session is initialized with peer device. |
| `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult.RangingResultPeerDisconnected` | A ranging result with peer disconnected status update. |
| `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult.RangingResultPosition` | A ranging result with the device position update. |

*** ** * ** ***

Class for UWB ranging result update.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult.RangingResultFailure : https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult` A ranging result indicating failure or suspension of a ranging session. |
| `class https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult.RangingResultInitialized : https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult` A ranging result when a ranging session is initialized with peer device. |
| `class https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult.RangingResultPeerDisconnected : https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult` A ranging result with peer disconnected status update. |
| `class https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult.RangingResultPosition : https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult` A ranging result with the device position update. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult#RANGING_FAILURE_REASON_ARCORE_APK_INSTALL_NEEDED() = 7` Ranging stopped because the ARCore APK is either outdated or not installed. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult#RANGING_FAILURE_REASON_BAD_PARAMETERS() = 1` Ranging failed due to bad or invalid parameters. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult#RANGING_FAILURE_REASON_FAILED_TO_START() = 2` Generic failure to start the ranging session. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult#RANGING_FAILURE_REASON_MAX_RR_RETRY_REACHED() = 6` Ranging stopped because the maximum number of ranging round retries was reached. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult#RANGING_FAILURE_REASON_STOPPED_BY_LOCAL() = 4` The ranging session was stopped by a local request. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult#RANGING_FAILURE_REASON_STOPPED_BY_PEER() = 3` The ranging session was stopped by the peer device. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult#RANGING_FAILURE_REASON_SYSTEM_POLICY() = 5` Ranging stopped or failed due to system policy. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult#RANGING_FAILURE_REASON_UNKNOWN() = 0` Unknown failure reason. |

| ### Protected constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult#RangingResult()()` |

| ### Public properties |
|---|---|
| `abstract https://developer.android.com/reference/kotlin/androidx/core/uwb/UwbDevice` | `https://developer.android.com/reference/kotlin/androidx/core/uwb/RangingResult#device()` The peer UWB device that this result applies to. |

## Constants

### RANGING_FAILURE_REASON_ARCORE_APK_INSTALL_NEEDED

```
const val RANGING_FAILURE_REASON_ARCORE_APK_INSTALL_NEEDED = 7: Int
```

Ranging stopped because the ARCore APK is either outdated or not installed. This will only happen for sensor fusion sessions.

To use sensor fusion, you must first verify that ARCore is installed and up to date. Please follow documentation to [enable AR in your Android app](https://developers.google.com/ar/develop/java/enable-arcore).

### RANGING_FAILURE_REASON_BAD_PARAMETERS

```
const val RANGING_FAILURE_REASON_BAD_PARAMETERS = 1: Int
```

Ranging failed due to bad or invalid parameters.

### RANGING_FAILURE_REASON_FAILED_TO_START

```
const val RANGING_FAILURE_REASON_FAILED_TO_START = 2: Int
```

Generic failure to start the ranging session.

### RANGING_FAILURE_REASON_MAX_RR_RETRY_REACHED

```
const val RANGING_FAILURE_REASON_MAX_RR_RETRY_REACHED = 6: Int
```

Ranging stopped because the maximum number of ranging round retries was reached.

### RANGING_FAILURE_REASON_STOPPED_BY_LOCAL

```
const val RANGING_FAILURE_REASON_STOPPED_BY_LOCAL = 4: Int
```

The ranging session was stopped by a local request.

### RANGING_FAILURE_REASON_STOPPED_BY_PEER

```
const val RANGING_FAILURE_REASON_STOPPED_BY_PEER = 3: Int
```

The ranging session was stopped by the peer device.

### RANGING_FAILURE_REASON_SYSTEM_POLICY

```
const val RANGING_FAILURE_REASON_SYSTEM_POLICY = 5: Int
```

Ranging stopped or failed due to system policy.

### RANGING_FAILURE_REASON_UNKNOWN

```
const val RANGING_FAILURE_REASON_UNKNOWN = 0: Int
```

Unknown failure reason.

## Protected constructors

### RangingResult

```
protected RangingResult()
```

## Public properties

### device

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

```
abstract val device: UwbDevice
```

The peer UWB device that this result applies to.