|
|||||||||
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.Commands
The Commands class is a reflection of the 'raw' simulator interface. It is expetect that most functionality will be accessible through one of the other reflected classes, however this class is available for a lower-level interface.
The class is bound into the simcore module as the comm global instance.
Field Summary | |
---|---|
static long |
DBG_ADC
|
static long |
DBG_ALL
|
static long |
DBG_AM
|
static long |
DBG_BOOT
|
static long |
DBG_CLOCK
|
static long |
DBG_CRC
|
static long |
DBG_CRYPTO
|
static long |
DBG_ENCODE
|
static long |
DBG_ERROR
|
static long |
DBG_HARD
|
static long |
DBG_I2C
|
static long |
DBG_LED
|
static long |
DBG_LOG
|
static long |
DBG_MEM
|
static long |
DBG_NONE
|
static long |
DBG_PACKET
|
static long |
DBG_PROG
|
static long |
DBG_QUEUE
|
static long |
DBG_RADIO
|
static long |
DBG_ROUTE
|
static long |
DBG_SCHED
|
static long |
DBG_SENSOR
|
static long |
DBG_SIM
|
static long |
DBG_SIMRADIO
|
static long |
DBG_SOUNDER
|
static long |
DBG_TASK
|
static long |
DBG_TEMP
|
static long |
DBG_TIME
|
static long |
DBG_UART
|
static long |
DBG_USR1
|
static long |
DBG_USR2
|
static long |
DBG_USR3
|
Constructor Summary | |
---|---|
Commands(net.tinyos.sim.script.ScriptInterpreter interp,
net.tinyos.sim.SimDriver driver)
Constructor for the Commands object. |
Method Summary | |
---|---|
int |
getInterruptID()
Get a unique interrupt ID. |
void |
interruptInFuture(long time,
int interruptID)
Schedule an interrupt event. |
net.tinyos.sim.event.VariableRequestResponse |
requestVariable(long addr,
short length)
Send a variable request command and return the result value. |
net.tinyos.sim.event.VariableResolveResponse |
resolveVariable(short moteID,
java.lang.String name)
Send a variable resolve command and return the result. |
void |
sendRadioMessage(short moteID,
long time,
net.tinyos.message.Message msg)
Sends a radio message to the given mote. |
void |
sendUARTMessage(short moteID,
long time,
net.tinyos.message.Message msg)
Sends a UART message to the given mote. |
void |
setADCValue(short moteID,
long time,
byte port,
short value)
Set the ADC value at the given mote to the specified value. |
void |
setDBG(long dbg)
Enable the given debug flag. |
void |
setEventMask(short mask)
Set the mask for which events are transmitted. |
void |
setLinkBitErrorProbability(short src,
long time,
short dest,
double loss)
Set the ADC value at the given mote to the specified value. |
void |
setSimRate(double rate)
Sets the simulator rate |
void |
turnMoteOff(short moteID,
long time)
Turn off the given mote. |
void |
turnMoteOn(short moteID,
long time)
Turn on the given mote. |
void |
waitFor(long time)
Block execution for a specified amount of time. |
void |
waitUntil(long time)
Block execution until the given simulator time. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final long DBG_BOOT
public static final long DBG_CLOCK
public static final long DBG_TASK
public static final long DBG_SCHED
public static final long DBG_SENSOR
public static final long DBG_LED
public static final long DBG_CRYPTO
public static final long DBG_ROUTE
public static final long DBG_AM
public static final long DBG_CRC
public static final long DBG_PACKET
public static final long DBG_ENCODE
public static final long DBG_RADIO
public static final long DBG_LOG
public static final long DBG_ADC
public static final long DBG_I2C
public static final long DBG_UART
public static final long DBG_PROG
public static final long DBG_SOUNDER
public static final long DBG_TIME
public static final long DBG_SIM
public static final long DBG_QUEUE
public static final long DBG_SIMRADIO
public static final long DBG_HARD
public static final long DBG_MEM
public static final long DBG_USR1
public static final long DBG_USR2
public static final long DBG_USR3
public static final long DBG_TEMP
public static final long DBG_ERROR
public static final long DBG_NONE
public static final long DBG_ALL
Constructor Detail |
public Commands(net.tinyos.sim.script.ScriptInterpreter interp, net.tinyos.sim.SimDriver driver)
Method Detail |
public void sendRadioMessage(short moteID, long time, net.tinyos.message.Message msg) throws java.io.IOException
moteID
- the id of the target motetime
- simulator time when to do the operationmsg
- the actual message class
java.io.IOException
public void sendUARTMessage(short moteID, long time, net.tinyos.message.Message msg) throws java.io.IOException
moteID
- the id of the target motetime
- simulator time when to do the operationmsg
- the actual message class
java.io.IOException
public void turnMoteOff(short moteID, long time) throws java.io.IOException
moteID
- the id of the motetime
- simulator time when to do the operation
java.io.IOException
public void turnMoteOn(short moteID, long time) throws java.io.IOException
moteID
- the id of the motetime
- simulator time when to do the operation
java.io.IOException
public void setADCValue(short moteID, long time, byte port, short value) throws java.io.IOException
moteID
- the id of the motetime
- simulator time when to do the operationport
- the ADC port to setvalue
- the new value
java.io.IOException
public void setSimRate(double rate) throws java.io.IOException
rate
- the new simulator rate (relative to real time)
java.io.IOException
public void setLinkBitErrorProbability(short src, long time, short dest, double loss) throws java.io.IOException
src
- the source mote iddest
- the destination mote idtime
- simulator time when to do the operationloss
- the bit error loss value
java.io.IOException
public int getInterruptID()
public void interruptInFuture(long time, int interruptID) throws java.io.IOException
time
- simulator time when to do the operationinterruptID
- id code for the interrupt event
java.io.IOException
public net.tinyos.sim.event.VariableResolveResponse resolveVariable(short moteID, java.lang.String name) throws java.io.IOException
moteID
- mote identifiername
- mote frame variable name
java.io.IOException
public net.tinyos.sim.event.VariableRequestResponse requestVariable(long addr, short length) throws java.io.IOException
addr
- variable addresslength
- variable length
java.io.IOException
public void setDBG(long dbg) throws java.io.IOException
dbg
- debug flag
java.io.IOException
public void setEventMask(short mask) throws java.io.IOException
mask
- event mask
java.io.IOException
public void waitUntil(long time) throws java.io.IOException
time
- simulator time at which to unblock
java.io.IOException
public void waitFor(long time) throws java.io.IOException
time
- simulator time amount to wait for
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |