com.sentilla.platform.tmote
Class MotePower

java.lang.Object
  extended by com.sentilla.platform.tmote.Action
      extended by com.sentilla.platform.tmote.MotePower
All Implemented Interfaces:
Action, Sensor<javax.measure.quantity.Energy>

public class MotePower
extends Action
implements Sensor<javax.measure.quantity.Energy>

A Sensor for reading total power consumption on tmote. Reads system components (currently, CPU) and tallies the total consumption.


Field Summary
 
Fields inherited from class com.sentilla.platform.tmote.Action
actionAuto, actionId, actionState, isolateOwner
 
Fields inherited from interface com.sentilla.system.Action
DONE, ERROR, IDLE, PENDING
 
Constructor Summary
MotePower()
           
 
Method Summary
 javax.measure.Measurable<javax.measure.quantity.Energy> getResult()
          Asynchronous interface to get the result of the last sensor read operation.
 boolean isDone()
          Return true is this Action is DONE.
 javax.measure.Measurable<javax.measure.quantity.Energy> read()
          Read a new measurement and return the result.
 Sensor<javax.measure.quantity.Energy> setRead()
          Asynchronous interface to set up a read operation on a sensor.
 
Methods inherited from class com.sentilla.platform.tmote.Action
block, block, cancel, getActionState, initAction, lookup, submit
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sentilla.system.Action
block, block, cancel, getActionState, submit
 

Constructor Detail

MotePower

public MotePower()
Method Detail

read

public javax.measure.Measurable<javax.measure.quantity.Energy> read()
Description copied from interface: Sensor
Read a new measurement and return the result.

After reading a sensor, be sure to read its value using Measureable.doubleValue(unit), where unit defines the resulting unit for the reading (such as SI.Celsius for a temperature reading).

Specified by:
read in interface Sensor<javax.measure.quantity.Energy>
Returns:
Sensor measurement of type Q.

setRead

public Sensor<javax.measure.quantity.Energy> setRead()
Description copied from interface: Sensor
Asynchronous interface to set up a read operation on a sensor. Use the submit() function to initiating the sensor reading.

Specified by:
setRead in interface Sensor<javax.measure.quantity.Energy>
Returns:
The instance of Sensor that is set to read its sensor

getResult

public javax.measure.Measurable<javax.measure.quantity.Energy> getResult()
Description copied from interface: Sensor
Asynchronous interface to get the result of the last sensor read operation.

Specified by:
getResult in interface Sensor<javax.measure.quantity.Energy>
Returns:
Sensor measurement of type Q.

isDone

public boolean isDone()
               throws ActionException
Description copied from interface: Action
Return true is this Action is DONE. isDone can be used with block(timeoutMilli) to determine if the Action has completed. Calling isDone is equivalent to getActionState() == Action.DONE. Throw ActionException is getActionState() == Action.ERROR.

Specified by:
isDone in interface Action
Overrides:
isDone in class Action
Throws:
ActionException


Copyright © 2007 Sentilla Corporation. All Rights Reserved.