2008-12-16 10:51:36 +01:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<simconf>
|
|
|
|
<simulation>
|
|
|
|
<title>My simulation</title>
|
2012-05-30 13:07:57 +02:00
|
|
|
<delaytime>-2147483648</delaytime>
|
2009-06-24 16:42:50 +02:00
|
|
|
<randomseed>generated</randomseed>
|
|
|
|
<motedelay_us>1000000</motedelay_us>
|
2008-12-16 10:51:36 +01:00
|
|
|
<radiomedium>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.radiomediums.UDGM
|
2008-12-16 10:51:36 +01:00
|
|
|
<transmitting_range>50.0</transmitting_range>
|
|
|
|
<interference_range>100.0</interference_range>
|
|
|
|
<success_ratio_tx>1.0</success_ratio_tx>
|
|
|
|
<success_ratio_rx>1.0</success_ratio_rx>
|
|
|
|
</radiomedium>
|
2012-05-30 13:07:57 +02:00
|
|
|
<events>
|
|
|
|
<logoutput>40000</logoutput>
|
|
|
|
</events>
|
2008-12-16 10:51:36 +01:00
|
|
|
<motetype>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.mspmote.SkyMoteType
|
2008-12-16 10:51:36 +01:00
|
|
|
<identifier>sky1</identifier>
|
2012-05-30 13:07:57 +02:00
|
|
|
<description>Telnet server example</description>
|
|
|
|
<source EXPORT="discard">[CONTIKI_DIR]/examples/sky-ip/sky-telnet-server.c</source>
|
|
|
|
<commands EXPORT="discard">make sky-telnet-server.sky TARGET=sky</commands>
|
|
|
|
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/sky-ip/sky-telnet-server.sky</firmware>
|
2013-11-19 12:17:37 +01:00
|
|
|
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.IPAddress</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.Mote2MoteRelations</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.interfaces.MoteAttributes</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.MspClock</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.MspMoteID</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.SkyButton</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.SkyFlash</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.SkyCoffeeFilesystem</moteinterface>
|
2014-07-23 15:42:59 +02:00
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.Msp802154Radio</moteinterface>
|
2013-11-19 12:17:37 +01:00
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.MspSerial</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.SkyLED</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.MspDebugOutput</moteinterface>
|
|
|
|
<moteinterface>org.contikios.cooja.mspmote.interfaces.SkyTemperature</moteinterface>
|
2008-12-16 10:51:36 +01:00
|
|
|
</motetype>
|
|
|
|
<mote>
|
2009-06-24 16:42:50 +02:00
|
|
|
<breakpoints />
|
2008-12-16 10:51:36 +01:00
|
|
|
<interface_config>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.interfaces.Position
|
2008-12-16 10:51:36 +01:00
|
|
|
<x>86.60672552430381</x>
|
|
|
|
<y>5.401254433278691</y>
|
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.mspmote.interfaces.MspMoteID
|
2008-12-16 10:51:36 +01:00
|
|
|
<id>1</id>
|
|
|
|
</interface_config>
|
2012-05-30 13:07:57 +02:00
|
|
|
<interface_config>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.mspmote.interfaces.MspSerial
|
2012-05-30 13:07:57 +02:00
|
|
|
<history></history>
|
|
|
|
</interface_config>
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
2008-12-16 10:51:36 +01:00
|
|
|
</mote>
|
|
|
|
</simulation>
|
2009-02-24 16:56:58 +01:00
|
|
|
<plugin>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.plugins.SimControl
|
2012-05-30 13:07:57 +02:00
|
|
|
<width>261</width>
|
|
|
|
<z>3</z>
|
|
|
|
<height>206</height>
|
|
|
|
<location_x>7</location_x>
|
|
|
|
<location_y>4</location_y>
|
2008-12-16 10:51:36 +01:00
|
|
|
</plugin>
|
|
|
|
<plugin>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.plugins.NativeIPGateway
|
2008-12-16 10:51:36 +01:00
|
|
|
<mote_arg>0</mote_arg>
|
|
|
|
<plugin_config>
|
2012-05-30 13:07:57 +02:00
|
|
|
<network_interface>lo</network_interface>
|
2008-12-16 10:51:36 +01:00
|
|
|
<register_routes>true</register_routes>
|
|
|
|
</plugin_config>
|
|
|
|
<width>388</width>
|
2012-05-30 13:07:57 +02:00
|
|
|
<z>1</z>
|
|
|
|
<height>350</height>
|
|
|
|
<location_x>75</location_x>
|
|
|
|
<location_y>599</location_y>
|
2009-04-23 12:53:32 +02:00
|
|
|
</plugin>
|
|
|
|
<plugin>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.plugins.MoteInterfaceViewer
|
2009-04-23 12:53:32 +02:00
|
|
|
<mote_arg>0</mote_arg>
|
|
|
|
<plugin_config>
|
|
|
|
<interface>Serial port</interface>
|
|
|
|
<scrollpos>0,0</scrollpos>
|
|
|
|
</plugin_config>
|
2012-05-30 13:07:57 +02:00
|
|
|
<width>550</width>
|
|
|
|
<z>0</z>
|
|
|
|
<height>357</height>
|
|
|
|
<location_x>39</location_x>
|
|
|
|
<location_y>223</location_y>
|
2009-04-23 12:53:32 +02:00
|
|
|
</plugin>
|
|
|
|
<plugin>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.plugins.Visualizer
|
2009-04-23 12:53:32 +02:00
|
|
|
<plugin_config>
|
2013-11-19 12:17:37 +01:00
|
|
|
<skin>org.contikios.cooja.plugins.skins.LEDVisualizerSkin</skin>
|
|
|
|
<skin>org.contikios.cooja.plugins.skins.AddressVisualizerSkin</skin>
|
|
|
|
<skin>org.contikios.cooja.plugins.skins.UDGMVisualizerSkin</skin>
|
|
|
|
<skin>org.contikios.cooja.plugins.skins.GridVisualizerSkin</skin>
|
2012-05-30 13:07:57 +02:00
|
|
|
<viewport>1.473063973063973 0.0 0.0 1.473063973063973 21.959789842145003 40.69175483313324</viewport>
|
2009-04-23 12:53:32 +02:00
|
|
|
</plugin_config>
|
2012-05-30 13:07:57 +02:00
|
|
|
<width>313</width>
|
|
|
|
<z>4</z>
|
|
|
|
<height>169</height>
|
|
|
|
<location_x>294</location_x>
|
|
|
|
<location_y>27</location_y>
|
2009-06-24 16:42:50 +02:00
|
|
|
</plugin>
|
|
|
|
<plugin>
|
2013-11-19 12:17:37 +01:00
|
|
|
org.contikios.cooja.plugins.ScriptRunner
|
2009-06-24 16:42:50 +02:00
|
|
|
<plugin_config>
|
2012-06-01 16:44:42 +02:00
|
|
|
<script>TIMEOUT(180000);
|
2009-06-24 16:42:50 +02:00
|
|
|
|
|
|
|
/* conf */
|
|
|
|
nrReplies = 0;
|
|
|
|
ipAddress = "172.16.1.0";
|
|
|
|
osName = java.lang.System.getProperty("os.name").toLowerCase();
|
|
|
|
if (osName.startsWith("win")) {
|
|
|
|
pingOnceCmd = "ping -n 1 " + ipAddress;
|
2012-06-01 16:44:42 +02:00
|
|
|
pingCmd = "ping -w 10000 -n 10 " + ipAddress;
|
2009-06-24 16:42:50 +02:00
|
|
|
} else {
|
|
|
|
pingOnceCmd = "ping -c 1 " + ipAddress;
|
2012-06-01 16:44:42 +02:00
|
|
|
pingCmd = "ping -i 4 -c 10 " + ipAddress;
|
2009-06-24 16:42:50 +02:00
|
|
|
}
|
|
|
|
replyMsg = "from " + ipAddress;
|
|
|
|
|
|
|
|
/* wait for mote startup */
|
2012-05-30 13:07:57 +02:00
|
|
|
GENERATE_MSG(5000, "continue");
|
|
|
|
WAIT_UNTIL(msg.equals("continue"));
|
2009-06-24 16:42:50 +02:00
|
|
|
|
|
|
|
/* make gateway */
|
|
|
|
pingOnceProcess = new java.lang.Runtime.getRuntime().exec(pingOnceCmd);
|
|
|
|
GENERATE_MSG(5000, "continue");
|
|
|
|
WAIT_UNTIL(msg.equals("continue"));
|
|
|
|
|
2012-06-04 16:14:05 +02:00
|
|
|
/* override simulation speed limit to realtime */
|
|
|
|
mote.getSimulation().setSpeedLimit(1.0);
|
2009-06-24 16:42:50 +02:00
|
|
|
|
|
|
|
/* start ping process */
|
|
|
|
var runnableObj = new Object();
|
|
|
|
runnableObj.run = function() {
|
|
|
|
pingProcess = new java.lang.Runtime.getRuntime().exec(pingCmd);
|
|
|
|
log.log("cmd> " + pingCmd + "\n");
|
|
|
|
|
|
|
|
stdIn = new java.io.BufferedReader(new java.io.InputStreamReader(pingProcess.getInputStream()));
|
|
|
|
while ((line = stdIn.readLine()) != null) {
|
|
|
|
log.log("> " + line + "\n");
|
|
|
|
if (line.contains(replyMsg)) {
|
|
|
|
nrReplies++;
|
|
|
|
//log.log("reply #" + nrReplies + "\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pingProcess.destroy();
|
|
|
|
|
|
|
|
if (nrReplies > 5) {
|
|
|
|
log.testOK(); /* Report test success and quit */
|
|
|
|
} else {
|
|
|
|
log.log("Only " + nrReplies + "/10 ping replies was received\n");
|
|
|
|
log.testFailed();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var thread = new java.lang.Thread(new java.lang.Runnable(runnableObj));
|
|
|
|
thread.start();</script>
|
|
|
|
<active>true</active>
|
|
|
|
</plugin_config>
|
2012-05-30 13:07:57 +02:00
|
|
|
<width>589</width>
|
|
|
|
<z>2</z>
|
|
|
|
<height>900</height>
|
|
|
|
<location_x>631</location_x>
|
|
|
|
<location_y>38</location_y>
|
2008-12-16 10:51:36 +01:00
|
|
|
</plugin>
|
|
|
|
</simconf>
|
|
|
|
|