fixed line endings

This commit is contained in:
Fredrik Osterlind 2011-02-11 13:27:17 +01:00
parent 3bf99ca040
commit 9e14d09bb0
29 changed files with 2128 additions and 2128 deletions

View file

@ -1,2 +1,2 @@
se.sics.cooja.GUI.MOTETYPES = + se.sics.cooja.avrmote.MicaZMoteType se.sics.cooja.GUI.MOTETYPES = + se.sics.cooja.avrmote.MicaZMoteType
se.sics.cooja.GUI.JARFILES = + cooja_avrora.jar avrora-small.jar se.sics.cooja.GUI.JARFILES = + cooja_avrora.jar avrora-small.jar

View file

@ -1,2 +1,2 @@
se.sics.cooja.GUI.RADIOMEDIUMS = + se.sics.mrm.MRM se.sics.cooja.GUI.RADIOMEDIUMS = + se.sics.mrm.MRM
se.sics.cooja.GUI.JARFILES = + mrm.jar se.sics.cooja.GUI.JARFILES = + mrm.jar

View file

@ -1,3 +1,3 @@
se.sics.cooja.GUI.MOTETYPES = + se.sics.cooja.mspmote.ESBMoteType se.sics.cooja.mspmote.SkyMoteType se.sics.cooja.GUI.MOTETYPES = + se.sics.cooja.mspmote.ESBMoteType se.sics.cooja.mspmote.SkyMoteType
se.sics.cooja.GUI.JARFILES = + cooja_mspsim.jar mspsim.jar coffee.jar jipv6.jar se.sics.cooja.GUI.JARFILES = + cooja_mspsim.jar mspsim.jar coffee.jar jipv6.jar
se.sics.cooja.GUI.PLUGINS = + se.sics.cooja.mspmote.plugins.MspCLI se.sics.cooja.mspmote.plugins.MspCodeWatcher se.sics.cooja.mspmote.plugins.MspStackWatcher se.sics.cooja.mspmote.plugins.MspCycleWatcher se.sics.cooja.GUI.PLUGINS = + se.sics.cooja.mspmote.plugins.MspCLI se.sics.cooja.mspmote.plugins.MspCodeWatcher se.sics.cooja.mspmote.plugins.MspStackWatcher se.sics.cooja.mspmote.plugins.MspCycleWatcher

View file

@ -1,2 +1,2 @@
se.sics.cooja.GUI.PLUGINS = + se.sics.cooja.plugins.NativeIPGateway se.sics.cooja.GUI.PLUGINS = + se.sics.cooja.plugins.NativeIPGateway
se.sics.cooja.GUI.JARFILES = + native_gateway.jar se.sics.cooja.GUI.JARFILES = + native_gateway.jar

View file

@ -1,12 +1,12 @@
<html> <html>
<head> <title> The COOJA Simulator (applet) </title> </head> <head> <title> The COOJA Simulator (applet) </title> </head>
<body> <body>
<applet code="se/sics/cooja/CoojaApplet.class" <applet code="se/sics/cooja/CoojaApplet.class"
archive="../lib/jdom.jar, ../lib/log4j.jar, ../apps/mrm/lib/mrm.jar, ../apps/mspsim/lib/mspsim.jar, ../apps/mspsim/lib/cooja_mspsim.jar" archive="../lib/jdom.jar, ../lib/log4j.jar, ../apps/mrm/lib/mrm.jar, ../apps/mspsim/lib/mspsim.jar, ../apps/mspsim/lib/cooja_mspsim.jar"
width="600" height="400"> width="600" height="400">
</applet> </applet>
</body> </body>
</html> </html>

View file

@ -1,3 +1,3 @@
grant { grant {
permission java.security.AllPermission; permission java.security.AllPermission;
}; };

View file

@ -1,5 +1,5 @@
se.sics.cooja.GUI.MOTETYPES = se.sics.cooja.motes.DisturberMoteType se.sics.cooja.contikimote.ContikiMoteType se.sics.cooja.mspmote.ESBMoteType se.sics.cooja.mspmote.SkyMoteType se.sics.cooja.GUI.MOTETYPES = se.sics.cooja.motes.DisturberMoteType se.sics.cooja.contikimote.ContikiMoteType se.sics.cooja.mspmote.ESBMoteType se.sics.cooja.mspmote.SkyMoteType
se.sics.cooja.GUI.PLUGINS = se.sics.cooja.plugins.Visualizer se.sics.cooja.plugins.LogListener se.sics.cooja.plugins.MoteInformation se.sics.cooja.plugins.MoteInterfaceViewer se.sics.cooja.plugins.VariableWatcher se.sics.cooja.plugins.EventListener se.sics.cooja.plugins.RadioLogger se.sics.cooja.mspmote.plugins.MspCodeWatcher se.sics.cooja.mspmote.plugins.MspStackWatcher se.sics.cooja.mspmote.plugins.MspCycleWatcher se.sics.cooja.GUI.PLUGINS = se.sics.cooja.plugins.Visualizer se.sics.cooja.plugins.LogListener se.sics.cooja.plugins.MoteInformation se.sics.cooja.plugins.MoteInterfaceViewer se.sics.cooja.plugins.VariableWatcher se.sics.cooja.plugins.EventListener se.sics.cooja.plugins.RadioLogger se.sics.cooja.mspmote.plugins.MspCodeWatcher se.sics.cooja.mspmote.plugins.MspStackWatcher se.sics.cooja.mspmote.plugins.MspCycleWatcher
se.sics.cooja.GUI.IP_DISTRIBUTORS = se.sics.cooja.ipdistributors.RandomIPDistributor se.sics.cooja.ipdistributors.SpatialIPDistributor se.sics.cooja.ipdistributors.IdIPDistributor se.sics.cooja.GUI.IP_DISTRIBUTORS = se.sics.cooja.ipdistributors.RandomIPDistributor se.sics.cooja.ipdistributors.SpatialIPDistributor se.sics.cooja.ipdistributors.IdIPDistributor
se.sics.cooja.GUI.POSITIONERS = se.sics.cooja.positioners.RandomPositioner se.sics.cooja.positioners.LinearPositioner se.sics.cooja.positioners.EllipsePositioner se.sics.cooja.positioners.ManualPositioner se.sics.cooja.GUI.POSITIONERS = se.sics.cooja.positioners.RandomPositioner se.sics.cooja.positioners.LinearPositioner se.sics.cooja.positioners.EllipsePositioner se.sics.cooja.positioners.ManualPositioner
se.sics.cooja.GUI.RADIOMEDIUMS = se.sics.cooja.radiomediums.UDGM se.sics.cooja.radiomediums.UDGMConstantLoss se.sics.cooja.radiomediums.DirectedGraphMedium se.sics.mrm.MRM se.sics.cooja.radiomediums.SilentRadioMedium se.sics.cooja.GUI.RADIOMEDIUMS = se.sics.cooja.radiomediums.UDGM se.sics.cooja.radiomediums.UDGMConstantLoss se.sics.cooja.radiomediums.DirectedGraphMedium se.sics.mrm.MRM se.sics.cooja.radiomediums.SilentRadioMedium

View file

