moteaccess
Class DummyMoteAccess
java.lang.Object
moteaccess.DummyMoteAccess
- All Implemented Interfaces:
- IMoteAccess
- public class DummyMoteAccess
- extends java.lang.Object
- implements IMoteAccess
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
requests
java.util.Vector requests
requesters
java.util.Vector requesters
timeout
int timeout
num_req
int num_req
epoch
int epoch
timer
DummyMoteAccess.Timer timer
rand
java.util.Random rand
stopReaction
boolean stopReaction
DummyMoteAccess
public DummyMoteAccess()
doRead
public void doRead(RequestID r,
MoteRequest mr,
IMoteListener ml)
- Roughly simulate the behaviour of a correct doRead of a IMoteAccess. The rdg operation is not stopable as it should
be in a real MoteAccess
- Specified by:
doRead
in interface IMoteAccess
- Parameters:
r
- : the RequestID that the client application has generated.mr
- : the MoteRequest object describing the desired reading.ml
- : reference to the IMoteListener implementation to be notified of incoming results.
stopOperation
public void stopOperation(RequestID rid)
- Description copied from interface:
IMoteAccess
- Method used to stop a running operation, i.e. a reading or a reaction.
- Specified by:
stopOperation
in interface IMoteAccess
- Parameters:
rid
- : the RequestID identifying the operation to be stopped.
injectReaction
public void injectReaction(RequestID r,
MoteReaction mr,
IMoteListener ml)
- Emulate the behaviour of an injectReaction
- Specified by:
injectReaction
in interface IMoteAccess
- Parameters:
r
- : the RequestID that the client application has generated.mr
- : the MoteReaction object describing the desired reaction.ml
- : reference to the IMoteListener implementation to be notified of incoming results.
timeElapsed
private void timeElapsed(IMoteListener ml)
setParameter
public boolean setParameter(java.lang.String parameter,
int value)
- Description copied from interface:
IMoteAccess
- Method by which parameters at the MoteAccess level can be set.
- Specified by:
setParameter
in interface IMoteAccess
- Parameters:
parameter
- String identifying the parameter to be modifiedvalue
- integer to which the parameter has to be set.
- Returns:
- boolean indicating wheter the update has taken place or not