public class NADeviceImpl extends NADevice implements com.newaer.sdk.proximity.DeviceCaches.CacheMembershipListener
Modifier and Type | Field and Description |
---|---|
static int |
MAX_RSSI_BLUETOOTH
Anything better than or equal to this will show the max bars.
|
static int |
MIN_RSSI_BLUETOOTH
Anything worse than or equal to this will show 0 bars.
|
static int |
NUM_POWERBAR_LEVELS |
static int |
OUT_OF_RANGE_STRENGTH |
COMPARATOR_MAJOR_MINOR, COMPARATOR_SIGNAL_STRENGTH
Modifier and Type | Method and Description |
---|---|
int |
compareTo(com.newaer.sdk.proximity.NAObject another) |
NAMessage |
createMessageToSend(byte[] message)
Gets a message to be sent to this device.
|
boolean |
equals(Object another) |
String |
getAddress() |
String |
getAppId()
This returns the application ID of the app which has this device, or null if this
device is not of type NEWAER_DEVICE.
|
String |
getBeaconUUID() |
String |
getId()
Returns the identifier for this object within the platform.
|
byte[] |
getInfo()
This returns extra information set via
NAPlatform.setInfo(byte[]) . |
long |
getLastSeenTimestamp() |
static NADeviceImpl |
getLocalDevice() |
int |
getMajor() |
int |
getMinor() |
String |
getName()
Returns a human friendly name for this device.
|
static NADeviceImpl |
getOrBuild(NADeviceType type,
String name,
String id,
String address,
String appId,
byte[] info) |
static NADeviceImpl |
getOrBuild(NADeviceType type,
String name,
String id,
String address,
String appId,
byte[] info,
String uuid,
int major,
int minor) |
static NADeviceImpl |
getOrBuildRemote(com.newaer.sdk.proximity.PubnubDevice pnDevice) |
int |
getPowerbars()
Returns the number of power bars to display for this device, from
zero to five.
|
int |
getSignalStrength() |
NADeviceStatus |
getStatus() |
int |
getTxPower() |
NADeviceType |
getType() |
int |
hashCode() |
boolean |
isInRange() |
boolean |
isRemote() |
void |
onDeviceAdded()
In the case of Remote -> Local, this callback can be fired
in close temporal proximity to
DeviceCaches.CacheMembershipListener.onDeviceRemoved() |
void |
onDeviceRemoved() |
void |
setIBeaconData(int txpower) |
void |
setName(Context context,
String name)
Change the name for this object.
|
void |
setOutOfRange() |
void |
setSignalStrength(int signalStrength) |
String |
toString() |
compareTo, getAllByType, getAllDevices, getDevice, registerObserver, registerStatusListener, unregisterObserver, unregisterStatusListener
public static final int OUT_OF_RANGE_STRENGTH
public static final int NUM_POWERBAR_LEVELS
public static final int MIN_RSSI_BLUETOOTH
public static final int MAX_RSSI_BLUETOOTH
public static NADeviceImpl getOrBuild(NADeviceType type, String name, String id, String address, String appId, byte[] info)
public static NADeviceImpl getOrBuild(NADeviceType type, String name, String id, String address, String appId, byte[] info, String uuid, int major, int minor)
public static NADeviceImpl getOrBuildRemote(com.newaer.sdk.proximity.PubnubDevice pnDevice)
public static NADeviceImpl getLocalDevice()
public String getAddress()
public NADeviceType getType()
public int getSignalStrength()
getSignalStrength
in class NADevice
public NADeviceStatus getStatus()
public String getId()
Returns the identifier for this object within the platform.
This identifier is unique on a per object type basis.
public String getName()
NADevice
public void setName(Context context, String name)
context
- the context to work inname
- the new name for this object.public int getPowerbars()
NADevice
getPowerbars
in class NADevice
public long getLastSeenTimestamp()
getLastSeenTimestamp
in class NADevice
public byte[] getInfo()
NADevice
NAPlatform.setInfo(byte[])
.
If no information has been set, or this device is not of type NADeviceType.NEWAER
then this returns null.getInfo
in class NADevice
NAPlatform.setInfo(byte[])
or nullpublic String getAppId()
NADevice
public NAMessage createMessageToSend(byte[] message)
NADevice
createMessageToSend
in class NADevice
public String getBeaconUUID()
getBeaconUUID
in class NADevice
public int getTxPower()
getTxPower
in class NADevice
public void setIBeaconData(int txpower)
public boolean isInRange()
public void setSignalStrength(int signalStrength)
public void setOutOfRange()
public void onDeviceAdded()
com.newaer.sdk.proximity.DeviceCaches.CacheMembershipListener
DeviceCaches.CacheMembershipListener.onDeviceRemoved()
onDeviceAdded
in interface com.newaer.sdk.proximity.DeviceCaches.CacheMembershipListener
public void onDeviceRemoved()
onDeviceRemoved
in interface com.newaer.sdk.proximity.DeviceCaches.CacheMembershipListener
public int compareTo(com.newaer.sdk.proximity.NAObject another)
compareTo
in interface Comparable<T extends com.newaer.sdk.proximity.NAObject>