|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sentilla.mote.clientservices.ClientServicesLib
public class ClientServicesLib
ClientServices application is intended to be customized based on deployment requirements and sensors present on the motes for a given deployment.
Note: in this release, sensor deployments don't apply and therefore there is only one recommended way to instantiate ClientServices: via the default constructor.
The default implementation does the following:
Commands can be sent to client services via Command
message objects.
Supported commands include:
cmd param ping seq_no reboot n/a blink 0/1 (unset or set) setinterval(s) 0 to 3600s
When blink is enabled, the blue LED turns on for the duration of processing a command and the green LED turns on when sending the heartbeat.
In addition to using ClientServices as a standalone app, it can also be invoked from another program, e.g. using this approach:
private static ClientServicesLib cs; public static void sendHeartbeat() throws InterruptedException { if (cs == null) { cs = new ClientServicesLib(); // don't perform receive cs.receive = false; cs.init(); } // send heartbeat once, then exit cs.loopCount = 1; cs.run(); }
Field Summary | |
---|---|
short |
firmwareBuild
|
int |
heartbeatInterval
Interval to wait between heartbeat. |
protected Sensor<javax.measure.quantity.Dimensionless> |
humidity
|
protected Sensor<javax.measure.quantity.Temperature> |
itemperature
|
short |
loopCount
Number of loop iterations. |
boolean |
receive
Indicates that commands such as ping should not be received, only heartbeat will be sent. |
Sender |
sender
Sender used for heartbeat and command/ping reply |
protected Sensor<javax.measure.quantity.Temperature> |
temperature
|
protected Sensor<javax.measure.quantity.Illuminance> |
tsr
|
protected Sensor<javax.measure.quantity.ElectricPotential> |
voltage
|
Constructor Summary | |
---|---|
|
ClientServicesLib()
Default constructor. |
|
ClientServicesLib(boolean local)
ClientServices with specification of protocol (single or multi-hop). |
protected |
ClientServicesLib(int options)
Ctor with options. |
Method Summary | |
---|---|
void |
init()
|
void |
run()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final short firmwareBuild
public int heartbeatInterval
protected Sensor<javax.measure.quantity.Temperature> temperature
protected Sensor<javax.measure.quantity.Temperature> itemperature
protected Sensor<javax.measure.quantity.Dimensionless> humidity
protected Sensor<javax.measure.quantity.ElectricPotential> voltage
protected Sensor<javax.measure.quantity.Illuminance> tsr
public short loopCount
public boolean receive
public Sender sender
Constructor Detail |
---|
protected ClientServicesLib(int options)
options
- Heartbeat.options
public ClientServicesLib()
public ClientServicesLib(boolean local)
local
- use local protocol. If true, will use
local protocol, otherwise will use collect/multi-hop protocolMethod Detail |
---|
public void init()
public void run() throws InterruptedException
InterruptedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |