| Constructor and Description |
|---|
BeaconHandler(Context nors)
Constructor, allocating all necessary resources for the handler
Here, reading the various RMS values of the preferences and arming the semaphores
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
Acquire(String sensor,
String query)
Method to acquire sensor data
Here, start BT discovery thread in case it hasn't run yet
|
void |
destroyHandler()
Method to release all handler resources
Here, we interrupt the discovery thread and stop any ongoing BT discovery
|
void |
Discover()
Method to discover the sensor symbols support by this handler
As the result of the discovery, appropriate
Sensor entries will be added to the SensorRepository
Here, we also check if the BT adapter is available and also enable it, in case it is disabled and it is configured (by the user) to switch BT on
Furthermore, we register the receivers for getting BT connect and disconnects messages |
void |
History(String sensor)
Method to view historical chart of the given sensor symbol
|
void |
run()
BT Discovery thread, being executed every polltime seconds, using the sleep() function to wait
|
String |
Share(String sensor)
Method to share the last value of the given sensor
|
public BeaconHandler(Context nors)
nors - Reference to the calling Contextpublic byte[] Acquire(String sensor, String query)
Acquire in interface Handlersensor - String of the sensor symbolquery - String of the query to be fulfilled - not used hereHandler.Acquire(java.lang.String, java.lang.String)public String Share(String sensor)
Share in interface Handlersensor - String of the sensor symbol to be sharedHandler.Share(java.lang.String)public void History(String sensor)
History in interface Handlersensor - String of the symbol for which the history is being requestedHandler.History(java.lang.String)public void run()
run in interface RunnableRunnable.run()public void Discover()
Sensor entries will be added to the SensorRepository
Here, we also check if the BT adapter is available and also enable it, in case it is disabled and it is configured (by the user) to switch BT on
Furthermore, we register the receivers for getting BT connect and disconnects messagesDiscover in interface HandlerHandler.Discover(),
Sensor,
SensorRepositorypublic void destroyHandler()
destroyHandler in interface HandlerHandler.destroyHandler()