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  | 
| 
        
        
        
        
        
        RangingMeasurement | 
      getDistance()
      Returns the distance measurement. | 
| 
        
        
        
        
        
        double | 
      getDistanceStandardDeviationMeters()
      Get the standard deviation of distance in meters . | 
| 
        
        
        
        
        
        RangingMeasurement | 
      getElevation()
      Returns the elevation measurement, or  | 
| 
        
        
        
        
        
        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 | 
      hasDistanceStandardDeviation()
      Check if the standard deviation of distance is set. | 
| 
        
        
        
        
        
        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
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 0orCONTENTS_FILE_DESCRIPTOR | 
getAzimuth
public RangingMeasurement getAzimuth ()
Returns the azimuth measurement, or null if not available.
| Returns | |
|---|---|
| RangingMeasurement | The RangingMeasurementrepresenting the azimuth, ornull. | 
getDistance
public RangingMeasurement getDistance ()
Returns the distance measurement.
| Returns | |
|---|---|
| RangingMeasurement | The RangingMeasurementrepresenting the distance.
 This value may benull. | 
getDistanceStandardDeviationMeters
public double getDistanceStandardDeviationMeters ()
Get the standard deviation of distance in meters .
Returned value will be positive if it exists
| Returns | |
|---|---|
| double | The standard deviation of distance in meters. | 
| Throws | |
|---|---|
| IllegalStateException | if distance standard deviation is not set. | 
getElevation
public RangingMeasurement getElevation ()
Returns the elevation measurement, or null if not available.
| Returns | |
|---|---|
| RangingMeasurement | The RangingMeasurementrepresenting the elevation, ornull. | 
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,RangingManager.BLE_RSSI, orRangingManager.WIFI_STA_RTT | 
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. | 
hasDistanceStandardDeviation
public boolean hasDistanceStandardDeviation ()
Check if the standard deviation of distance is set.
| Returns | |
|---|---|
| boolean | True if a standard deviation value is set, false if it isn't. | 
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 benull. | 
| flags | int: Additional flags about how the object should be written.
 May be 0 orParcelable.PARCELABLE_WRITE_RETURN_VALUE.
 Value is either0or a combination ofParcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES | 
