com.sentilla.platform.tmote
Class MotePower
java.lang.Object
com.sentilla.platform.tmote.Action
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.
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. |
MotePower
public MotePower()
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.