public class Proximity extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Proximity.TriggerState |
Modifier and Type | Field and Description |
---|---|
static int |
PROXIMITY_FAR
More than four meters away
|
static int |
PROXIMITY_IMMEDIATE
Less than half a meter away
|
static int |
PROXIMITY_NEAR
More than half a meter away, but less than four meters away
|
static int |
PROXIMITY_UNKNOWN
No distance estimate was possible due to a bad RSSI value or measured TX power
|
Constructor and Description |
---|
Proximity() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
float |
getDistance() |
String |
toString() |
Proximity.TriggerState |
trigger() |
void |
updateDistance(float distance) |
public static final int PROXIMITY_IMMEDIATE
Less than half a meter away
public static final int PROXIMITY_NEAR
More than half a meter away, but less than four meters away
public static final int PROXIMITY_FAR
More than four meters away
public static final int PROXIMITY_UNKNOWN
No distance estimate was possible due to a bad RSSI value or measured TX power
public void updateDistance(float distance)
public float getDistance()
public Proximity.TriggerState trigger()
public void clear()