public class Nearable extends Packet
Two Nearables are considered equal if their identifiers are equal.
You can find nearby Nearables using BeaconManager.startNearableDiscovery()
method.
Modifier and Type | Class and Description |
---|---|
static class |
Nearable.BatteryLevel |
static class |
Nearable.FirmwareState
Type of firmware that Nearable is running.
|
static class |
Nearable.Orientation
Possible physical orientations of nearable in space.
|
Modifier and Type | Field and Description |
---|---|
Nearable.BatteryLevel |
batteryLevel
Device's battery level.
|
BeaconRegion |
beaconRegion
iBeacon region (Location UUID, major, minor) broadcasted by the sticker as every third Bluetooth packet.
|
java.lang.String |
bootloaderVersion
Version of bootloader firmware.
|
Color |
color
Nearable color - not final, because this info is resolved from cloud
|
static android.os.Parcelable.Creator<Nearable> |
CREATOR |
long |
currentMotionStateDuration
Time since last change of motion state (
isMoving value changed) returned in seconds. |
Nearable.FirmwareState |
firmwareState
Type of firmware running on Nearable.
|
java.lang.String |
firmwareVersion
Version of firmware.
|
java.lang.String |
hardwareVersion
Revision of hardware.
|
java.lang.String |
identifier
Unique nearable identifier.
|
boolean |
isMoving
Whether Nearable is moving.
|
long |
lastMotionStateDuration
Time of nearable's previous motion state returned in seconds.
|
Nearable.Orientation |
orientation
Physical orientation of nearable in space.
|
BroadcastingPower |
power
Signal strength emitted by the nearable at 0 meters distance.
|
int |
rssi
Received Signal Strength Indication at the moment of scanning.
|
double |
temperature
Ambient temperature value (in Celsius).
|
NearableType |
type
Nearable type - not final, because this info is resolved from cloud
|
double |
xAcceleration
X-Axis acceleration value (in milli g, where g is 9,81 m/s^2).
|
double |
yAcceleration
Y-Axis acceleration value (in milli g, where g is 9,81 m/s^2).
|
double |
zAcceleration
Z-Axis acceleration value (in milli g, where g is 9,81 m/s^2).
|
packetType
Modifier | Constructor and Description |
---|---|
protected |
Nearable(android.os.Parcel in) |
|
Nearable(java.lang.String identifier,
BeaconRegion beaconRegion,
Nearable.FirmwareState firmwareState,
java.lang.String hardwareVersion,
java.lang.String firmwareVersion,
java.lang.String bootloaderVersion,
double temperature,
int rssi,
boolean isMoving,
double xAcceleration,
double yAcceleration,
double zAcceleration,
long currentMotionStateDuration,
long lastMotionStateDuration,
Nearable.BatteryLevel batteryLevel,
BroadcastingPower power) |
Modifier and Type | Method and Description |
---|---|
int |
describeContents() |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getUniqueKey()
Returns unique key for this packet to identify it between other
Packet objects. |
int |
hashCode() |
boolean |
isMotionBroken()
Checks if given nearable has broken motion sensor
|
boolean |
isTemperatureBroken()
Checks if given nearable has broken temperature sensor
|
java.lang.String |
toString() |
void |
writeToParcel(android.os.Parcel dest,
int flags) |
getPacketType
public final java.lang.String identifier
public final java.lang.String hardwareVersion
public final java.lang.String firmwareVersion
public final java.lang.String bootloaderVersion
public final Nearable.FirmwareState firmwareState
public final double temperature
public final int rssi
public final boolean isMoving
public final double xAcceleration
public final double yAcceleration
public final double zAcceleration
public final Nearable.Orientation orientation
public final long currentMotionStateDuration
isMoving
value changed) returned in seconds.public final long lastMotionStateDuration
public final Nearable.BatteryLevel batteryLevel
public final BroadcastingPower power
public final BeaconRegion beaconRegion
public NearableType type
public Color color
public static final android.os.Parcelable.Creator<Nearable> CREATOR
public Nearable(java.lang.String identifier, BeaconRegion beaconRegion, Nearable.FirmwareState firmwareState, java.lang.String hardwareVersion, java.lang.String firmwareVersion, java.lang.String bootloaderVersion, double temperature, int rssi, boolean isMoving, double xAcceleration, double yAcceleration, double zAcceleration, long currentMotionStateDuration, long lastMotionStateDuration, Nearable.BatteryLevel batteryLevel, BroadcastingPower power)
protected Nearable(android.os.Parcel in)
public java.lang.String getUniqueKey()
Packet
Packet
objects.
Child classes should implement this method.getUniqueKey
in class Packet
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int describeContents()
public void writeToParcel(android.os.Parcel dest, int flags)
writeToParcel
in interface android.os.Parcelable
writeToParcel
in class Packet
public boolean isTemperatureBroken()
public boolean isMotionBroken()