|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.tinyos.sim.script.reflect.SimReflect | +--net.tinyos.sim.script.reflect.SimObject | +--net.tinyos.sim.script.reflect.Mote
The Mote class provides access to the simulated mote objects.
Each mote that is simulated has a corresponding simulator object.
These simulator objects are bound into the simcore module as the
motes list. Hence for example, motes[3].turnOn()
will turn on mote number 3.
Generic methods that are available on all simulator objects are
described in SimObject
.
Constructor Summary | |
---|---|
Mote(net.tinyos.sim.script.ScriptInterpreter interp,
net.tinyos.sim.SimDriver driver,
net.tinyos.sim.MoteSimObject mote)
|
Method Summary | |
---|---|
byte |
getByte(java.lang.String var)
Resolve and return the value of a mote frame variable, and return it as a byte. |
byte[] |
getBytes(java.lang.String var)
Resolve and return the value of a mote frame variable, and return it as a byte array. |
byte[] |
getBytes(java.lang.String var,
long len,
long offset)
Resolve and return the value of a mote frame variable, specifying the length and the offset, and return it as a byte array. |
int |
getID()
Return the mote's ID. |
int |
getInt(java.lang.String var)
Resolve and return the value of a mote frame variable, and return it as an int. |
long |
getLong(java.lang.String var)
Resolve and return the value of a mote frame variable, and return it as a long. |
short |
getShort(java.lang.String var)
Resolve and return the value of a mote frame variable, and return it as a short. |
boolean |
isOn()
Return whether or not the mote is on. |
void |
setLabel(java.lang.String label,
int xoff,
int yoff)
Set a label in the TinyViz GUI for the given mote at a constant offset to the mote's position. |
java.lang.String |
toString()
Return a string representing the mote's state (i.e. power, position). |
void |
turnOff()
Turn the mote off. |
void |
turnOn()
Turn the mote on. |
Methods inherited from class net.tinyos.sim.script.reflect.SimObject |
---|
addAttribute, addAttributeChangedEvent, getAttribute, getCoord, getDistance, getDistance, getDistance, getXCoord, getYCoord, isSelected, move, moveTo, removeAttribute, setCoord, setSelected, setUnselected |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Mote(net.tinyos.sim.script.ScriptInterpreter interp, net.tinyos.sim.SimDriver driver, net.tinyos.sim.MoteSimObject mote)
Method Detail |
public int getID()
public java.lang.String toString()
toString
in class java.lang.Object
public void turnOn() throws java.io.IOException
java.io.IOException
public void turnOff() throws java.io.IOException
java.io.IOException
public boolean isOn()
public void setLabel(java.lang.String label, int xoff, int yoff)
label
- the string to displayxoff
- x offset of the labelyoff
- y offset of the labelpublic byte[] getBytes(java.lang.String var, long len, long offset) throws java.io.IOException
var
- variable name to resolve and return
java.io.IOException
public byte[] getBytes(java.lang.String var) throws java.io.IOException
var
- variable name to resolve and return
java.io.IOException
public long getLong(java.lang.String var) throws java.io.IOException
var
- variable name to resolve and return
java.io.IOException
public int getInt(java.lang.String var) throws java.io.IOException
var
- variable name to resolve and return
java.io.IOException
public short getShort(java.lang.String var) throws java.io.IOException
var
- variable name to resolve and return
java.io.IOException
public byte getByte(java.lang.String var) throws java.io.IOException
var
- variable name to resolve and return
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |