RangingData


public final class RangingData
extends Object implements Parcelable

java.lang.Object
   ↳ 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

Fields

public static final Creator<RangingData> CREATOR

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

RangingMeasurement getAzimuth()

Returns the azimuth measurement, or null if not available.

RangingMeasurement getDistance()

Returns the distance measurement.

RangingMeasurement getElevation()

Returns the elevation measurement, or null if not available.

int getRangingTechnology()

Returns the ranging technology used.

int getRssi()

Returns the RSSI (Received Signal Strength Indicator) value.

long getTimestampMillis()

Returns the timestamp of when the ranging data was collected.

boolean hasRssi()

Returns whether an RSSI measurement is included with the data.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Fields

CREATOR

public static final Creator<RangingData> CREATOR

Public methods

describeContents

public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or CONTENTS_FILE_DESCRIPTOR

getAzimuth

public RangingMeasurement getAzimuth ()

Returns the azimuth measurement, or null if not available.

Returns
RangingMeasurement The RangingMeasurement representing the azimuth, or null.

getDistance

public RangingMeasurement getDistance ()

Returns the distance measurement.

Returns
RangingMeasurement The RangingMeasurement representing the distance. This value may be null.

getElevation

public RangingMeasurement getElevation ()

Returns the elevation measurement, or null if not available.

Returns
RangingMeasurement The RangingMeasurement representing the elevation, or null.

getRangingTechnology

public int getRangingTechnology ()

Returns the ranging technology used.

Returns
int The ranging technology as an integer. Value is RangingManager.UWB, RangingManager.BLE_CS, RangingManager.WIFI_NAN_RTT, or RangingManager.BLE_RSSI

getRssi

public int getRssi ()

Returns the RSSI (Received Signal Strength Indicator) value.

Returns
int The RSSI value as an integer.

Throws
IllegalStateException if rssi is not set.

getTimestampMillis

public long getTimestampMillis ()

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.

Returns
long The timestamp in milliseconds. Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.

hasRssi

public boolean hasRssi ()

Returns whether an RSSI measurement is included with the data.

Returns
boolean The RSSI value as an integer.

writeToParcel

public void writeToParcel (Parcel dest, 
                int flags)

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.PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES