Added in API level 36

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 null if not available.

RangingMeasurement?

Returns the distance measurement.

RangingMeasurement?

Returns the elevation measurement, or null if not available.

Int

Returns the ranging technology used.

Int

Returns the RSSI (Received Signal Strength Indicator) value.

Long

Returns the timestamp of when the ranging data was collected.

Boolean

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

Added in API level 36
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

Added in API level 36
fun getAzimuth(): RangingMeasurement?

Returns the azimuth measurement, or null if not available.

Return
RangingMeasurement? The RangingMeasurement representing the azimuth, or null.

getDistance

Added in API level 36
fun getDistance(): RangingMeasurement?

Returns the distance measurement.

Return
RangingMeasurement? The RangingMeasurement representing the distance. This value may be null.

getElevation

Added in API level 36
fun getElevation(): RangingMeasurement?

Returns the elevation measurement, or null if not available.

Return
RangingMeasurement? The RangingMeasurement representing the elevation, or null.

getRangingTechnology

Added in API level 36
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, or android.ranging.RangingManager#BLE_RSSI

getRssi

Added in API level 36
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

Added in API level 36
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.

hasRssi

Added in API level 36
fun hasRssi(): Boolean

Returns whether an RSSI measurement is included with the data.

Return
Boolean The RSSI value as an integer.

writeToParcel

Added in API level 36
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

Properties

CREATOR

Added in API level 36
static val CREATOR: Parcelable.Creator<RangingData!>