@ -1,41 +1,41 @@
PATH_CONTIKI = ../../.. PATH_CONTIKI = ../../..
PATH_COOJA_CORE_RELATIVE = /platform/cooja PATH_COOJA_CORE_RELATIVE = /platform/cooja
PATH_MAKE = make PATH_MAKE = make
PATH_LINKER = ld PATH_LINKER = ld
PATH_AR = ar PATH_AR = ar
PATH_SHELL = sh PATH_SHELL = sh
PATH_C_COMPILER = gcc PATH_C_COMPILER = gcc
PATH_OBJDUMP=objdump PATH_OBJDUMP=objdump
OBJDUMP_ARGS=-h OBJDUMP_ARGS=-h
CMD_GREP_PROCESSES = grep "^PROCESS_THREAD[ ]*([^,]*,[^,]*,[^)]*)" -o -H CMD_GREP_PROCESSES = grep "^PROCESS_THREAD[ ]*([^,]*,[^,]*,[^)]*)" -o -H
REGEXP_PARSE_PROCESSES = ([^/]*.c):PROCESS_THREAD[ ]*\\(([^,]*),[^,]*,[^)]*\\) REGEXP_PARSE_PROCESSES = ([^/]*.c):PROCESS_THREAD[ ]*\\(([^,]*),[^,]*,[^)]*\\)
CMD_GREP_INTERFACES = grep "^SIM_INTERFACE([^,]*," -o -d skip -D skip -H -r CMD_GREP_INTERFACES = grep "^SIM_INTERFACE([^,]*," -o -d skip -D skip -H -r
REGEXP_PARSE_INTERFACES = ([^/]*.c):SIM_INTERFACE\\(([^,]*), REGEXP_PARSE_INTERFACES = ([^/]*.c):SIM_INTERFACE\\(([^,]*),
CMD_GREP_SENSORS = grep "^SENSORS_SENSOR([^,]*," -o -d skip -D skip -H -r CMD_GREP_SENSORS = grep "^SENSORS_SENSOR([^,]*," -o -d skip -D skip -H -r
REGEXP_PARSE_SENSORS = ([^/]*.c):SENSORS_SENSOR\\(([^,]*), REGEXP_PARSE_SENSORS = ([^/]*.c):SENSORS_SENSOR\\(([^,]*),
COMPILER_ARGS = -I'$(JAVA_HOME)/include' -I'$(JAVA_HOME)/include/linux' -fno-builtin-printf -fPIC COMPILER_ARGS = -I'$(JAVA_HOME)/include' -I'$(JAVA_HOME)/include/linux' -fno-builtin-printf -fPIC
LINK_COMMAND_1 = gcc -I'$(JAVA_HOME)/include' -I'$(JAVA_HOME)/include/linux' -shared -Wl,-Map=$(MAPFILE) -o $(LIBFILE) LINK_COMMAND_1 = gcc -I'$(JAVA_HOME)/include' -I'$(JAVA_HOME)/include/linux' -shared -Wl,-Map=$(MAPFILE) -o $(LIBFILE)
LINK_COMMAND_2 = LINK_COMMAND_2 =
AR_COMMAND_1 = ar rcf $(ARFILE) AR_COMMAND_1 = ar rcf $(ARFILE)
AR_COMMAND_2 = AR_COMMAND_2 =
CONTIKI_STANDARD_PROCESSES = sensors_process;etimer_process CONTIKI_STANDARD_PROCESSES = sensors_process;etimer_process
CORECOMM_TEMPLATE_FILENAME = corecomm_template.java CORECOMM_TEMPLATE_FILENAME = corecomm_template.java
PATH_JAVAC = javac PATH_JAVAC = javac
DEFAULT_PROJECTDIRS = [CONTIKI_DIR]/tools/cooja/apps/mrm;[CONTIKI_DIR]/tools/cooja/apps/mspsim;[CONTIKI_DIR]/tools/cooja/apps/avrora;[CONTIKI_DIR]/tools/cooja/apps/serial_socket;[CONTIKI_DIR]/tools/cooja/apps/collect-view DEFAULT_PROJECTDIRS = [CONTIKI_DIR]/tools/cooja/apps/mrm;[CONTIKI_DIR]/tools/cooja/apps/mspsim;[CONTIKI_DIR]/tools/cooja/apps/avrora;[CONTIKI_DIR]/tools/cooja/apps/serial_socket;[CONTIKI_DIR]/tools/cooja/apps/collect-view
PARSE_WITH_COMMAND=false PARSE_WITH_COMMAND=false
PARSE_COMMAND=nm -a $(LIBFILE) PARSE_COMMAND=nm -a $(LIBFILE)
MAPFILE_DATA_START = ^.data[ \t]*0x([0-9A-Fa-f]*)[ \t]*0x[0-9A-Fa-f]*[ \t]*$ MAPFILE_DATA_START = ^.data[ \t]*0x([0-9A-Fa-f]*)[ \t]*0x[0-9A-Fa-f]*[ \t]*$
MAPFILE_DATA_SIZE = ^.data[ \t]*0x[0-9A-Fa-f]*[ \t]*0x([0-9A-Fa-f]*)[ \t]*$ MAPFILE_DATA_SIZE = ^.data[ \t]*0x[0-9A-Fa-f]*[ \t]*0x([0-9A-Fa-f]*)[ \t]*$
MAPFILE_BSS_START = ^.bss[ \t]*0x([0-9A-Fa-f]*)[ \t]*0x[0-9A-Fa-f]*[ \t]*$ MAPFILE_BSS_START = ^.bss[ \t]*0x([0-9A-Fa-f]*)[ \t]*0x[0-9A-Fa-f]*[ \t]*$
MAPFILE_BSS_SIZE = ^.bss[ \t]*0x[0-9A-Fa-f]*[ \t]*0x([0-9A-Fa-f]*)[ \t]*$ MAPFILE_BSS_SIZE = ^.bss[ \t]*0x[0-9A-Fa-f]*[ \t]*0x([0-9A-Fa-f]*)[ \t]*$
MAPFILE_VAR_NAME = ^[ \t]*(0x[0-9A-Fa-f]*)[ \t]*([^ ]*)[ \t]*$ MAPFILE_VAR_NAME = ^[ \t]*(0x[0-9A-Fa-f]*)[ \t]*([^ ]*)[ \t]*$
MAPFILE_VAR_ADDRESS_1 = ^[ \t]*0x([0-9A-Fa-f]*)[ \t]* MAPFILE_VAR_ADDRESS_1 = ^[ \t]*0x([0-9A-Fa-f]*)[ \t]*
MAPFILE_VAR_ADDRESS_2 = [ \t]*$ MAPFILE_VAR_ADDRESS_2 = [ \t]*$
MAPFILE_VAR_SIZE_1 = ^ MAPFILE_VAR_SIZE_1 = ^
MAPFILE_VAR_SIZE_2 = [ \t]*(0x[0-9A-Fa-f]*)[ \t]*[^ ]*[ \t]*$ MAPFILE_VAR_SIZE_2 = [ \t]*(0x[0-9A-Fa-f]*)[ \t]*[^ ]*[ \t]*$
COMMAND_VAR_NAME_ADDRESS = ^([0-9A-Fa-f][0-9A-Fa-f]*)[ \t][^Tt][ \t]([^ ._][^ ]*) COMMAND_VAR_NAME_ADDRESS = ^([0-9A-Fa-f][0-9A-Fa-f]*)[ \t][^Tt][ \t]([^ ._][^ ]*)
COMMAND_DATA_START = ^([0-9A-Fa-f]*)[ \t]d[ \t].data$ COMMAND_DATA_START = ^([0-9A-Fa-f]*)[ \t]d[ \t].data$
COMMAND_DATA_END = ^([0-9A-Fa-f]*)[ \t]A[ \t]_edata$ COMMAND_DATA_END = ^([0-9A-Fa-f]*)[ \t]A[ \t]_edata$
COMMAND_BSS_START = ^([0-9A-Fa-f]*)[ \t]A[ \t]__bss_start$ COMMAND_BSS_START = ^([0-9A-Fa-f]*)[ \t]A[ \t]__bss_start$
COMMAND_BSS_END = ^([0-9A-Fa-f]*)[ \t]A[ \t]_end$ COMMAND_BSS_END = ^([0-9A-Fa-f]*)[ \t]A[ \t]_end$

View file

@ -1,46 +1,46 @@
PATH_CONTIKI = ../../.. PATH_CONTIKI = ../../..
PATH_COOJA_CORE_RELATIVE = /platform/cooja PATH_COOJA_CORE_RELATIVE = /platform/cooja
PATH_MAKE = make PATH_MAKE = make
PATH_LINKER = gcc PATH_LINKER = gcc
PATH_AR = ar PATH_AR = ar
PATH_SHELL = sh PATH_SHELL = sh
PATH_C_COMPILER = gcc PATH_C_COMPILER = gcc
PATH_OBJDUMP= objdump PATH_OBJDUMP= objdump
OBJDUMP_ARGS= -h OBJDUMP_ARGS= -h
CMD_GREP_PROCESSES = grep "^PROCESS_THREAD[ ]*([^,]*,[^,]*,[^)]*)" -o -H CMD_GREP_PROCESSES = grep "^PROCESS_THREAD[ ]*([^,]*,[^,]*,[^)]*)" -o -H
REGEXP_PARSE_PROCESSES = ([^/]*.c):PROCESS_THREAD[ ]*\\(([^,]*),[^,]*,[^)]*\\) REGEXP_PARSE_PROCESSES = ([^/]*.c):PROCESS_THREAD[ ]*\\(([^,]*),[^,]*,[^)]*\\)
CMD_GREP_INTERFACES = grep "^SIM_INTERFACE([^,]*," -o -d skip -D skip -H -r CMD_GREP_INTERFACES = grep "^SIM_INTERFACE([^,]*," -o -d skip -D skip -H -r
REGEXP_PARSE_INTERFACES = ([^/]*.c):SIM_INTERFACE\\(([^,]*), REGEXP_PARSE_INTERFACES = ([^/]*.c):SIM_INTERFACE\\(([^,]*),
CMD_GREP_SENSORS = grep "^SENSORS_SENSOR([^,]*," -o -d skip -D skip -H -r CMD_GREP_SENSORS = grep "^SENSORS_SENSOR([^,]*," -o -d skip -D skip -H -r
REGEXP_PARSE_SENSORS = ([^/]*.c):SENSORS_SENSOR\\(([^,]*), REGEXP_PARSE_SENSORS = ([^/]*.c):SENSORS_SENSOR\\(([^,]*),
COMPILER_ARGS = -Wall -I/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Headers -dynamiclib -fno-common -DHAVE_SNPRINTF COMPILER_ARGS = -Wall -I/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Headers -dynamiclib -fno-common -DHAVE_SNPRINTF
LINK_COMMAND_1 = gcc -dynamiclib -fno-common -o $(LIBFILE) LINK_COMMAND_1 = gcc -dynamiclib -fno-common -o $(LIBFILE)
LINK_COMMAND_2 = -framework JavaVM -Wl,-map,$(MAPFILE) LINK_COMMAND_2 = -framework JavaVM -Wl,-map,$(MAPFILE)
AR_COMMAND_1 = ar rc $(ARFILE) AR_COMMAND_1 = ar rc $(ARFILE)
AR_COMMAND_2 = AR_COMMAND_2 =
CONTIKI_STANDARD_PROCESSES = sensors_process;etimer_process CONTIKI_STANDARD_PROCESSES = sensors_process;etimer_process
CORECOMM_TEMPLATE_FILENAME = corecomm_template.java CORECOMM_TEMPLATE_FILENAME = corecomm_template.java
PATH_JAVAC = javac PATH_JAVAC = javac
DEFAULT_PROJECTDIRS = [CONTIKI_DIR]/tools/cooja/apps/mrm;[CONTIKI_DIR]/tools/cooja/apps/mspsim;[CONTIKI_DIR]/tools/cooja/apps/avrora;[CONTIKI_DIR]/tools/cooja/apps/serial_socket;[CONTIKI_DIR]/tools/cooja/apps/collect-view DEFAULT_PROJECTDIRS = [CONTIKI_DIR]/tools/cooja/apps/mrm;[CONTIKI_DIR]/tools/cooja/apps/mspsim;[CONTIKI_DIR]/tools/cooja/apps/avrora;[CONTIKI_DIR]/tools/cooja/apps/serial_socket;[CONTIKI_DIR]/tools/cooja/apps/collect-view
PARSE_WITH_COMMAND = true PARSE_WITH_COMMAND = true
PARSE_COMMAND = /opt/contiki-2.x/tools/cooja/examples/jni_test/mac_users/nmandsize $(LIBFILE) PARSE_COMMAND = /opt/contiki-2.x/tools/cooja/examples/jni_test/mac_users/nmandsize $(LIBFILE)
MAPFILE_DATA_START = ^__DATA[ ]*__data[ ]*0x([0-9A-Fa-f]*)[ ]*0x[0-9A-Fa-f]*[ ]*$ MAPFILE_DATA_START = ^__DATA[ ]*__data[ ]*0x([0-9A-Fa-f]*)[ ]*0x[0-9A-Fa-f]*[ ]*$
MAPFILE_DATA_SIZE = ^__DATA[ ]*__data[ ]*0x[0-9A-Fa-f]*[ ]*0x([0-9A-Fa-f]*)[ ]*$ MAPFILE_DATA_SIZE = ^__DATA[ ]*__data[ ]*0x[0-9A-Fa-f]*[ ]*0x([0-9A-Fa-f]*)[ ]*$
MAPFILE_BSS_START = ^__DATA[ ]*__bss[ ]*0x[0-9A-Fa-f]*[ ]*0x([0-9A-Fa-f]*)[ ]*$ MAPFILE_BSS_START = ^__DATA[ ]*__bss[ ]*0x[0-9A-Fa-f]*[ ]*0x([0-9A-Fa-f]*)[ ]*$
MAPFILE_BSS_SIZE = ^__DATA[ ]*__bss[ ]*0x[0-9A-Fa-f]*[ ]*0x([0-9A-Fa-f]*)[ ]*$ MAPFILE_BSS_SIZE = ^__DATA[ ]*__bss[ ]*0x[0-9A-Fa-f]*[ ]*0x([0-9A-Fa-f]*)[ ]*$
MAPFILE_COMMON_START = ^__DATA[ ]*__common[ ]*0x([0-9A-Fa-f]*)[ ]*0x[0-9A-Fa-f]*[ ]*$ MAPFILE_COMMON_START = ^__DATA[ ]*__common[ ]*0x([0-9A-Fa-f]*)[ ]*0x[0-9A-Fa-f]*[ ]*$
MAPFILE_COMMON_SIZE = ^__DATA[ ]*__common[ ]*0x[0-9A-Fa-f]*[ ]*0x([0-9A-Fa-f]*)[ ]*$ MAPFILE_COMMON_SIZE = ^__DATA[ ]*__common[ ]*0x[0-9A-Fa-f]*[ ]*0x([0-9A-Fa-f]*)[ ]*$
MAPFILE_VAR_NAME = ^[ \\t]*(0x[0-9A-Fa-f]*)[ \\t]*([^ ]*)[ \\t]*$ MAPFILE_VAR_NAME = ^[ \\t]*(0x[0-9A-Fa-f]*)[ \\t]*([^ ]*)[ \\t]*$
MAPFILE_VAR_ADDRESS_1 = ^[ \\t]*0x([0-9A-Fa-f]*)[ \\t]* MAPFILE_VAR_ADDRESS_1 = ^[ \\t]*0x([0-9A-Fa-f]*)[ \\t]*
MAPFILE_VAR_ADDRESS_2 = [ \\t]*$ MAPFILE_VAR_ADDRESS_2 = [ \\t]*$
MAPFILE_VAR_SIZE_1 = ^ MAPFILE_VAR_SIZE_1 = ^
MAPFILE_VAR_SIZE_2 = [ \\t]*(0x[0-9A-Fa-f]*)[ \\t]*[^ ]*[ \\t]*$ MAPFILE_VAR_SIZE_2 = [ \\t]*(0x[0-9A-Fa-f]*)[ \\t]*[^ ]*[ \\t]*$
COMMAND_VAR_NAME_ADDRESS = ^[ \t]*([0-9A-Fa-f][0-9A-Fa-f]*)[ \t]\\(__DATA,__[^ ]*\\) external _([^ ]*)$ COMMAND_VAR_NAME_ADDRESS = ^[ \t]*([0-9A-Fa-f][0-9A-Fa-f]*)[ \t]\\(__DATA,__[^ ]*\\) external _([^ ]*)$
COMMAND_DATA_START = ^DATA SECTION START\: 0x([0-9A-Fa-f]+)$ COMMAND_DATA_START = ^DATA SECTION START\: 0x([0-9A-Fa-f]+)$
COMMAND_DATA_END = ^DATA SECTION END\: 0x([0-9A-Fa-f]+)$ COMMAND_DATA_END = ^DATA SECTION END\: 0x([0-9A-Fa-f]+)$
COMMAND_BSS_START = ^COMMON SECTION START\: 0x([0-9A-Fa-f]+)$ COMMAND_BSS_START = ^COMMON SECTION START\: 0x([0-9A-Fa-f]+)$
COMMAND_BSS_END = ^COMMON SECTION END\: 0x([0-9A-Fa-f]+)$ COMMAND_BSS_END = ^COMMON SECTION END\: 0x([0-9A-Fa-f]+)$
COMMAND_COMMON_START = ^BSS SECTION START\: 0x([0-9A-Fa-f]+)$ COMMAND_COMMON_START = ^BSS SECTION START\: 0x([0-9A-Fa-f]+)$
COMMAND_COMMON_END = ^BSS SECTION END\: 0x([0-9A-Fa-f]+)$ COMMAND_COMMON_END = ^BSS SECTION END\: 0x([0-9A-Fa-f]+)$

View file

@ -1,25 +1,25 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="logfile" class="org.apache.log4j.FileAppender"> <appender name="logfile" class="org.apache.log4j.FileAppender">
<param name="File" value="COOJA.log"/> <param name="File" value="COOJA.log"/>
<param name="Append" value="false"/> <param name="Append" value="false"/>
<layout class="org.apache.log4j.PatternLayout"> <layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{HH:mm:ss} - %t] [%F:%L] [%p] - %m%n"/> <param name="ConversionPattern" value="[%d{HH:mm:ss} - %t] [%F:%L] [%p] - %m%n"/>
</layout> </layout>
</appender> </appender>
<appender name="stdout" class="org.apache.log4j.ConsoleAppender"> <appender name="stdout" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout"> <layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%5p [%t] (%F:%L) - %m%n"/> <param name="ConversionPattern" value="%5p [%t] (%F:%L) - %m%n"/>
</layout> </layout>
</appender> </appender>
<root> <root>
<priority value="debug"/> <priority value="debug"/>
<appender-ref ref="logfile"/> <appender-ref ref="logfile"/>
<appender-ref ref="stdout"/> <appender-ref ref="stdout"/>
</root> </root>
</log4j:configuration> </log4j:configuration>

View file

@ -1,78 +1,78 @@
se.sics.cooja.plugins.Visualizer = \ se.sics.cooja.plugins.Visualizer = \
<b>Visualizer</b> \ <b>Visualizer</b> \
<p>The visualizer shows the positions of simulated motes as viewed from above (XY-plane). \ <p>The visualizer shows the positions of simulated motes as viewed from above (XY-plane). \
It is possible to zoom (CRTL+Mouse drag) and pan (Shift+Mouse drag) the current view. Motes can be moved by dragging them (ALT+Mouse drag). \ It is possible to zoom (CRTL+Mouse drag) and pan (Shift+Mouse drag) the current view. Motes can be moved by dragging them (ALT+Mouse drag). \
Mouse right-click a mote or unoccupied space for a popup menu with more options. \ Mouse right-click a mote or unoccupied space for a popup menu with more options. \
<p>The visualizer supports "visualizer skins". \ <p>The visualizer supports "visualizer skins". \
Each skin provides some specific information, such as ongoing simulated radio traffic, or the IP addresses of motes. \ Each skin provides some specific information, such as ongoing simulated radio traffic, or the IP addresses of motes. \
Multiple skins can be active at the same time. \ Multiple skins can be active at the same time. \
Click the upper "Select visualizer skin" button to select or deselect skins. \ Click the upper "Select visualizer skin" button to select or deselect skins. \
<p><b>Useful skins</b> \ <p><b>Useful skins</b> \
<br>Mote IDs: prints the unique mote IDs inside motes. \ <br>Mote IDs: prints the unique mote IDs inside motes. \
<br>Log output: prints the last printf message above motes. \ <br>Log output: prints the last printf message above motes. \
<br>Radio traffic: displays inter-mote radio communication. \ <br>Radio traffic: displays inter-mote radio communication. \
<br>Radio environment (UDGM): enables configurating the UDGM radio medium. \ <br>Radio environment (UDGM): enables configurating the UDGM radio medium. \
<p><b>Tip</b><br> \ <p><b>Tip</b><br> \
Right-click visualizer to show the popup menu, and click "Hide window decorations". Right-click visualizer to show the popup menu, and click "Hide window decorations".
se.sics.cooja.plugins.LogListener = \ se.sics.cooja.plugins.LogListener = \
<b>Log Listener</b>\ <b>Log Listener</b>\
<p>Listens to log output from all simulated motes. \ <p>Listens to log output from all simulated motes. \
Right-click the main area for a popup menu with more options. \ Right-click the main area for a popup menu with more options. \
<p>You may filter shown logs by entering regular expressions in the bottom text field. \ <p>You may filter shown logs by entering regular expressions in the bottom text field. \
Filtering is performed on both the Mote and the Data columns.\ Filtering is performed on both the Mote and the Data columns.\
<p><b>Filter examples:</b> \ <p><b>Filter examples:</b> \
<br><br>Hello<br><i>logs containing the string 'Hello'</i>\ <br><br>Hello<br><i>logs containing the string 'Hello'</i>\
<br><br>^Contiki<br><i>logs starting with 'Contiki'</i>\ <br><br>^Contiki<br><i>logs starting with 'Contiki'</i>\
<br><br>^[CR]<br><i>logs starting either a C or an R</i>\ <br><br>^[CR]<br><i>logs starting either a C or an R</i>\
<br><br>Hello$<br><i>logs ending with 'Hello'</i>\ <br><br>Hello$<br><i>logs ending with 'Hello'</i>\
<br><br>^ID:[2-5]$<br><i>logs from motes 2 to 5</i>\ <br><br>^ID:[2-5]$<br><i>logs from motes 2 to 5</i>\
<br><br>^ID:[2-5] Contiki<br><i>logs from motes 2 to 5 starting with 'Contiki'</i> <br><br>^ID:[2-5] Contiki<br><i>logs from motes 2 to 5 starting with 'Contiki'</i>
se.sics.cooja.plugins.TimeLine = \ se.sics.cooja.plugins.TimeLine = \
<b>Timeline</b>\ <b>Timeline</b>\
<p>The timeline arranges historical simulation events into a graphical timeline. \ <p>The timeline arranges historical simulation events into a graphical timeline. \
The timeline can for example be used to overview the behavior of complex power-saving MAC protocols.\ The timeline can for example be used to overview the behavior of complex power-saving MAC protocols.\
<p>Events appear as colored rectangles in the timeline. For more information about a particular event, hover the mouse above it.\ <p>Events appear as colored rectangles in the timeline. For more information about a particular event, hover the mouse above it.\
<p>The checkboxes in the left pane control what event types are shown in the timeline. \ <p>The checkboxes in the left pane control what event types are shown in the timeline. \
Currently, four event types are supported (see below). Note that the control pane can be hidden to save space. \ Currently, four event types are supported (see below). Note that the control pane can be hidden to save space. \
<p>All simulated motes are by default added to the timeline, however, any unwanted motes can be removed by mouse clicking the node ID (left).\ <p>All simulated motes are by default added to the timeline, however, any unwanted motes can be removed by mouse clicking the node ID (left).\
<p>To display a vertical time marker on the timeline, press and hold the mouse on the time ruler (top).\ <p>To display a vertical time marker on the timeline, press and hold the mouse on the time ruler (top).\
<p>For more options, such as zooming and saving raw data to file, right-click the mouse for a popup menu.\ <p>For more options, such as zooming and saving raw data to file, right-click the mouse for a popup menu.\
<p><b>Radio RX/TX</b>\ <p><b>Radio RX/TX</b>\
<br>Shows radio connection events. Transmissions are painted blue, receptions are green, and interfered radios are red.\ <br>Shows radio connection events. Transmissions are painted blue, receptions are green, and interfered radios are red.\
<p><b>Radio ON/OFF</b>\ <p><b>Radio ON/OFF</b>\
<br>Shows whether the mote radio is on or off. Turned on radios are indicated with gray color.\ <br>Shows whether the mote radio is on or off. Turned on radios are indicated with gray color.\
<p><b>LEDs</b>\ <p><b>LEDs</b>\
<br>Shows LED state: red, green, and blue. (Assumes all mote types have exactly three LEDs.)\ <br>Shows LED state: red, green, and blue. (Assumes all mote types have exactly three LEDs.)\
<p><b>Watchpoints</b>\ <p><b>Watchpoints</b>\
<br>Shows triggered watchpoints, currently only supported by MSPSim-based motes. To add watchpoints, use the Msp Code Watcher plugin. <br>Shows triggered watchpoints, currently only supported by MSPSim-based motes. To add watchpoints, use the Msp Code Watcher plugin.
se.sics.cooja.plugins.SimControl = \ se.sics.cooja.plugins.SimControl = \
<b>Control Panel</b>\ <b>Control Panel</b>\
<p>Use the control panel to start and stop the current simulation. \ <p>Use the control panel to start and stop the current simulation. \
<p>Note that toggling simulation execution is also possible by the keyboard shortcut <i>Ctrl+S</i>. \ <p>Note that toggling simulation execution is also possible by the keyboard shortcut <i>Ctrl+S</i>. \
<p><i>Step millisecond</i> executes all events within the next simulated millisecond. \ <p><i>Step millisecond</i> executes all events within the next simulated millisecond. \
<p>The execution speed can be controlled via the bottom slider. \ <p>The execution speed can be controlled via the bottom slider. \
If the slider value is non-zero, sleep events are scheduled in the simulation loop. \ If the slider value is non-zero, sleep events are scheduled in the simulation loop. \
<p>By setting the slider to <i>Real time</i>, the execution speed is limited to at maximum real time. \ <p>By setting the slider to <i>Real time</i>, the execution speed is limited to at maximum real time. \
The <i>Real time</i> slider value is to the right of <i>No simulation delay</i>: select the slider button and use to keyboard to navigate here. \ The <i>Real time</i> slider value is to the right of <i>No simulation delay</i>: select the slider button and use to keyboard to navigate here. \
<p><i>Run until</i> can be used to configure a time (in milliseconds) where the simulation will automatically pause. <p><i>Run until</i> can be used to configure a time (in milliseconds) where the simulation will automatically pause.
se.sics.cooja.mspmote.plugins.MspCLI = \ se.sics.cooja.mspmote.plugins.MspCLI = \
<b>MSPSim's Command Line Interface</b>\ <b>MSPSim's Command Line Interface</b>\
<br><br>help<br><i>lists available commands</i>\ <br><br>help<br><i>lists available commands</i>\
<br><br>info CC2420<br><i>shows radio chip details</i>\ <br><br>info CC2420<br><i>shows radio chip details</i>\
<br><br>log CC2420 > mylog.txt<br><i>logs radio chip details to file</i>\ <br><br>log CC2420 > mylog.txt<br><i>logs radio chip details to file</i>\
<br><br>stacktrace<br><i>shows current stacktrace</i> <br><br>stacktrace<br><i>shows current stacktrace</i>
KEYBOARD_SHORTCUTS = \ KEYBOARD_SHORTCUTS = \
<b>Keyboard shortcuts</b><br>\ <b>Keyboard shortcuts</b><br>\
<br><i>Ctrl+N:</i> New simulation\ <br><i>Ctrl+N:</i> New simulation\
<br><i>Ctrl+S:</i> Start/pause simulation\ <br><i>Ctrl+S:</i> Start/pause simulation\
<br><i>Ctrl+R:</i> Reload current simulation. If no simulation exists, the last used simulation config is loaded\ <br><i>Ctrl+R:</i> Reload current simulation. If no simulation exists, the last used simulation config is loaded\
<br><i>Ctrl+Shift+R:</i> Reload current simulation with another random seed\ <br><i>Ctrl+Shift+R:</i> Reload current simulation with another random seed\
<br><i>Ctrl+X:</i> Quit COOJA\ <br><i>Ctrl+X:</i> Quit COOJA\
<br>\ <br>\
<br><i>F1:</i> Toggle quick help <br><i>F1:</i> Toggle quick help

View file

@ -1,28 +1,28 @@
/* /*
* Example Contiki test script (JavaScript). * Example Contiki test script (JavaScript).
* A Contiki test script acts on mote output, such as via printf()'s. * A Contiki test script acts on mote output, such as via printf()'s.
* The script may operate on the following variables: * The script may operate on the following variables:
* Mote mote, int id, String msg * Mote mote, int id, String msg
*/ */
/* Make test automatically fail (timeout) after 100 simulated seconds */ /* Make test automatically fail (timeout) after 100 simulated seconds */
//TIMEOUT(100000); /* milliseconds. no action at timeout */ //TIMEOUT(100000); /* milliseconds. no action at timeout */
TIMEOUT(100000, log.log("last msg: " + msg + "\n")); /* milliseconds. print last msg at timeout */ TIMEOUT(100000, log.log("last msg: " + msg + "\n")); /* milliseconds. print last msg at timeout */
log.log("first mote output: '" + msg + "'\n"); log.log("first mote output: '" + msg + "'\n");
YIELD(); /* wait for another mote output */ YIELD(); /* wait for another mote output */
log.log("second mote output: '" + msg + "'\n"); log.log("second mote output: '" + msg + "'\n");
log.log("waiting for hello world output from mote 1\n"); log.log("waiting for hello world output from mote 1\n");
WAIT_UNTIL(id == 1 && msg.equals("Hello, world")); WAIT_UNTIL(id == 1 && msg.equals("Hello, world"));
write(mote, "Hello, mote\n"); /* Write to mote serial port */ write(mote, "Hello, mote\n"); /* Write to mote serial port */
GENERATE_MSG(15000, "continue"); GENERATE_MSG(15000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue")); YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
log.log("ok, reporting success now\n"); log.log("ok, reporting success now\n");
log.testOK(); /* Report test success and quit */ log.testOK(); /* Report test success and quit */
//log.testFailed(); /* Report test failure and quit */ //log.testFailed(); /* Report test failure and quit */

View file

@ -1,11 +1,11 @@
/* /*
* Example Contiki test script (JavaScript). * Example Contiki test script (JavaScript).
* A Contiki test script acts on mote output, such as via printf()'s. * A Contiki test script acts on mote output, such as via printf()'s.
* The script may operate on the following variables: * The script may operate on the following variables:
* Mote mote, int id, String msg * Mote mote, int id, String msg
*/ */
TIMEOUT(2000, log.log("last message: " + msg + "\n")); TIMEOUT(2000, log.log("last message: " + msg + "\n"));
WAIT_UNTIL(msg.equals('Hello, world')); WAIT_UNTIL(msg.equals('Hello, world'));
log.testOK(); log.testOK();

View file

@ -1,13 +1,13 @@
/* /*
* Example Contiki test script (JavaScript). * Example Contiki test script (JavaScript).
* A Contiki test script acts on mote output, such as via printf()'s. * A Contiki test script acts on mote output, such as via printf()'s.
* The script may operate on the following variables: * The script may operate on the following variables:
* Mote mote, int id, String msg * Mote mote, int id, String msg
*/ */
TIMEOUT(60000); TIMEOUT(60000);
while (true) { while (true) {
log.log(time + ":" + id + ":" + msg + "\n"); log.log(time + ":" + id + ":" + msg + "\n");
YIELD(); YIELD();
} }

View file

@ -1,50 +1,50 @@
/* /*
* Example showing how to reference and interact with surrounding * Example showing how to reference and interact with surrounding
* COOJA plugins from a test script. * COOJA plugins from a test script.
* The code looks up three common plugins and, if found, performs some * The code looks up three common plugins and, if found, performs some
* simple plugin-specific task. * simple plugin-specific task.
*/ */
/* Started plugins are available from the GUI object */ /* Started plugins are available from the GUI object */
while (true) { while (true) {
GENERATE_MSG(1000, "wait"); GENERATE_MSG(1000, "wait");
YIELD_THEN_WAIT_UNTIL(msg.equals("wait")); YIELD_THEN_WAIT_UNTIL(msg.equals("wait"));
/* Toggle Log Listener filter */ /* Toggle Log Listener filter */
plugin = mote.getSimulation().getGUI().getStartedPlugin("se.sics.cooja.plugins.LogListener"); plugin = mote.getSimulation().getGUI().getStartedPlugin("se.sics.cooja.plugins.LogListener");
if (plugin != null) { if (plugin != null) {
log.log("LogListener: Setting filter: " + plugin.getFilter() + "\n"); log.log("LogListener: Setting filter: " + plugin.getFilter() + "\n");
if (plugin.getFilter() == null || !plugin.getFilter().equals("Contiki")) { if (plugin.getFilter() == null || !plugin.getFilter().equals("Contiki")) {
plugin.setFilter("Contiki"); plugin.setFilter("Contiki");
} else { } else {
plugin.setFilter("MAC"); plugin.setFilter("MAC");
} }
} }
GENERATE_MSG(1000, "wait"); GENERATE_MSG(1000, "wait");
YIELD_THEN_WAIT_UNTIL(msg.equals("wait")); YIELD_THEN_WAIT_UNTIL(msg.equals("wait"));
/* Extract Timeline statistics */ /* Extract Timeline statistics */
plugin = mote.getSimulation().getGUI().getStartedPlugin("se.sics.cooja.plugins.TimeLine"); plugin = mote.getSimulation().getGUI().getStartedPlugin("se.sics.cooja.plugins.TimeLine");
if (plugin != null) { if (plugin != null) {
stats = plugin.extractStatistics(); stats = plugin.extractStatistics();
if (stats.length() > 40) { if (stats.length() > 40) {
/* Stripping */ /* Stripping */
stats = stats.substring(0, 40) + "..."; stats = stats.substring(0, 40) + "...";
} }
log.log("Timeline: Extracted statistics:\n" + stats + "\n"); log.log("Timeline: Extracted statistics:\n" + stats + "\n");
} }
GENERATE_MSG(1000, "wait"); GENERATE_MSG(1000, "wait");
YIELD_THEN_WAIT_UNTIL(msg.equals("wait")); YIELD_THEN_WAIT_UNTIL(msg.equals("wait"));
/* Select time in Radio Logger */ /* Select time in Radio Logger */
plugin = mote.getSimulation().getGUI().getStartedPlugin("se.sics.cooja.plugins.RadioLogger"); plugin = mote.getSimulation().getGUI().getStartedPlugin("se.sics.cooja.plugins.RadioLogger");
if (plugin != null) { if (plugin != null) {
log.log("RadioLogger: Showing logged radio packet at mid simulation\n"); log.log("RadioLogger: Showing logged radio packet at mid simulation\n");
plugin.trySelectTime(time/2); plugin.trySelectTime(time/2);
} }
} }

View file

@ -1,27 +1,27 @@
/* /*
* Example Contiki test script (JavaScript). * Example Contiki test script (JavaScript).
* A Contiki test script acts on mote output, such as via printf()'s. * A Contiki test script acts on mote output, such as via printf()'s.
* The script may operate on the following variables: * The script may operate on the following variables:
* Mote mote, int id, String msg * Mote mote, int id, String msg
*/ */
/* Wait until node has booted */ /* Wait until node has booted */
WAIT_UNTIL(msg.startsWith('Starting')); WAIT_UNTIL(msg.startsWith('Starting'));
log.log("Mote started\n"); log.log("Mote started\n");
mymote = mote; /* store mote reference */ mymote = mote; /* store mote reference */
/* Wait 3 seconds (3000ms) */ /* Wait 3 seconds (3000ms) */
GENERATE_MSG(3000, "continue"); GENERATE_MSG(3000, "continue");
YIELD_THEN_WAIT_UNTIL(msg.equals("continue")); YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
/* Write command to serial port */ /* Write command to serial port */
log.log("Writing 'ls' to mote serial port\n"); log.log("Writing 'ls' to mote serial port\n");
write(mymote, "ls"); write(mymote, "ls");
/* Read replies */ /* Read replies */
while (true) { while (true) {
YIELD(); YIELD();
if (mote == mymote) { if (mote == mymote) {
log.log("Mote replied: " + msg + "\n"); log.log("Mote replied: " + msg + "\n");
} }
} }

View file

@ -1,89 +1,89 @@
/* /*
* Copyright (c) 2006, Swedish Institute of Computer Science. * Copyright (c) 2006, Swedish Institute of Computer Science.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
* are met: * are met:
* 1. Redistributions of source code must retain the above copyright * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright * 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors * 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: test_template.c,v 1.1 2009/02/20 16:59:52 fros4943 Exp $ * $Id: test_template.c,v 1.1 2009/02/20 16:59:52 fros4943 Exp $
*/ */
#include <jni.h> #include <jni.h>
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
const struct simInterface *simInterfaces[] = {NULL}; const struct simInterface *simInterfaces[] = {NULL};
long ref_var; /* Placed somewhere in the BSS section */ long ref_var; /* Placed somewhere in the BSS section */
/* Variables with known memory addresses */ /* Variables with known memory addresses */
int var1=1; int var1=1;
int var2=2; int var2=2;
int var3=2; int var3=2;
int arr1[10]; int arr1[10];
int arr2[10]; int arr2[10];
int uvar1; int uvar1;
int uvar2; int uvar2;
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_se_sics_cooja_corecomm_[CLASS_NAME]_init(JNIEnv *env, jobject obj) Java_se_sics_cooja_corecomm_[CLASS_NAME]_init(JNIEnv *env, jobject obj)
{ {
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_se_sics_cooja_corecomm_[CLASS_NAME]_getMemory(JNIEnv *env, jobject obj, jint rel_addr, jint length, jbyteArray mem_arr) Java_se_sics_cooja_corecomm_[CLASS_NAME]_getMemory(JNIEnv *env, jobject obj, jint rel_addr, jint length, jbyteArray mem_arr)
{ {
(*env)->SetByteArrayRegion( (*env)->SetByteArrayRegion(
env, env,
mem_arr, mem_arr,
0, 0,
(size_t) length, (size_t) length,
(jbyte *) (((long)rel_addr) + ref_var) (jbyte *) (((long)rel_addr) + ref_var)
); );
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_se_sics_cooja_corecomm_[CLASS_NAME]_setMemory(JNIEnv *env, jobject obj, jint rel_addr, jint length, jbyteArray mem_arr) Java_se_sics_cooja_corecomm_[CLASS_NAME]_setMemory(JNIEnv *env, jobject obj, jint rel_addr, jint length, jbyteArray mem_arr)
{ {
jbyte *mem = (*env)->GetByteArrayElements(env, mem_arr, 0); jbyte *mem = (*env)->GetByteArrayElements(env, mem_arr, 0);
memcpy( memcpy(
(char*) (((long)rel_addr) + ref_var), (char*) (((long)rel_addr) + ref_var),
mem, mem,
length); length);
(*env)->ReleaseByteArrayElements(env, mem_arr, mem, 0); (*env)->ReleaseByteArrayElements(env, mem_arr, mem, 0);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_se_sics_cooja_corecomm_[CLASS_NAME]_tick(JNIEnv *env, jobject obj) Java_se_sics_cooja_corecomm_[CLASS_NAME]_tick(JNIEnv *env, jobject obj)
{ {
++var1; ++var1;
++uvar1; ++uvar1;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
JNIEXPORT void JNICALL JNIEXPORT void JNICALL
Java_se_sics_cooja_corecomm_[CLASS_NAME]_setReferenceAddress(JNIEnv *env, jobject obj, jint addr) Java_se_sics_cooja_corecomm_[CLASS_NAME]_setReferenceAddress(JNIEnv *env, jobject obj, jint addr)
{ {
ref_var = (((long)&ref_var) - ((long)addr)); ref_var = (((long)&ref_var) - ((long)addr));
} }

View file

@ -1,125 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<simconf> <simconf>
<project>[CONTIKI_DIR]/tools/cooja/apps/mrm</project> <project>[CONTIKI_DIR]/tools/cooja/apps/mrm</project>
<project>[CONTIKI_DIR]/tools/cooja/apps/mspsim</project> <project>[CONTIKI_DIR]/tools/cooja/apps/mspsim</project>
<project>[CONTIKI_DIR]/tools/cooja/apps/avrora</project> <project>[CONTIKI_DIR]/tools/cooja/apps/avrora</project>
<simulation> <simulation>
<title>My simulation</title> <title>My simulation</title>
<delaytime>0</delaytime> <delaytime>0</delaytime>
<randomseed>generated</randomseed> <randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us> <motedelay_us>1000000</motedelay_us>
<radiomedium> <radiomedium>
se.sics.cooja.radiomediums.UDGM se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range> <transmitting_range>50.0</transmitting_range>
<interference_range>100.0</interference_range> <interference_range>100.0</interference_range>
<success_ratio_tx>1.0</success_ratio_tx> <success_ratio_tx>1.0</success_ratio_tx>
<success_ratio_rx>1.0</success_ratio_rx> <success_ratio_rx>1.0</success_ratio_rx>
</radiomedium> </radiomedium>
<events> <events>
<logoutput>40000</logoutput> <logoutput>40000</logoutput>
</events> </events>
<motetype> <motetype>
se.sics.cooja.mspmote.ESBMoteType se.sics.cooja.mspmote.ESBMoteType
<identifier>esb1</identifier> <identifier>esb1</identifier>
<description>ESB Mote Type #esb1</description> <description>ESB Mote Type #esb1</description>
<source>[CONTIKI_DIR]/examples/hello-world/hello-world.c</source> <source>[CONTIKI_DIR]/examples/hello-world/hello-world.c</source>
<commands>make clean TARGET=esb <commands>make clean TARGET=esb
make hello-world.esb TARGET=esb</commands> make hello-world.esb TARGET=esb</commands>
<firmware>[CONTIKI_DIR]/examples/hello-world/hello-world.esb</firmware> <firmware>[CONTIKI_DIR]/examples/hello-world/hello-world.esb</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface> <moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface> <moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface> <moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.ESBLED</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.ESBLED</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.ESBButton</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.ESBButton</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.TR1001Radio</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.TR1001Radio</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface> <moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
</motetype> </motetype>
<mote> <mote>
se.sics.cooja.mspmote.ESBMote se.sics.cooja.mspmote.ESBMote
<breakpoints /> <breakpoints />
<interface_config> <interface_config>
se.sics.cooja.interfaces.Position se.sics.cooja.interfaces.Position
<x>57.296459690977144</x> <x>57.296459690977144</x>
<y>73.20759478605089</y> <y>73.20759478605089</y>
<z>0.0</z> <z>0.0</z>
</interface_config> </interface_config>
<interface_config> <interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID se.sics.cooja.mspmote.interfaces.MspMoteID
<id>1</id> <id>1</id>
</interface_config> </interface_config>
<motetype_identifier>esb1</motetype_identifier> <motetype_identifier>esb1</motetype_identifier>
</mote> </mote>
</simulation> </simulation>
<plugin> <plugin>
se.sics.cooja.plugins.SimControl se.sics.cooja.plugins.SimControl
<width>259</width> <width>259</width>
<z>6</z> <z>6</z>
<height>184</height> <height>184</height>
<location_x>60</location_x> <location_x>60</location_x>
<location_y>60</location_y> <location_y>60</location_y>
<minimized>false</minimized> <minimized>false</minimized>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.Visualizer se.sics.cooja.plugins.Visualizer
<plugin_config> <plugin_config>
<skin>se.sics.cooja.plugins.skins.IDVisualizerSkin</skin> <skin>se.sics.cooja.plugins.skins.IDVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.LogVisualizerSkin</skin> <skin>se.sics.cooja.plugins.skins.LogVisualizerSkin</skin>
<viewport>0.9090909090909091 0.0 0.0 0.9090909090909091 91.91230937183896 53.4476411035901</viewport> <viewport>0.9090909090909091 0.0 0.0 0.9090909090909091 91.91230937183896 53.4476411035901</viewport>
</plugin_config> </plugin_config>
<width>300</width> <width>300</width>
<z>3</z> <z>3</z>
<height>300</height> <height>300</height>
<location_x>945</location_x> <location_x>945</location_x>
<location_y>0</location_y> <location_y>0</location_y>
<minimized>false</minimized> <minimized>false</minimized>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.LogListener se.sics.cooja.plugins.LogListener
<plugin_config> <plugin_config>
<filter /> <filter />
</plugin_config> </plugin_config>
<width>1245</width> <width>1245</width>
<z>5</z> <z>5</z>
<height>150</height> <height>150</height>
<location_x>0</location_x> <location_x>0</location_x>
<location_y>530</location_y> <location_y>530</location_y>
<minimized>false</minimized> <minimized>false</minimized>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.TimeLine se.sics.cooja.plugins.TimeLine
<plugin_config> <plugin_config>
<mote>0</mote> <mote>0</mote>
<showRadioRXTX /> <showRadioRXTX />
<showRadioHW /> <showRadioHW />
<showLEDs /> <showLEDs />
<split>109</split> <split>109</split>
<zoom>9</zoom> <zoom>9</zoom>
</plugin_config> </plugin_config>
<width>1245</width> <width>1245</width>
<z>1</z> <z>1</z>
<height>150</height> <height>150</height>
<location_x>0</location_x> <location_x>0</location_x>
<location_y>680</location_y> <location_y>680</location_y>
<minimized>false</minimized> <minimized>false</minimized>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.ScriptRunner se.sics.cooja.plugins.ScriptRunner
<plugin_config> <plugin_config>
<script>TIMEOUT(5000, log.log("last message: " + msg + "\n")); <script>TIMEOUT(5000, log.log("last message: " + msg + "\n"));
WAIT_UNTIL(msg.equals('Hello, world')); WAIT_UNTIL(msg.equals('Hello, world'));
log.testOK();</script> log.testOK();</script>
<active>true</active> <active>true</active>
</plugin_config> </plugin_config>
<width>600</width> <width>600</width>
<z>0</z> <z>0</z>
<height>453</height> <height>453</height>
<location_x>337</location_x> <location_x>337</location_x>
<location_y>25</location_y> <location_y>25</location_y>
<minimized>false</minimized> <minimized>false</minimized>
</plugin> </plugin>
</simconf> </simconf>

View file

@ -1,316 +1,316 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<simconf> <simconf>
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/mrm</project> <project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/mrm</project>
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/mspsim</project> <project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/mspsim</project>
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/avrora</project> <project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/avrora</project>
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/native_gateway</project> <project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/native_gateway</project>
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/serial_socket</project> <project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/serial_socket</project>
<project EXPORT="discard">/home/user/contikiprojects/sics.se/mobility</project> <project EXPORT="discard">/home/user/contikiprojects/sics.se/mobility</project>
<simulation> <simulation>
<title>Servreg hack test</title> <title>Servreg hack test</title>
<delaytime>0</delaytime> <delaytime>0</delaytime>
<randomseed>123456</randomseed> <randomseed>123456</randomseed>
<motedelay_us>1000000</motedelay_us> <motedelay_us>1000000</motedelay_us>
<radiomedium> <radiomedium>
se.sics.cooja.radiomediums.UDGM se.sics.cooja.radiomediums.UDGM
<transmitting_range>40.0</transmitting_range> <transmitting_range>40.0</transmitting_range>
<interference_range>40.0</interference_range> <interference_range>40.0</interference_range>
<success_ratio_tx>1.0</success_ratio_tx> <success_ratio_tx>1.0</success_ratio_tx>
<success_ratio_rx>1.0</success_ratio_rx> <success_ratio_rx>1.0</success_ratio_rx>
</radiomedium> </radiomedium>
<events> <events>
<logoutput>40000</logoutput> <logoutput>40000</logoutput>
</events> </events>
<motetype> <motetype>
se.sics.cooja.mspmote.SkyMoteType se.sics.cooja.mspmote.SkyMoteType
<identifier>sky1</identifier> <identifier>sky1</identifier>
<description>Servreg server</description> <description>Servreg server</description>
<source EXPORT="discard">[CONTIKI_DIR]/examples/servreg-hack/example-servreg-server.c</source> <source EXPORT="discard">[CONTIKI_DIR]/examples/servreg-hack/example-servreg-server.c</source>
<commands EXPORT="discard">make example-servreg-server.sky TARGET=sky</commands> <commands EXPORT="discard">make example-servreg-server.sky TARGET=sky</commands>
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/servreg-hack/example-servreg-server.sky</firmware> <firmware EXPORT="copy">[CONTIKI_DIR]/examples/servreg-hack/example-servreg-server.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface> <moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface> <moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface> <moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface> <moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.interfaces.MoteAttributes</moteinterface> <moteinterface>se.sics.cooja.interfaces.MoteAttributes</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyCoffeeFilesystem</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyCoffeeFilesystem</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspDebugOutput</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspDebugOutput</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyTemperature</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyTemperature</moteinterface>
</motetype> </motetype>
<motetype> <motetype>
se.sics.cooja.mspmote.SkyMoteType se.sics.cooja.mspmote.SkyMoteType
<identifier>sky2</identifier> <identifier>sky2</identifier>
<description>Servreg hack client</description> <description>Servreg hack client</description>
<source EXPORT="discard">[CONTIKI_DIR]/examples/servreg-hack/example-servreg-client.c</source> <source EXPORT="discard">[CONTIKI_DIR]/examples/servreg-hack/example-servreg-client.c</source>
<commands EXPORT="discard">make example-servreg-client.sky TARGET=sky</commands> <commands EXPORT="discard">make example-servreg-client.sky TARGET=sky</commands>
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/servreg-hack/example-servreg-client.sky</firmware> <firmware EXPORT="copy">[CONTIKI_DIR]/examples/servreg-hack/example-servreg-client.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface> <moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface> <moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface> <moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface> <moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.interfaces.MoteAttributes</moteinterface> <moteinterface>se.sics.cooja.interfaces.MoteAttributes</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyCoffeeFilesystem</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyCoffeeFilesystem</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspDebugOutput</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspDebugOutput</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyTemperature</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyTemperature</moteinterface>
</motetype> </motetype>
<mote> <mote>
<breakpoints /> <breakpoints />
<interface_config> <interface_config>
se.sics.cooja.interfaces.Position se.sics.cooja.interfaces.Position
<x>45.693987609497896</x> <x>45.693987609497896</x>
<y>26.353051242505675</y> <y>26.353051242505675</y>
<z>0.0</z> <z>0.0</z>
</interface_config> </interface_config>
<interface_config> <interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID se.sics.cooja.mspmote.interfaces.MspMoteID
<id>1</id> <id>1</id>
</interface_config> </interface_config>
<motetype_identifier>sky1</motetype_identifier> <motetype_identifier>sky1</motetype_identifier>
</mote> </mote>
<mote> <mote>
<breakpoints /> <breakpoints />
<interface_config> <interface_config>
se.sics.cooja.interfaces.Position se.sics.cooja.interfaces.Position
<x>18.451397050087735</x> <x>18.451397050087735</x>
<y>55.93074152489276</y> <y>55.93074152489276</y>
<z>0.0</z> <z>0.0</z>
</interface_config> </interface_config>
<interface_config> <interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID se.sics.cooja.mspmote.interfaces.MspMoteID
<id>2</id> <id>2</id>
</interface_config> </interface_config>
<motetype_identifier>sky2</motetype_identifier> <motetype_identifier>sky2</motetype_identifier>
</mote> </mote>
<mote> <mote>
<breakpoints /> <breakpoints />
<interface_config> <interface_config>
se.sics.cooja.interfaces.Position se.sics.cooja.interfaces.Position
<x>45.082598269523864</x> <x>45.082598269523864</x>
<y>52.7178388400784</y> <y>52.7178388400784</y>
<z>0.0</z> <z>0.0</z>
</interface_config> </interface_config>
<interface_config> <interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID se.sics.cooja.mspmote.interfaces.MspMoteID
<id>3</id> <id>3</id>
</interface_config> </interface_config>
<motetype_identifier>sky2</motetype_identifier> <motetype_identifier>sky2</motetype_identifier>
</mote> </mote>
<mote> <mote>
<breakpoints /> <breakpoints />
<interface_config> <interface_config>
se.sics.cooja.interfaces.Position se.sics.cooja.interfaces.Position
<x>11.116935333105516</x> <x>11.116935333105516</x>
<y>49.070534908051414</y> <y>49.070534908051414</y>
<z>0.0</z> <z>0.0</z>
</interface_config> </interface_config>
<interface_config> <interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID se.sics.cooja.mspmote.interfaces.MspMoteID
<id>4</id> <id>4</id>
</interface_config> </interface_config>
<motetype_identifier>sky2</motetype_identifier> <motetype_identifier>sky2</motetype_identifier>
</mote> </mote>
<mote> <mote>
<breakpoints /> <breakpoints />
<interface_config> <interface_config>
se.sics.cooja.interfaces.Position se.sics.cooja.interfaces.Position
<x>85.11866272622683</x> <x>85.11866272622683</x>
<y>30.030092430999066</y> <y>30.030092430999066</y>
<z>0.0</z> <z>0.0</z>
</interface_config> </interface_config>
<interface_config> <interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID se.sics.cooja.mspmote.interfaces.MspMoteID
<id>5</id> <id>5</id>
</interface_config> </interface_config>
<motetype_identifier>sky2</motetype_identifier> <motetype_identifier>sky2</motetype_identifier>
</mote> </mote>
<mote> <mote>
<breakpoints /> <breakpoints />
<interface_config> <interface_config>
se.sics.cooja.interfaces.Position se.sics.cooja.interfaces.Position
<x>30.71302161006234</x> <x>30.71302161006234</x>
<y>13.877842534368446</y> <y>13.877842534368446</y>
<z>0.0</z> <z>0.0</z>
</interface_config> </interface_config>
<interface_config> <interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID se.sics.cooja.mspmote.interfaces.MspMoteID
<id>6</id> <id>6</id>
</interface_config> </interface_config>
<motetype_identifier>sky2</motetype_identifier> <motetype_identifier>sky2</motetype_identifier>
</mote> </mote>
<mote> <mote>
<breakpoints /> <breakpoints />
<interface_config> <interface_config>
se.sics.cooja.interfaces.Position se.sics.cooja.interfaces.Position
<x>44.43705509785284</x> <x>44.43705509785284</x>
<y>69.81167027376168</y> <y>69.81167027376168</y>
<z>0.0</z> <z>0.0</z>
</interface_config> </interface_config>
<interface_config> <interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID se.sics.cooja.mspmote.interfaces.MspMoteID
<id>7</id> <id>7</id>
</interface_config> </interface_config>
<motetype_identifier>sky2</motetype_identifier> <motetype_identifier>sky2</motetype_identifier>
</mote> </mote>
<mote> <mote>
<breakpoints /> <breakpoints />
<interface_config> <interface_config>
se.sics.cooja.interfaces.Position se.sics.cooja.interfaces.Position
<x>64.10992023465046</x> <x>64.10992023465046</x>
<y>20.589540162635835</y> <y>20.589540162635835</y>
<z>0.0</z> <z>0.0</z>
</interface_config> </interface_config>
<interface_config> <interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID se.sics.cooja.mspmote.interfaces.MspMoteID
<id>8</id> <id>8</id>
</interface_config> </interface_config>
<motetype_identifier>sky2</motetype_identifier> <motetype_identifier>sky2</motetype_identifier>
</mote> </mote>
<mote> <mote>
<breakpoints /> <breakpoints />
<interface_config> <interface_config>
se.sics.cooja.interfaces.Position se.sics.cooja.interfaces.Position
<x>32.29787406276132</x> <x>32.29787406276132</x>
<y>18.754900913594753</y> <y>18.754900913594753</y>
<z>0.0</z> <z>0.0</z>
</interface_config> </interface_config>
<interface_config> <interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID se.sics.cooja.mspmote.interfaces.MspMoteID
<id>9</id> <id>9</id>
</interface_config> </interface_config>
<motetype_identifier>sky2</motetype_identifier> <motetype_identifier>sky2</motetype_identifier>
</mote> </mote>
<mote> <mote>
<breakpoints /> <breakpoints />
<interface_config> <interface_config>
se.sics.cooja.interfaces.Position se.sics.cooja.interfaces.Position
<x>25.28398611019028</x> <x>25.28398611019028</x>
<y>69.27186586570369</y> <y>69.27186586570369</y>
<z>0.0</z> <z>0.0</z>
</interface_config> </interface_config>
<interface_config> <interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID se.sics.cooja.mspmote.interfaces.MspMoteID
<id>10</id> <id>10</id>
</interface_config> </interface_config>
<motetype_identifier>sky2</motetype_identifier> <motetype_identifier>sky2</motetype_identifier>
</mote> </mote>
<mote> <mote>
<breakpoints /> <breakpoints />
<interface_config> <interface_config>
se.sics.cooja.interfaces.Position se.sics.cooja.interfaces.Position
<x>19.3359466030565</x> <x>19.3359466030565</x>
<y>17.321986704081503</y> <y>17.321986704081503</y>
<z>0.0</z> <z>0.0</z>
</interface_config> </interface_config>
<interface_config> <interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID se.sics.cooja.mspmote.interfaces.MspMoteID
<id>11</id> <id>11</id>
</interface_config> </interface_config>
<motetype_identifier>sky2</motetype_identifier> <motetype_identifier>sky2</motetype_identifier>
</mote> </mote>
</simulation> </simulation>
<plugin> <plugin>
se.sics.cooja.plugins.SimControl se.sics.cooja.plugins.SimControl
<width>318</width> <width>318</width>
<z>1</z> <z>1</z>
<height>172</height> <height>172</height>
<location_x>0</location_x> <location_x>0</location_x>
<location_y>0</location_y> <location_y>0</location_y>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.Visualizer se.sics.cooja.plugins.Visualizer
<plugin_config> <plugin_config>
<skin>se.sics.cooja.plugins.skins.IDVisualizerSkin</skin> <skin>se.sics.cooja.plugins.skins.IDVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.MoteTypeVisualizerSkin</skin> <skin>se.sics.cooja.plugins.skins.MoteTypeVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.AttributeVisualizerSkin</skin> <skin>se.sics.cooja.plugins.skins.AttributeVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.UDGMVisualizerSkin</skin> <skin>se.sics.cooja.plugins.skins.UDGMVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.GridVisualizerSkin</skin> <skin>se.sics.cooja.plugins.skins.GridVisualizerSkin</skin>
<viewport>3.56257040103728 0.0 0.0 3.56257040103728 -26.423046586149052 -28.07489060373735</viewport> <viewport>3.56257040103728 0.0 0.0 3.56257040103728 -26.423046586149052 -28.07489060373735</viewport>
</plugin_config> </plugin_config>
<width>300</width> <width>300</width>
<z>2</z> <z>2</z>
<height>300</height> <height>300</height>
<location_x>1140</location_x> <location_x>1140</location_x>
<location_y>0</location_y> <location_y>0</location_y>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.LogListener se.sics.cooja.plugins.LogListener
<plugin_config> <plugin_config>
<filter /> <filter />
</plugin_config> </plugin_config>
<width>1440</width> <width>1440</width>
<z>3</z> <z>3</z>
<height>324</height> <height>324</height>
<location_x>2</location_x> <location_x>2</location_x>
<location_y>270</location_y> <location_y>270</location_y>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.TimeLine se.sics.cooja.plugins.TimeLine
<plugin_config> <plugin_config>
<mote>0</mote> <mote>0</mote>
<mote>1</mote> <mote>1</mote>
<mote>2</mote> <mote>2</mote>
<mote>3</mote> <mote>3</mote>
<mote>4</mote> <mote>4</mote>
<mote>5</mote> <mote>5</mote>
<mote>6</mote> <mote>6</mote>
<mote>7</mote> <mote>7</mote>
<mote>8</mote> <mote>8</mote>
<mote>9</mote> <mote>9</mote>
<mote>10</mote> <mote>10</mote>
<showRadioRXTX /> <showRadioRXTX />
<showRadioHW /> <showRadioHW />
<split>125</split> <split>125</split>
<zoomfactor>1633.2339825135305</zoomfactor> <zoomfactor>1633.2339825135305</zoomfactor>
</plugin_config> </plugin_config>
<width>1440</width> <width>1440</width>
<z>4</z> <z>4</z>
<height>238</height> <height>238</height>
<location_x>0</location_x> <location_x>0</location_x>
<location_y>595</location_y> <location_y>595</location_y>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.ScriptRunner se.sics.cooja.plugins.ScriptRunner
<plugin_config> <plugin_config>
<script>/* <script>/*
* Example Contiki test script (JavaScript). * Example Contiki test script (JavaScript).
* A Contiki test script acts on mote output, such as via printf()'s. * A Contiki test script acts on mote output, such as via printf()'s.
* The script may operate on the following variables: * The script may operate on the following variables:
* Mote mote, int id, String msg * Mote mote, int id, String msg
*/ */
TIMEOUT(120000); TIMEOUT(120000);
num = 0; num = 0;
while(true) { while(true) {
YIELD(); YIELD();
WAIT_UNTIL(msg.startsWith('Id')); WAIT_UNTIL(msg.startsWith('Id'));
num++; num++;
if(num == 9) { if(num == 9) {
log.testOK(); log.testOK();
} }
}</script> }</script>
<active>true</active> <active>true</active>
</plugin_config> </plugin_config>
<width>600</width> <width>600</width>
<z>0</z> <z>0</z>
<height>700</height> <height>700</height>
<location_x>526</location_x> <location_x>526</location_x>
<location_y>6</location_y> <location_y>6</location_y>
</plugin> </plugin>
</simconf> </simconf>

File diff suppressed because it is too large Load diff

View file

@ -1,147 +1,147 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<simconf> <simconf>
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/mrm</project> <project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/mrm</project>
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/mspsim</project> <project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/mspsim</project>
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/avrora</project> <project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/avrora</project>
<simulation> <simulation>
<title>My simulation</title> <title>My simulation</title>
<delaytime>0</delaytime> <delaytime>0</delaytime>
<randomseed>generated</randomseed> <randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us> <motedelay_us>1000000</motedelay_us>
<radiomedium> <radiomedium>
se.sics.cooja.radiomediums.UDGM se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range> <transmitting_range>50.0</transmitting_range>
<interference_range>100.0</interference_range> <interference_range>100.0</interference_range>
<success_ratio_tx>1.0</success_ratio_tx> <success_ratio_tx>1.0</success_ratio_tx>
<success_ratio_rx>1.0</success_ratio_rx> <success_ratio_rx>1.0</success_ratio_rx>
</radiomedium> </radiomedium>
<events> <events>
<logoutput>40000</logoutput> <logoutput>40000</logoutput>
</events> </events>
<motetype> <motetype>
se.sics.cooja.mspmote.SkyMoteType se.sics.cooja.mspmote.SkyMoteType
<identifier>sky1</identifier> <identifier>sky1</identifier>
<description>Sky Mote Type #1</description> <description>Sky Mote Type #1</description>
<source EXPORT="discard">[CONTIKI_DIR]/examples/udp-ipv6/udp-client.c</source> <source EXPORT="discard">[CONTIKI_DIR]/examples/udp-ipv6/udp-client.c</source>
<commands EXPORT="discard">make clean TARGET=sky <commands EXPORT="discard">make clean TARGET=sky
make udp-client.sky TARGET=sky DEFINES=UDP_CONNECTION_ADDR=fe80::212:7402:2:202</commands> make udp-client.sky TARGET=sky DEFINES=UDP_CONNECTION_ADDR=fe80::212:7402:2:202</commands>
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/udp-ipv6/udp-client.sky</firmware> <firmware EXPORT="copy">[CONTIKI_DIR]/examples/udp-ipv6/udp-client.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface> <moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface> <moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface> <moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface>
</motetype> </motetype>
<motetype> <motetype>
se.sics.cooja.mspmote.SkyMoteType se.sics.cooja.mspmote.SkyMoteType
<identifier>sky2</identifier> <identifier>sky2</identifier>
<description>Sky Mote Type #2</description> <description>Sky Mote Type #2</description>
<source EXPORT="discard">[CONTIKI_DIR]/examples/udp-ipv6/udp-server.c</source> <source EXPORT="discard">[CONTIKI_DIR]/examples/udp-ipv6/udp-server.c</source>
<commands EXPORT="discard">make udp-server.sky TARGET=sky</commands> <commands EXPORT="discard">make udp-server.sky TARGET=sky</commands>
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/udp-ipv6/udp-server.sky</firmware> <firmware EXPORT="copy">[CONTIKI_DIR]/examples/udp-ipv6/udp-server.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface> <moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface> <moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface> <moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface>
</motetype> </motetype>
<mote> <mote>
<breakpoints /> <breakpoints />
<interface_config> <interface_config>
se.sics.cooja.interfaces.Position se.sics.cooja.interfaces.Position
<x>65.934608127183</x> <x>65.934608127183</x>
<y>63.70462190529231</y> <y>63.70462190529231</y>
<z>0.0</z> <z>0.0</z>
</interface_config> </interface_config>
<interface_config> <interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID se.sics.cooja.mspmote.interfaces.MspMoteID
<id>1</id> <id>1</id>
</interface_config> </interface_config>
<motetype_identifier>sky1</motetype_identifier> <motetype_identifier>sky1</motetype_identifier>
</mote> </mote>
<mote> <mote>
<breakpoints /> <breakpoints />
<interface_config> <interface_config>
se.sics.cooja.interfaces.Position se.sics.cooja.interfaces.Position
<x>67.66105781539623</x> <x>67.66105781539623</x>
<y>63.13924301161143</y> <y>63.13924301161143</y>
<z>0.0</z> <z>0.0</z>
</interface_config> </interface_config>
<interface_config> <interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID se.sics.cooja.mspmote.interfaces.MspMoteID
<id>2</id> <id>2</id>
</interface_config> </interface_config>
<motetype_identifier>sky2</motetype_identifier> <motetype_identifier>sky2</motetype_identifier>
</mote> </mote>
</simulation> </simulation>
<plugin> <plugin>
se.sics.cooja.plugins.SimControl se.sics.cooja.plugins.SimControl
<width>248</width> <width>248</width>
<z>0</z> <z>0</z>
<height>200</height> <height>200</height>
<location_x>0</location_x> <location_x>0</location_x>
<location_y>0</location_y> <location_y>0</location_y>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.LogListener se.sics.cooja.plugins.LogListener
<plugin_config> <plugin_config>
<filter /> <filter />
</plugin_config> </plugin_config>
<width>816</width> <width>816</width>
<z>3</z> <z>3</z>
<height>333</height> <height>333</height>
<location_x>1</location_x> <location_x>1</location_x>
<location_y>365</location_y> <location_y>365</location_y>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.Visualizer se.sics.cooja.plugins.Visualizer
<plugin_config> <plugin_config>
<skin>se.sics.cooja.plugins.skins.IDVisualizerSkin</skin> <skin>se.sics.cooja.plugins.skins.IDVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.AddressVisualizerSkin</skin> <skin>se.sics.cooja.plugins.skins.AddressVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.UDGMVisualizerSkin</skin> <skin>se.sics.cooja.plugins.skins.UDGMVisualizerSkin</skin>
<viewport>123.21660699387752 0.0 0.0 123.21660699387752 -8113.602333266065 -7760.635326525308</viewport> <viewport>123.21660699387752 0.0 0.0 123.21660699387752 -8113.602333266065 -7760.635326525308</viewport>
</plugin_config> </plugin_config>
<width>246</width> <width>246</width>
<z>2</z> <z>2</z>
<height>167</height> <height>167</height>
<location_x>0</location_x> <location_x>0</location_x>
<location_y>198</location_y> <location_y>198</location_y>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.ScriptRunner se.sics.cooja.plugins.ScriptRunner
<plugin_config> <plugin_config>
<script>TIMEOUT(100000, log.log("last msg: " + msg + "\n")); /* print last msg at timeout */ <script>TIMEOUT(100000, log.log("last msg: " + msg + "\n")); /* print last msg at timeout */
count = 0; count = 0;
while (count++ &lt; 5) { while (count++ &lt; 5) {
/* Message from sender process to receiver process */ /* Message from sender process to receiver process */
YIELD_THEN_WAIT_UNTIL(msg.contains("Client sending")); YIELD_THEN_WAIT_UNTIL(msg.contains("Client sending"));
YIELD_THEN_WAIT_UNTIL(msg.contains("Server received")); YIELD_THEN_WAIT_UNTIL(msg.contains("Server received"));
log.log(count + ": Sender -&gt; Receiver OK\n"); log.log(count + ": Sender -&gt; Receiver OK\n");
/* Message from receiver process to sender process */ /* Message from receiver process to sender process */
YIELD_THEN_WAIT_UNTIL(msg.contains("Responding with")); YIELD_THEN_WAIT_UNTIL(msg.contains("Responding with"));
YIELD_THEN_WAIT_UNTIL(msg.contains("Response from")); YIELD_THEN_WAIT_UNTIL(msg.contains("Response from"));
log.log(count + ": Receiver -&gt; Sender OK\n"); log.log(count + ": Receiver -&gt; Sender OK\n");
} }
log.testOK(); /* Report test success and quit */</script> log.testOK(); /* Report test success and quit */</script>
<active>true</active> <active>true</active>
</plugin_config> </plugin_config>
<width>572</width> <width>572</width>
<z>1</z> <z>1</z>
<height>700</height> <height>700</height>
<location_x>441</location_x> <location_x>441</location_x>
<location_y>2</location_y> <location_y>2</location_y>
</plugin> </plugin>
</simconf> </simconf>

View file

@ -1,148 +1,148 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<simconf> <simconf>
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/mrm</project> <project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/mrm</project>
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/mspsim</project> <project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/mspsim</project>
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/avrora</project> <project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/avrora</project>
<simulation> <simulation>
<title>My simulation</title> <title>My simulation</title>
<delaytime>0</delaytime> <delaytime>0</delaytime>
<randomseed>generated</randomseed> <randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us> <motedelay_us>1000000</motedelay_us>
<radiomedium> <radiomedium>
se.sics.cooja.radiomediums.UDGM se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range> <transmitting_range>50.0</transmitting_range>
<interference_range>100.0</interference_range> <interference_range>100.0</interference_range>
<success_ratio_tx>1.0</success_ratio_tx> <success_ratio_tx>1.0</success_ratio_tx>
<success_ratio_rx>1.0</success_ratio_rx> <success_ratio_rx>1.0</success_ratio_rx>
</radiomedium> </radiomedium>
<events> <events>
<logoutput>40000</logoutput> <logoutput>40000</logoutput>
</events> </events>
<motetype> <motetype>
se.sics.cooja.mspmote.SkyMoteType se.sics.cooja.mspmote.SkyMoteType
<identifier>sky1</identifier> <identifier>sky1</identifier>
<description>Sky Mote Type #1</description> <description>Sky Mote Type #1</description>
<source EXPORT="discard">[CONTIKI_DIR]/examples/udp-ipv6/udp-client.c</source> <source EXPORT="discard">[CONTIKI_DIR]/examples/udp-ipv6/udp-client.c</source>
<commands EXPORT="discard">make clean TARGET=sky <commands EXPORT="discard">make clean TARGET=sky
make udp-client.sky TARGET=sky DEFINES=UDP_CONNECTION_ADDR=fe80::212:7402:2:202,SICSLOWPAN_CONF_FRAG=1,SEND_TOO_LARGE_PACKET_TO_TEST_FRAGMENTATION=1</commands> make udp-client.sky TARGET=sky DEFINES=UDP_CONNECTION_ADDR=fe80::212:7402:2:202,SICSLOWPAN_CONF_FRAG=1,SEND_TOO_LARGE_PACKET_TO_TEST_FRAGMENTATION=1</commands>
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/udp-ipv6/udp-client.sky</firmware> <firmware EXPORT="copy">[CONTIKI_DIR]/examples/udp-ipv6/udp-client.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface> <moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface> <moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface> <moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface>
</motetype> </motetype>
<motetype> <motetype>
se.sics.cooja.mspmote.SkyMoteType se.sics.cooja.mspmote.SkyMoteType
<identifier>sky2</identifier> <identifier>sky2</identifier>
<description>Sky Mote Type #2</description> <description>Sky Mote Type #2</description>
<source EXPORT="discard">[CONTIKI_DIR]/examples/udp-ipv6/udp-server.c</source> <source EXPORT="discard">[CONTIKI_DIR]/examples/udp-ipv6/udp-server.c</source>
<commands EXPORT="discard">make udp-server.sky TARGET=sky DEFINES=SICSLOWPAN_CONF_FRAG=1</commands> <commands EXPORT="discard">make udp-server.sky TARGET=sky DEFINES=SICSLOWPAN_CONF_FRAG=1</commands>
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/udp-ipv6/udp-server.sky</firmware> <firmware EXPORT="copy">[CONTIKI_DIR]/examples/udp-ipv6/udp-server.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface> <moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface> <moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface> <moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface> <moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface>
</motetype> </motetype>
<mote> <mote>
<breakpoints /> <breakpoints />
<interface_config> <interface_config>
se.sics.cooja.interfaces.Position se.sics.cooja.interfaces.Position
<x>65.934608127183</x> <x>65.934608127183</x>
<y>63.70462190529231</y> <y>63.70462190529231</y>
<z>0.0</z> <z>0.0</z>
</interface_config> </interface_config>
<interface_config> <interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID se.sics.cooja.mspmote.interfaces.MspMoteID
<id>1</id> <id>1</id>
</interface_config> </interface_config>
<motetype_identifier>sky1</motetype_identifier> <motetype_identifier>sky1</motetype_identifier>
</mote> </mote>
<mote> <mote>
<breakpoints /> <breakpoints />
<interface_config> <interface_config>
se.sics.cooja.interfaces.Position se.sics.cooja.interfaces.Position
<x>67.66105781539623</x> <x>67.66105781539623</x>
<y>63.13924301161143</y> <y>63.13924301161143</y>
<z>0.0</z> <z>0.0</z>
</interface_config> </interface_config>
<interface_config> <interface_config>
se.sics.cooja.mspmote.interfaces.MspMoteID se.sics.cooja.mspmote.interfaces.MspMoteID
<id>2</id> <id>2</id>
</interface_config> </interface_config>
<motetype_identifier>sky2</motetype_identifier> <motetype_identifier>sky2</motetype_identifier>
</mote> </mote>
</simulation> </simulation>
<plugin> <plugin>
se.sics.cooja.plugins.SimControl se.sics.cooja.plugins.SimControl
<width>248</width> <width>248</width>
<z>2</z> <z>2</z>
<height>200</height> <height>200</height>
<location_x>0</location_x> <location_x>0</location_x>
<location_y>0</location_y> <location_y>0</location_y>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.LogListener se.sics.cooja.plugins.LogListener
<plugin_config> <plugin_config>
<filter /> <filter />
</plugin_config> </plugin_config>
<width>816</width> <width>816</width>
<z>1</z> <z>1</z>
<height>333</height> <height>333</height>
<location_x>1</location_x> <location_x>1</location_x>
<location_y>366</location_y> <location_y>366</location_y>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.Visualizer se.sics.cooja.plugins.Visualizer
<plugin_config> <plugin_config>
<skin>se.sics.cooja.plugins.skins.IDVisualizerSkin</skin> <skin>se.sics.cooja.plugins.skins.IDVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.AddressVisualizerSkin</skin> <skin>se.sics.cooja.plugins.skins.AddressVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.UDGMVisualizerSkin</skin> <skin>se.sics.cooja.plugins.skins.UDGMVisualizerSkin</skin>
<viewport>123.21660699387752 0.0 0.0 123.21660699387752 -8113.602333266065 -7760.635326525308</viewport> <viewport>123.21660699387752 0.0 0.0 123.21660699387752 -8113.602333266065 -7760.635326525308</viewport>
</plugin_config> </plugin_config>
<width>246</width> <width>246</width>
<z>3</z> <z>3</z>
<height>167</height> <height>167</height>
<location_x>0</location_x> <location_x>0</location_x>
<location_y>198</location_y> <location_y>198</location_y>
</plugin> </plugin>
<plugin> <plugin>
se.sics.cooja.plugins.ScriptRunner se.sics.cooja.plugins.ScriptRunner
<plugin_config> <plugin_config>
<script>TIMEOUT(150000, log.log("last msg: " + msg + "\n")); /* print last msg at timeout */ <script>TIMEOUT(150000, log.log("last msg: " + msg + "\n")); /* print last msg at timeout */
count = 0; count = 0;
while (count++ &lt; 5) { while (count++ &lt; 5) {
/* Message from sender process to receiver process */ /* Message from sender process to receiver process */
YIELD_THEN_WAIT_UNTIL(msg.contains("Client sending")); YIELD_THEN_WAIT_UNTIL(msg.contains("Client sending"));
YIELD_THEN_WAIT_UNTIL(msg.contains("Server received")); YIELD_THEN_WAIT_UNTIL(msg.contains("Server received"));
log.log(count + ": Sender -&gt; Receiver OK\n"); log.log(count + ": Sender -&gt; Receiver OK\n");
/* Message from receiver process to sender process */ /* Message from receiver process to sender process */
YIELD_THEN_WAIT_UNTIL(msg.contains("Responding with message")); YIELD_THEN_WAIT_UNTIL(msg.contains("Responding with message"));
YIELD_THEN_WAIT_UNTIL(msg.contains("Response from")); YIELD_THEN_WAIT_UNTIL(msg.contains("Response from"));
log.log(count + ": Receiver -&gt; Sender OK\n"); log.log(count + ": Receiver -&gt; Sender OK\n");
} }
log.testOK(); /* Report test success and quit */</script> log.testOK(); /* Report test success and quit */</script>
<active>true</active> <active>true</active>
</plugin_config> </plugin_config>
<width>572</width> <width>572</width>
<z>0</z> <z>0</z>
<height>700</height> <height>700</height>
<location_x>380</location_x> <location_x>380</location_x>
<location_y>-11</location_y> <location_y>-11</location_y>
</plugin> </plugin>
</simconf> </simconf>

View file

@ -1,18 +1,18 @@
The JNI tests have been replaced by the Cooja configuration wizard. The JNI tests have been replaced by the Cooja configuration wizard.
The JNI tests assisted in configuring Cooja for compiling and linking The JNI tests assisted in configuring Cooja for compiling and linking
Java Native Interface (JNI) enabled Contiki libraries. Such Contiki Java Native Interface (JNI) enabled Contiki libraries. Such Contiki
libraries are used by Cooja's Contiki Motes: motes simulated at the libraries are used by Cooja's Contiki Motes: motes simulated at the
operating system abstraction level. operating system abstraction level.
The new configuration wizard is started from inside Cooja, and exercises The new configuration wizard is started from inside Cooja, and exercises
the same functionality as the JNI tests. In contrast, the wizard the same functionality as the JNI tests. In contrast, the wizard
is directly connected to the current Cooja configuration, removing the is directly connected to the current Cooja configuration, removing the
need to migrate the configuration between JNI tests and Cooja. need to migrate the configuration between JNI tests and Cooja.
To start the wizard: To start the wizard:
* Start COOJA: * Start COOJA:
tools/cooja> ant run tools/cooja> ant run
* Menu > Settings > Compiler configuration wizard * Menu > Settings > Compiler configuration wizard
-- Fredrik Osterlind, fros@sics.se, March 2009 -- Fredrik Osterlind, fros@sics.se, March 2009

View file

@ -1,2 +1,2 @@
se.sics.cooja.contikimote.ContikiMoteType.MOTE_INTERFACES = + DummyInterface se.sics.cooja.contikimote.ContikiMoteType.MOTE_INTERFACES = + DummyInterface
se.sics.cooja.contikimote.ContikiMoteType.C_SOURCES = + dummy_intf.c se.sics.cooja.contikimote.ContikiMoteType.C_SOURCES = + dummy_intf.c

View file

@ -1,2 +1,2 @@
DESCRIPTION = Example plugin DESCRIPTION = Example plugin
se.sics.cooja.GUI.PLUGINS = + MyDummyPlugin se.sics.cooja.GUI.PLUGINS = + MyDummyPlugin

View file

@ -1 +1 @@
se.sics.cooja.GUI.RADIOMEDIUMS = + DummyRadioMedium se.sics.cooja.GUI.RADIOMEDIUMS = + DummyRadioMedium

View file

@ -1,169 +1,169 @@
package se.sics.cooja.plugins.analyzers; package se.sics.cooja.plugins.analyzers;
import java.io.IOException; import java.io.IOException;
import se.sics.cooja.util.StringUtils; import se.sics.cooja.util.StringUtils;
public class IEEE802154Analyzer extends PacketAnalyzer { public class IEEE802154Analyzer extends PacketAnalyzer {
/* TODO: fix this to be correct */ /* TODO: fix this to be correct */
public static final int NO_ADDRESS = 0; public static final int NO_ADDRESS = 0;
public static final int RSV_ADDRESS = 1; public static final int RSV_ADDRESS = 1;
public static final int SHORT_ADDRESS = 2; public static final int SHORT_ADDRESS = 2;
public static final int LONG_ADDRESS = 3; public static final int LONG_ADDRESS = 3;
public static final int BEACONFRAME = 0x00; public static final int BEACONFRAME = 0x00;
public static final int DATAFRAME = 0x01; public static final int DATAFRAME = 0x01;
public static final int ACKFRAME = 0x02; public static final int ACKFRAME = 0x02;
public static final int CMDFRAME = 0x03; public static final int CMDFRAME = 0x03;
// private static final byte[] BROADCAST_ADDR = {(byte)0xff, (byte)0xff}; // private static final byte[] BROADCAST_ADDR = {(byte)0xff, (byte)0xff};
private static final String[] typeS = {"-", "D", "A"}; private static final String[] typeS = {"-", "D", "A"};
private static final String[] typeVerbose = {"BEACON", "DATA", "ACK"}; private static final String[] typeVerbose = {"BEACON", "DATA", "ACK"};
private PcapExporter pcapExporter; private PcapExporter pcapExporter;
// private int defaultAddressMode = LONG_ADDRESS; // private int defaultAddressMode = LONG_ADDRESS;
// private byte seqNo = 0; // private byte seqNo = 0;
// private int myPanID = 0xabcd; // private int myPanID = 0xabcd;
public IEEE802154Analyzer(boolean pcap) { public IEEE802154Analyzer(boolean pcap) {
if (pcap) try { if (pcap) try {
pcapExporter = new PcapExporter(); pcapExporter = new PcapExporter();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
public boolean matchPacket(Packet packet) { public boolean matchPacket(Packet packet) {
return packet.level == MAC_LEVEL; return packet.level == MAC_LEVEL;
} }
/* this protocol always have network level packets as payload */ /* this protocol always have network level packets as payload */
public int nextLevel(byte[] packet, int level) { public int nextLevel(byte[] packet, int level) {
return NETWORK_LEVEL; return NETWORK_LEVEL;
} }
/* create a 802.15.4 packet of the bytes and "dispatch" to the /* create a 802.15.4 packet of the bytes and "dispatch" to the
* next handler * next handler
*/ */
public int analyzePacket(Packet packet, StringBuffer brief, StringBuffer verbose) { public int analyzePacket(Packet packet, StringBuffer brief, StringBuffer verbose) {
if (pcapExporter != null) { if (pcapExporter != null) {
try { try {
pcapExporter.exportPacketData(packet.getPayload()); pcapExporter.exportPacketData(packet.getPayload());
} catch (IOException e) { } catch (IOException e) {
System.err.println("Could not export PCap data"); System.err.println("Could not export PCap data");
e.printStackTrace(); e.printStackTrace();
} }
} }
int pos = packet.pos; int pos = packet.pos;
int type = packet.data[pos + 0] & 7; int type = packet.data[pos + 0] & 7;
// int security = (packet.data[pos + 0] >> 3) & 1; // int security = (packet.data[pos + 0] >> 3) & 1;
// int pending = (packet.data[pos + 0] >> 4) & 1; // int pending = (packet.data[pos + 0] >> 4) & 1;
// int ackRequired = (packet.data[pos + 0] >> 5) & 1; // int ackRequired = (packet.data[pos + 0] >> 5) & 1;
int panCompression = (packet.data[pos + 0]>> 6) & 1; int panCompression = (packet.data[pos + 0]>> 6) & 1;
int destAddrMode = (packet.data[pos + 1] >> 2) & 3; int destAddrMode = (packet.data[pos + 1] >> 2) & 3;
// int frameVersion = (packet.data[pos + 1] >> 4) & 3; // int frameVersion = (packet.data[pos + 1] >> 4) & 3;
int srcAddrMode = (packet.data[pos + 1] >> 6) & 3; int srcAddrMode = (packet.data[pos + 1] >> 6) & 3;
int seqNumber = packet.data[pos + 2] & 0xff; int seqNumber = packet.data[pos + 2] & 0xff;
int destPanID = 0; int destPanID = 0;
int srcPanID = 0; int srcPanID = 0;
byte[] sourceAddress = null; byte[] sourceAddress = null;
byte[] destAddress = null; byte[] destAddress = null;
pos += 3; pos += 3;
if (destAddrMode > 0) { if (destAddrMode > 0) {
destPanID = (packet.data[pos] & 0xff) + ((packet.data[pos + 1] & 0xff) << 8); destPanID = (packet.data[pos] & 0xff) + ((packet.data[pos + 1] & 0xff) << 8);
pos += 2; pos += 2;
if (destAddrMode == SHORT_ADDRESS) { if (destAddrMode == SHORT_ADDRESS) {
destAddress = new byte[2]; destAddress = new byte[2];
destAddress[1] = packet.data[pos]; destAddress[1] = packet.data[pos];
destAddress[0] = packet.data[pos + 1]; destAddress[0] = packet.data[pos + 1];
pos += 2; pos += 2;
} else if (destAddrMode == LONG_ADDRESS) { } else if (destAddrMode == LONG_ADDRESS) {
destAddress = new byte[8]; destAddress = new byte[8];
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
destAddress[i] = packet.data[pos + 7 - i]; destAddress[i] = packet.data[pos + 7 - i];
} }
pos += 8; pos += 8;
} }
} }
if (srcAddrMode > 0) { if (srcAddrMode > 0) {
if (panCompression == 0){ if (panCompression == 0){
srcPanID = (packet.data[pos] & 0xff) + ((packet.data[pos + 1] & 0xff) << 8); srcPanID = (packet.data[pos] & 0xff) + ((packet.data[pos + 1] & 0xff) << 8);
pos += 2; pos += 2;
} else { } else {
srcPanID = destPanID; srcPanID = destPanID;
} }
if (srcAddrMode == SHORT_ADDRESS) { if (srcAddrMode == SHORT_ADDRESS) {
sourceAddress = new byte[2]; sourceAddress = new byte[2];
sourceAddress[1] = packet.data[pos]; sourceAddress[1] = packet.data[pos];
sourceAddress[0] = packet.data[pos + 1]; sourceAddress[0] = packet.data[pos + 1];
pos += 2; pos += 2;
} else if (srcAddrMode == LONG_ADDRESS) { } else if (srcAddrMode == LONG_ADDRESS) {
sourceAddress = new byte[8]; sourceAddress = new byte[8];
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
sourceAddress[i] = packet.data[pos + 7 - i]; sourceAddress[i] = packet.data[pos + 7 - i];
} }
pos += 8; pos += 8;
} }
} }
// int payloadLen = packet.data.length - pos; // int payloadLen = packet.data.length - pos;
brief.append("15.4 "); brief.append("15.4 ");
brief.append(type < typeS.length ? typeS[type] : "?").append(' '); brief.append(type < typeS.length ? typeS[type] : "?").append(' ');
verbose.append("<html><b>IEEE 802.15.4 ") verbose.append("<html><b>IEEE 802.15.4 ")
.append(type < typeVerbose.length ? typeVerbose[type] : "?") .append(type < typeVerbose.length ? typeVerbose[type] : "?")
.append(' ').append(seqNumber); .append(' ').append(seqNumber);
if (type != ACKFRAME) { if (type != ACKFRAME) {
printAddress(brief, srcAddrMode, sourceAddress); printAddress(brief, srcAddrMode, sourceAddress);
brief.append(' '); brief.append(' ');
printAddress(brief, destAddrMode, destAddress); printAddress(brief, destAddrMode, destAddress);
verbose.append("</b><br>From "); verbose.append("</b><br>From ");
if (srcPanID != 0) { if (srcPanID != 0) {
verbose.append(StringUtils.toHex((byte)(srcPanID >> 8))) verbose.append(StringUtils.toHex((byte)(srcPanID >> 8)))
.append(StringUtils.toHex((byte)(srcPanID & 0xff))) .append(StringUtils.toHex((byte)(srcPanID & 0xff)))
.append('/'); .append('/');
} }
printAddress(verbose, srcAddrMode, sourceAddress); printAddress(verbose, srcAddrMode, sourceAddress);
verbose.append(" to "); verbose.append(" to ");
if (destPanID != 0) { if (destPanID != 0) {
verbose.append(StringUtils.toHex((byte)(destPanID >> 8))) verbose.append(StringUtils.toHex((byte)(destPanID >> 8)))
.append(StringUtils.toHex((byte)(destPanID & 0xff))) .append(StringUtils.toHex((byte)(destPanID & 0xff)))
.append('/'); .append('/');
} }
printAddress(verbose, destAddrMode, destAddress); printAddress(verbose, destAddrMode, destAddress);
} else { } else {
/* got ack - no more to do ... */ /* got ack - no more to do ... */
return ANALYSIS_OK_FINAL; return ANALYSIS_OK_FINAL;
} }
/* update packet */ /* update packet */
packet.pos = pos; packet.pos = pos;
packet.level = NETWORK_LEVEL; packet.level = NETWORK_LEVEL;
/* remove CRC from the packet */ /* remove CRC from the packet */
packet.consumeBytesEnd(2); packet.consumeBytesEnd(2);
packet.llsender = sourceAddress; packet.llsender = sourceAddress;
packet.llreceiver = destAddress; packet.llreceiver = destAddress;
return ANALYSIS_OK_CONTINUE; return ANALYSIS_OK_CONTINUE;
} }
private void printAddress(StringBuffer sb, int type, byte[] addr) { private void printAddress(StringBuffer sb, int type, byte[] addr) {
if (type == SHORT_ADDRESS) { if (type == SHORT_ADDRESS) {
sb.append(StringUtils.toHex(addr)); sb.append(StringUtils.toHex(addr));
} else if (type == LONG_ADDRESS) { } else if (type == LONG_ADDRESS) {
sb.append(StringUtils.toHex(addr[0]) + StringUtils.toHex(addr[1]) + ":" + sb.append(StringUtils.toHex(addr[0]) + StringUtils.toHex(addr[1]) + ":" +
StringUtils.toHex(addr[2]) + StringUtils.toHex(addr[3]) + ":" + StringUtils.toHex(addr[2]) + StringUtils.toHex(addr[3]) + ":" +
StringUtils.toHex(addr[4]) + StringUtils.toHex(addr[5]) + ":" + StringUtils.toHex(addr[4]) + StringUtils.toHex(addr[5]) + ":" +
StringUtils.toHex(addr[6]) + StringUtils.toHex(addr[7])); StringUtils.toHex(addr[6]) + StringUtils.toHex(addr[7]));
} }
} }
} }

View file

@ -1,88 +1,88 @@
package se.sics.cooja.plugins.analyzers; package se.sics.cooja.plugins.analyzers;
public abstract class PacketAnalyzer { public abstract class PacketAnalyzer {
public static final int ANALYSIS_FAILED = -1; public static final int ANALYSIS_FAILED = -1;
public static final int ANALYSIS_OK_CONTINUE = 1; public static final int ANALYSIS_OK_CONTINUE = 1;
public static final int ANALYSIS_OK_FINAL = 2; public static final int ANALYSIS_OK_FINAL = 2;
public static final int RADIO_LEVEL = 0; public static final int RADIO_LEVEL = 0;
public static final int MAC_LEVEL = 1; public static final int MAC_LEVEL = 1;
public static final int NETWORK_LEVEL = 2; public static final int NETWORK_LEVEL = 2;
public static class Packet { public static class Packet {
byte[] data; byte[] data;
int pos; int pos;
int level; int level;
/* size = length - consumed bytes at tail */ /* size = length - consumed bytes at tail */
int size; int size;
/* L2 addresseses */ /* L2 addresseses */
byte[] llsender; byte[] llsender;
byte[] llreceiver; byte[] llreceiver;
byte lastDispatch = 0; byte lastDispatch = 0;
public Packet(byte[] data, int level) { public Packet(byte[] data, int level) {
this.level = level; this.level = level;
this.data = data; this.data = data;
this.size = data.length; this.size = data.length;
} }
public void consumeBytesStart(int bytes) { public void consumeBytesStart(int bytes) {
pos += bytes; pos += bytes;
} }
public void consumeBytesEnd(int bytes) { public void consumeBytesEnd(int bytes) {
size -= bytes; size -= bytes;
} }
public boolean hasMoreData() { public boolean hasMoreData() {
return size > pos; return size > pos;
} }
public int size() { public int size() {
return size - pos; return size - pos;
} }
public byte get(int index) { public byte get(int index) {
if (index >= size) return 0; if (index >= size) return 0;
return data[pos + index]; return data[pos + index];
} }
public int getInt(int index, int size) { public int getInt(int index, int size) {
int value = 0; int value = 0;
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
value = (value << 8) + get(index + i); value = (value << 8) + get(index + i);
} }
return value; return value;
} }
public byte[] getPayload() { public byte[] getPayload() {
byte[] pload = new byte[size - pos]; byte[] pload = new byte[size - pos];
System.arraycopy(data, pos, pload, 0, pload.length); System.arraycopy(data, pos, pload, 0, pload.length);
return pload; return pload;
} }
public void copy(int srcpos, byte[] arr, int pos, int len) { public void copy(int srcpos, byte[] arr, int pos, int len) {
for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
arr[pos + i] = get(srcpos + i); arr[pos + i] = get(srcpos + i);
} }
} }
public byte[] getLLSender() { public byte[] getLLSender() {
return llsender; return llsender;
} }
public byte[] getLLReceiver() { public byte[] getLLReceiver() {
return llreceiver; return llreceiver;
} }
}; };
public abstract boolean matchPacket(Packet packet); public abstract boolean matchPacket(Packet packet);
public abstract int analyzePacket(Packet packet, StringBuffer brief, StringBuffer verbose); public abstract int analyzePacket(Packet packet, StringBuffer brief, StringBuffer verbose);
} }

View file

@ -1,58 +1,58 @@
package se.sics.cooja.plugins.analyzers; package se.sics.cooja.plugins.analyzers;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
public class PcapExporter { public class PcapExporter {
private static final byte[] ETH_DATA = {(byte)0xaf, (byte)0xab, (byte)0xac, (byte)0xad, private static final byte[] ETH_DATA = {(byte)0xaf, (byte)0xab, (byte)0xac, (byte)0xad,
(byte)0xae, (byte)0xaf, 0x42, (byte)0xfb, (byte)0x9f, (byte)0x81, 0x5a, (byte)0xae, (byte)0xaf, 0x42, (byte)0xfb, (byte)0x9f, (byte)0x81, 0x5a,
(byte)0x81, (byte)0x80, (byte)0x9a}; (byte)0x81, (byte)0x80, (byte)0x9a};
DataOutputStream out; DataOutputStream out;
public PcapExporter() throws IOException { public PcapExporter() throws IOException {
} }
public void openPcap() throws IOException { public void openPcap() throws IOException {
out = new DataOutputStream(new FileOutputStream("radiolog-" + System.currentTimeMillis() + ".pcap")); out = new DataOutputStream(new FileOutputStream("radiolog-" + System.currentTimeMillis() + ".pcap"));
/* pcap header */ /* pcap header */
out.writeInt(0xa1b2c3d4); out.writeInt(0xa1b2c3d4);
out.writeShort(0x0002); out.writeShort(0x0002);
out.writeShort(0x0004); out.writeShort(0x0004);
out.writeInt(0); out.writeInt(0);
out.writeInt(0); out.writeInt(0);
out.writeInt(4096); out.writeInt(4096);
out.writeInt(1); /* 1 for ethernet ? */ out.writeInt(1); /* 1 for ethernet ? */
out.flush(); out.flush();
System.out.println("Opened pcap file!"); System.out.println("Opened pcap file!");
} }
public void closePcap() throws IOException { public void closePcap() throws IOException {
out.close(); out.close();
} }
public void exportPacketData(byte[] data) throws IOException { public void exportPacketData(byte[] data) throws IOException {
if (out == null) { if (out == null) {
openPcap(); openPcap();
} }
try { try {
/* pcap packet header */ /* pcap packet header */
out.writeInt((int) System.currentTimeMillis() / 1000); out.writeInt((int) System.currentTimeMillis() / 1000);
out.writeInt((int) ((System.currentTimeMillis() % 1000) * 1000)); out.writeInt((int) ((System.currentTimeMillis() % 1000) * 1000));
out.writeInt(data.length + 14); out.writeInt(data.length + 14);
out.writeInt(data.length + 14); out.writeInt(data.length + 14);
out.write(ETH_DATA); out.write(ETH_DATA);
/* and the data */ /* and the data */
out.write(data); out.write(data);
out.flush(); out.flush();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
} }