RangingData
class RangingData : Parcelable
| kotlin.Any | |
| ↳ | android.ranging.RangingData |
Represents ranging data, including distance, azimuth, elevation, and RSSI measurements, along with the ranging technology used and a timestamp.
Summary
| Inherited constants | |
|---|---|
| Public methods | |
|---|---|
| Int | |
| RangingMeasurement? |
Returns the azimuth measurement, or |
| RangingMeasurement? |
Returns the distance measurement. |
| Double |
Get the standard deviation of distance in meters . |
| RangingMeasurement? |
Returns the elevation measurement, or |
| Int |
Returns the ranging technology used. |
| Int |
getRssi()Returns the RSSI (Received Signal Strength Indicator) value. |
| Long |
Returns the timestamp of when the ranging data was collected. |
| Boolean |
Check if the standard deviation of distance is set. |
| Boolean |
hasRssi()Returns whether an RSSI measurement is included with the data. |
| Unit |
writeToParcel(dest: Parcel, flags: Int)Flatten this object in to a Parcel. |
| Properties | |
|---|---|
| static Parcelable.Creator<RangingData!> | |
Public methods
describeContents
fun describeContents(): Int
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
getAzimuth
fun getAzimuth(): RangingMeasurement?
Returns the azimuth measurement, or null if not available.
| Return | |
|---|---|
RangingMeasurement? |
The RangingMeasurement representing the azimuth, or null. |
getDistance
fun getDistance(): RangingMeasurement?
Returns the distance measurement.
| Return | |
|---|---|
RangingMeasurement? |
The RangingMeasurement representing the distance. This value may be null. |
getDistanceStandardDeviationMeters
fun getDistanceStandardDeviationMeters(): Double
Get the standard deviation of distance in meters .
Returned value will be positive if it exists
| Return | |
|---|---|
Double |
The standard deviation of distance in meters. |
| Exceptions | |
|---|---|
java.lang.IllegalStateException |
if distance standard deviation is not set. |
getElevation
fun getElevation(): RangingMeasurement?
Returns the elevation measurement, or null if not available.
| Return | |
|---|---|
RangingMeasurement? |
The RangingMeasurement representing the elevation, or null. |
getRangingTechnology
fun getRangingTechnology(): Int
Returns the ranging technology used.
| Return | |
|---|---|
Int |
The ranging technology as an integer. Value is android.ranging.RangingManager#UWB, android.ranging.RangingManager#BLE_CS, android.ranging.RangingManager#WIFI_NAN_RTT, android.ranging.RangingManager#BLE_RSSI, or android.ranging.RangingManager#WIFI_STA_RTT |
getRssi
fun getRssi(): Int
Returns the RSSI (Received Signal Strength Indicator) value.
| Return | |
|---|---|
Int |
The RSSI value as an integer. |
| Exceptions | |
|---|---|
java.lang.IllegalStateException |
if rssi is not set. |
getTimestampMillis
fun getTimestampMillis(): Long
Returns the timestamp of when the ranging data was collected.
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.
| Return | |
|---|---|
Long |
The timestamp in milliseconds. Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z. |
hasDistanceStandardDeviation
fun hasDistanceStandardDeviation(): Boolean
Check if the standard deviation of distance is set.
| Return | |
|---|---|
Boolean |
True if a standard deviation value is set, false if it isn't. |
hasRssi
fun hasRssi(): Boolean
Returns whether an RSSI measurement is included with the data.
| Return | |
|---|---|
Boolean |
The RSSI value as an integer. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
| Parameters | |
|---|---|
dest |
Parcel: This value cannot be null. |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |