RangingResultCallback
abstract class RangingResultCallback
| kotlin.Any | |
| ↳ | android.net.wifi.rtt.RangingResultCallback |
Base class for ranging result callbacks. Should be extended by applications and set when calling WifiRttManager.startRanging(RangingRequest,java.util.concurrent.Executor,RangingResultCallback). If the ranging operation fails in whole (not attempted) then onRangingFailure(int) will be called with a failure code. If the ranging operation is performed for each of the requested peers then the onRangingResults(List) will be called with the set of results (@link RangingResult, each of which has its own success/failure code RangingResult.getStatus().
Summary
| Constants | |
|---|---|
| static Int |
A failure code for the whole ranging request operation. |
| static Int |
A failure code for the whole ranging request operation. |
| Public constructors | |
|---|---|
| Public methods | |
|---|---|
| abstract Unit |
onRangingFailure(code: Int)Called when a ranging operation failed in whole - i. |
| abstract Unit |
onRangingResults(results: MutableList<RangingResult!>)Called when a ranging operation was executed. |
Constants
STATUS_CODE_FAIL
static val STATUS_CODE_FAIL: Int
A failure code for the whole ranging request operation. Indicates a failure.
Value: 1STATUS_CODE_FAIL_RTT_NOT_AVAILABLE
static val STATUS_CODE_FAIL_RTT_NOT_AVAILABLE: Int
A failure code for the whole ranging request operation. Indicates that the request failed due to RTT not being available - e.g. Wi-Fi was disabled. Use the WifiRttManager.isAvailable() and WifiRttManager.ACTION_WIFI_RTT_STATE_CHANGED to track RTT availability.
Value: 2Public constructors
Public methods
onRangingFailure
abstract fun onRangingFailure(code: Int): Unit
Called when a ranging operation failed in whole - i.e. no ranging operation to any of the devices specified in the request was attempted.
| Parameters | |
|---|---|
code |
Int: A status code indicating the type of failure. Value is one of the following: |
onRangingResults
abstract fun onRangingResults(results: MutableList<RangingResult!>): Unit
Called when a ranging operation was executed. The list of results corresponds to devices specified in the ranging request.
| Parameters | |
|---|---|
results |
MutableList<RangingResult!>: List of range measurements, one per requested device. This value cannot be null. |