public class Beacon extends java.lang.Object implements java.lang.Comparable<Beacon>
Modifier and Type | Field and Description |
---|---|
static <any> |
CREATOR |
protected double |
distance |
protected static int |
FREE_SPACE_PATH_LOSS_CONSTANT_FOR_BLE |
protected static int |
FSPL_FREQ |
protected static int |
FSPL_LIGHT |
protected static char[] |
HEX_ARRAY |
protected java.util.concurrent.ConcurrentHashMap<com.bluvision.beeks.sdk.constants.BeaconType,Beacon> |
mAssociations |
protected float |
mBattery |
protected java.util.concurrent.CopyOnWriteArrayList<OnBeaconChangeListener> |
mBeaconChangeListeners |
protected com.bluvision.beeks.sdk.constants.BeaconType |
mBeaconType |
protected BluetoothDevice |
mDevice |
protected long |
mFirstDiscovered |
protected static double |
MID_TO_FAR_METERS |
protected boolean |
mIsManagerScanning |
protected long |
mLastSeen |
protected com.bluvision.beeks.sdk.constants.Range |
mRange |
protected int |
mRssi |
protected byte[] |
mScanRecord |
protected float |
mTemperature |
protected int |
mTxPower |
protected static double |
NEAR_TO_MID_METERS |
static java.util.Comparator<Beacon> |
RssiComparator |
Constructor and Description |
---|
Beacon() |
Beacon(Parcel in)
Basic constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addAssociation(Beacon beacon) |
void |
addOnBeaconChangeListener(OnBeaconChangeListener beaconChangeListener)
register an OnBeaconChangeListener that will be notified whenever properties of the Beacon
change
|
static java.lang.String |
bytesToHex(byte[] bytes) |
com.bluvision.beeks.sdk.constants.Range |
calculateRange() |
int |
compareTo(Beacon another) |
int |
describeContents() |
java.util.concurrent.ConcurrentHashMap<com.bluvision.beeks.sdk.constants.BeaconType,Beacon> |
getAssociations()
gets the associated
Beacon objects that are associated with this
Beacon |
com.bluvision.beeks.sdk.constants.BeaconType |
getBeaconType()
returns the
BeaconType of the Beacon |
BluetoothDevice |
getDevice()
returns the found BluetoothDevice object
|
long |
getDwellTime() |
long |
getFirstDiscovered() |
long |
getLastSeen() |
com.bluvision.beeks.sdk.constants.Range |
getRange()
returns the current
Range of the Beacon |
int |
getRssi() |
byte[] |
getScanRecord()
returns the raw scan data of the Beacon as a byte[]
|
float |
getTemperature()
returns the known temperature
|
long |
getTimeSinceFirstSeen() |
long |
getTimeSinceLastSeen() |
boolean |
hasAssociations()
checks if there are any associations
|
boolean |
hasBeenNotifiedOfOnEnter() |
boolean |
hasBeenNotifiedOfOnExit() |
boolean |
hasExitListeners() |
boolean |
isConnected() |
boolean |
isOutOfRangeBeacon() |
void |
managerIsScanning(boolean scanning) |
protected void |
notifyOnRangeChanged(Beacon beacon,
com.bluvision.beeks.sdk.constants.Range range) |
protected void |
notifyRssiChanged() |
void |
removeAllOnBeaconChangeListener()
removes all OnBeaconChangeListener from the list of listeners to be notified
|
void |
removeAssociation(Beacon beacon) |
boolean |
removeOnBeaconChangeListener(OnBeaconChangeListener beaconChangeListener)
removes a specific OnBeaconChangeListener from the list of listeners to be notified
returns true if successful.
|
void |
removeSelfFromAssociations() |
protected void |
setBaseData(Beacon beacon) |
void |
setBeaconType(com.bluvision.beeks.sdk.constants.BeaconType beaconType) |
void |
setConnected(boolean connected) |
void |
setDevice(BluetoothDevice device) |
void |
setLogListener(BeaconManager.LogListener logListener) |
void |
setNotifiedOfOnEnter(boolean notifiedOfOnEnter) |
void |
setNotifiedOfOnExit(boolean notifiedOfOnExit) |
void |
setRssi(int rssi) |
void |
setScanRecord(byte[] scanRecord) |
protected void |
updateSeen() |
void |
writeToParcel(Parcel parcel,
int flags) |
protected static final char[] HEX_ARRAY
protected int mRssi
protected byte[] mScanRecord
protected int mTxPower
protected double distance
protected com.bluvision.beeks.sdk.constants.BeaconType mBeaconType
protected BluetoothDevice mDevice
protected long mFirstDiscovered
protected long mLastSeen
protected float mTemperature
protected float mBattery
protected com.bluvision.beeks.sdk.constants.Range mRange
protected static final int FSPL_FREQ
protected static final int FSPL_LIGHT
protected static final int FREE_SPACE_PATH_LOSS_CONSTANT_FOR_BLE
protected static final double NEAR_TO_MID_METERS
protected static final double MID_TO_FAR_METERS
protected boolean mIsManagerScanning
protected java.util.concurrent.CopyOnWriteArrayList<OnBeaconChangeListener> mBeaconChangeListeners
protected java.util.concurrent.ConcurrentHashMap<com.bluvision.beeks.sdk.constants.BeaconType,Beacon> mAssociations
public static final <any> CREATOR
public static java.util.Comparator<Beacon> RssiComparator
public Beacon()
public Beacon(Parcel in)
in
- Parcelpublic int describeContents()
public void writeToParcel(Parcel parcel, int flags)
protected void setBaseData(Beacon beacon)
public BluetoothDevice getDevice()
public void setDevice(BluetoothDevice device)
public int getRssi()
public void setRssi(int rssi)
protected void notifyRssiChanged()
public byte[] getScanRecord()
public void setScanRecord(byte[] scanRecord)
protected void updateSeen()
public long getTimeSinceFirstSeen()
public long getTimeSinceLastSeen()
public long getDwellTime()
public long getFirstDiscovered()
public long getLastSeen()
public com.bluvision.beeks.sdk.constants.BeaconType getBeaconType()
BeaconType
of the BeaconBeaconType
of the Beaconpublic void setBeaconType(com.bluvision.beeks.sdk.constants.BeaconType beaconType)
public static java.lang.String bytesToHex(byte[] bytes)
public void addOnBeaconChangeListener(OnBeaconChangeListener beaconChangeListener)
beaconChangeListener
- listener to be notifiedpublic boolean removeOnBeaconChangeListener(OnBeaconChangeListener beaconChangeListener)
public void removeAllOnBeaconChangeListener()
public java.util.concurrent.ConcurrentHashMap<com.bluvision.beeks.sdk.constants.BeaconType,Beacon> getAssociations()
Beacon
objects that are associated with this
BeaconBeaconType
, Beacon
public boolean hasAssociations()
public void addAssociation(Beacon beacon)
public void removeAssociation(Beacon beacon)
public boolean hasBeenNotifiedOfOnEnter()
public void setNotifiedOfOnEnter(boolean notifiedOfOnEnter)
public boolean hasBeenNotifiedOfOnExit()
public void setNotifiedOfOnExit(boolean notifiedOfOnExit)
public boolean hasExitListeners()
public com.bluvision.beeks.sdk.constants.Range getRange()
Range
of the BeaconRange
public com.bluvision.beeks.sdk.constants.Range calculateRange()
protected void notifyOnRangeChanged(Beacon beacon, com.bluvision.beeks.sdk.constants.Range range)
public float getTemperature()
public void managerIsScanning(boolean scanning)
public void removeSelfFromAssociations()
public boolean isOutOfRangeBeacon()
public void setLogListener(BeaconManager.LogListener logListener)
public int compareTo(Beacon another)
compareTo
in interface java.lang.Comparable<Beacon>
public boolean isConnected()
public void setConnected(boolean connected)