added two rime/sky tests: abc and trickle
This commit is contained in:
parent
27bc3f771a
commit
a965293488
85
tools/cooja/contiki_tests/rime_abc.csc
Normal file
85
tools/cooja/contiki_tests/rime_abc.csc
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<simconf>
|
||||||
|
<simulation>
|
||||||
|
<title>My simulation</title>
|
||||||
|
<delaytime>0</delaytime>
|
||||||
|
<ticktime>1</ticktime>
|
||||||
|
<randomseed>123456</randomseed>
|
||||||
|
<nrticklists>1</nrticklists>
|
||||||
|
<motedelay>5000</motedelay>
|
||||||
|
<radiomedium>
|
||||||
|
se.sics.cooja.radiomediums.UDGM
|
||||||
|
<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>
|
||||||
|
<motetype>
|
||||||
|
se.sics.cooja.mspmote.SkyMoteType
|
||||||
|
<identifier>sky1</identifier>
|
||||||
|
<description>Sky Mote Type #1</description>
|
||||||
|
<source>../../../examples/rime/example-abc.c</source>
|
||||||
|
<command>make example-abc.firmware TARGET=sky</command>
|
||||||
|
</motetype>
|
||||||
|
<mote>
|
||||||
|
se.sics.cooja.mspmote.SkyMote
|
||||||
|
<motetype_identifier>sky1</motetype_identifier>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.interfaces.Position
|
||||||
|
<x>33.53152221759984</x>
|
||||||
|
<y>15.078801911773077</y>
|
||||||
|
<z>0.0</z>
|
||||||
|
</interface_config>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||||
|
<id>1</id>
|
||||||
|
</interface_config>
|
||||||
|
</mote>
|
||||||
|
<mote>
|
||||||
|
se.sics.cooja.mspmote.SkyMote
|
||||||
|
<motetype_identifier>sky1</motetype_identifier>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.interfaces.Position
|
||||||
|
<x>54.67966631314053</x>
|
||||||
|
<y>31.0253850381183</y>
|
||||||
|
<z>0.0</z>
|
||||||
|
</interface_config>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||||
|
<id>2</id>
|
||||||
|
</interface_config>
|
||||||
|
</mote>
|
||||||
|
</simulation>
|
||||||
|
<plugin>
|
||||||
|
se.sics.cooja.plugins.SimControl
|
||||||
|
<width>313</width>
|
||||||
|
<z>2</z>
|
||||||
|
<height>199</height>
|
||||||
|
<location_x>30</location_x>
|
||||||
|
<location_y>30</location_y>
|
||||||
|
<minimized>false</minimized>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
se.sics.cooja.radiomediums.UDGM$VisUDGM
|
||||||
|
<width>300</width>
|
||||||
|
<z>3</z>
|
||||||
|
<height>122</height>
|
||||||
|
<location_x>367</location_x>
|
||||||
|
<location_y>23</location_y>
|
||||||
|
<minimized>false</minimized>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
se.sics.cooja.plugins.LogListener
|
||||||
|
<plugin_config>
|
||||||
|
<filter />
|
||||||
|
<history>256</history>
|
||||||
|
</plugin_config>
|
||||||
|
<width>573</width>
|
||||||
|
<z>1</z>
|
||||||
|
<height>242</height>
|
||||||
|
<location_x>23</location_x>
|
||||||
|
<location_y>235</location_y>
|
||||||
|
<minimized>false</minimized>
|
||||||
|
</plugin>
|
||||||
|
</simconf>
|
||||||
|
|
1
tools/cooja/contiki_tests/rime_abc.info
Normal file
1
tools/cooja/contiki_tests/rime_abc.info
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Rime anonymous broadcast (test-abc.c). Two Sky nodes.
|
19
tools/cooja/contiki_tests/rime_abc.js
Normal file
19
tools/cooja/contiki_tests/rime_abc.js
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
/* Only handle receive messages */
|
||||||
|
if (!msg.contains('received')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Remember receiver */
|
||||||
|
global.put("recv_" + id, "ok");
|
||||||
|
log.log(id + " received a message\n");
|
||||||
|
|
||||||
|
/* Did all nodes (1 and 2) receive a message? */
|
||||||
|
for (i = 1; i <= 2; i++) {
|
||||||
|
result = global.get("recv_" + i);
|
||||||
|
if (result == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
log.log("TEST OK\n"); /* Report test success */
|
||||||
|
mote.getSimulation().getGUI().doQuit(false); /* Quit simulator (to end test run)*/
|
197
tools/cooja/contiki_tests/rime_trickle.csc
Normal file
197
tools/cooja/contiki_tests/rime_trickle.csc
Normal file
|
@ -0,0 +1,197 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<simconf>
|
||||||
|
<simulation>
|
||||||
|
<title>My simulation</title>
|
||||||
|
<delaytime>0</delaytime>
|
||||||
|
<ticktime>1</ticktime>
|
||||||
|
<randomseed>123456</randomseed>
|
||||||
|
<nrticklists>1</nrticklists>
|
||||||
|
<motedelay>1000</motedelay>
|
||||||
|
<radiomedium>
|
||||||
|
se.sics.cooja.radiomediums.UDGM
|
||||||
|
<transmitting_range>41.0</transmitting_range>
|
||||||
|
<interference_range>55.0</interference_range>
|
||||||
|
<success_ratio_tx>1.0</success_ratio_tx>
|
||||||
|
<success_ratio_rx>1.0</success_ratio_rx>
|
||||||
|
</radiomedium>
|
||||||
|
<motetype>
|
||||||
|
se.sics.cooja.mspmote.SkyMoteType
|
||||||
|
<identifier>sky1</identifier>
|
||||||
|
<description>Sky Mote Type #1</description>
|
||||||
|
<source>../../../examples/rime/example-trickle.c</source>
|
||||||
|
<command>make example-trickle.firmware TARGET=sky</command>
|
||||||
|
</motetype>
|
||||||
|
<mote>
|
||||||
|
se.sics.cooja.mspmote.SkyMote
|
||||||
|
<motetype_identifier>sky1</motetype_identifier>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.interfaces.Position
|
||||||
|
<x>21.25615651441164</x>
|
||||||
|
<y>15.906616513243888</y>
|
||||||
|
<z>0.0</z>
|
||||||
|
</interface_config>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||||
|
<id>1</id>
|
||||||
|
</interface_config>
|
||||||
|
</mote>
|
||||||
|
<mote>
|
||||||
|
se.sics.cooja.mspmote.SkyMote
|
||||||
|
<motetype_identifier>sky1</motetype_identifier>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.interfaces.Position
|
||||||
|
<x>29.258648178869528</x>
|
||||||
|
<y>64.81243553163958</y>
|
||||||
|
<z>0.0</z>
|
||||||
|
</interface_config>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||||
|
<id>2</id>
|
||||||
|
</interface_config>
|
||||||
|
</mote>
|
||||||
|
<mote>
|
||||||
|
se.sics.cooja.mspmote.SkyMote
|
||||||
|
<motetype_identifier>sky1</motetype_identifier>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.interfaces.Position
|
||||||
|
<x>53.58390840870132</x>
|
||||||
|
<y>99.01827951434828</y>
|
||||||
|
<z>0.0</z>
|
||||||
|
</interface_config>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||||
|
<id>3</id>
|
||||||
|
</interface_config>
|
||||||
|
</mote>
|
||||||
|
<mote>
|
||||||
|
se.sics.cooja.mspmote.SkyMote
|
||||||
|
<motetype_identifier>sky1</motetype_identifier>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.interfaces.Position
|
||||||
|
<x>4.089137066756255</x>
|
||||||
|
<y>57.26244252237209</y>
|
||||||
|
<z>0.0</z>
|
||||||
|
</interface_config>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||||
|
<id>4</id>
|
||||||
|
</interface_config>
|
||||||
|
</mote>
|
||||||
|
<mote>
|
||||||
|
se.sics.cooja.mspmote.SkyMote
|
||||||
|
<motetype_identifier>sky1</motetype_identifier>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.interfaces.Position
|
||||||
|
<x>84.2311285004563</x>
|
||||||
|
<y>14.6212837520458</y>
|
||||||
|
<z>0.0</z>
|
||||||
|
</interface_config>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||||
|
<id>5</id>
|
||||||
|
</interface_config>
|
||||||
|
</mote>
|
||||||
|
<mote>
|
||||||
|
se.sics.cooja.mspmote.SkyMote
|
||||||
|
<motetype_identifier>sky1</motetype_identifier>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.interfaces.Position
|
||||||
|
<x>40.97868508483131</x>
|
||||||
|
<y>69.00112748842623</y>
|
||||||
|
<z>0.0</z>
|
||||||
|
</interface_config>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||||
|
<id>6</id>
|
||||||
|
</interface_config>
|
||||||
|
</mote>
|
||||||
|
<mote>
|
||||||
|
se.sics.cooja.mspmote.SkyMote
|
||||||
|
<motetype_identifier>sky1</motetype_identifier>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.interfaces.Position
|
||||||
|
<x>34.348646576361716</x>
|
||||||
|
<y>33.331938472933615</y>
|
||||||
|
<z>0.0</z>
|
||||||
|
</interface_config>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||||
|
<id>7</id>
|
||||||
|
</interface_config>
|
||||||
|
</mote>
|
||||||
|
<mote>
|
||||||
|
se.sics.cooja.mspmote.SkyMote
|
||||||
|
<motetype_identifier>sky1</motetype_identifier>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.interfaces.Position
|
||||||
|
<x>76.46661251540715</x>
|
||||||
|
<y>62.393168145801916</y>
|
||||||
|
<z>0.0</z>
|
||||||
|
</interface_config>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||||
|
<id>8</id>
|
||||||
|
</interface_config>
|
||||||
|
</mote>
|
||||||
|
<mote>
|
||||||
|
se.sics.cooja.mspmote.SkyMote
|
||||||
|
<motetype_identifier>sky1</motetype_identifier>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.interfaces.Position
|
||||||
|
<x>87.91615665417679</x>
|
||||||
|
<y>41.2939192052263</y>
|
||||||
|
<z>0.0</z>
|
||||||
|
</interface_config>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||||
|
<id>9</id>
|
||||||
|
</interface_config>
|
||||||
|
</mote>
|
||||||
|
<mote>
|
||||||
|
se.sics.cooja.mspmote.SkyMote
|
||||||
|
<motetype_identifier>sky1</motetype_identifier>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.interfaces.Position
|
||||||
|
<x>25.396991214895582</x>
|
||||||
|
<y>87.22076662391413</y>
|
||||||
|
<z>0.0</z>
|
||||||
|
</interface_config>
|
||||||
|
<interface_config>
|
||||||
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||||
|
<id>10</id>
|
||||||
|
</interface_config>
|
||||||
|
</mote>
|
||||||
|
</simulation>
|
||||||
|
<plugin>
|
||||||
|
se.sics.cooja.radiomediums.UDGM$VisUDGM
|
||||||
|
<width>300</width>
|
||||||
|
<z>2</z>
|
||||||
|
<height>300</height>
|
||||||
|
<location_x>14</location_x>
|
||||||
|
<location_y>206</location_y>
|
||||||
|
<minimized>false</minimized>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
se.sics.cooja.plugins.SimControl
|
||||||
|
<width>313</width>
|
||||||
|
<z>3</z>
|
||||||
|
<height>199</height>
|
||||||
|
<location_x>14</location_x>
|
||||||
|
<location_y>5</location_y>
|
||||||
|
<minimized>false</minimized>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
se.sics.cooja.plugins.LogListener
|
||||||
|
<plugin_config>
|
||||||
|
<filter />
|
||||||
|
<history>256</history>
|
||||||
|
</plugin_config>
|
||||||
|
<width>573</width>
|
||||||
|
<z>1</z>
|
||||||
|
<height>349</height>
|
||||||
|
<location_x>339</location_x>
|
||||||
|
<location_y>8</location_y>
|
||||||
|
<minimized>false</minimized>
|
||||||
|
</plugin>
|
||||||
|
</simconf>
|
||||||
|
|
1
tools/cooja/contiki_tests/rime_trickle.info
Normal file
1
tools/cooja/contiki_tests/rime_trickle.info
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Rime trickle (test-trickle.c). Ten Sky nodes, node one send message.
|
36
tools/cooja/contiki_tests/rime_trickle.js
Normal file
36
tools/cooja/contiki_tests/rime_trickle.js
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
/* Initiate trickle from node 1 by clicking button (once) */
|
||||||
|
result = global.get("recv_1");
|
||||||
|
if (result == null) {
|
||||||
|
if (id != 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!msg.contains('Starting')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
log.log("Clicking node 1 button\n");
|
||||||
|
mote.getInterfaces().getButton().clickButton()
|
||||||
|
global.put("recv_1", "ok");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Only handle receive messages */
|
||||||
|
if (!msg.contains('received')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Remember receiver */
|
||||||
|
global.put("recv_" + id, "ok");
|
||||||
|
log.log(id + " received a message\n");
|
||||||
|
|
||||||
|
/* Did all nodes (1-10) receive a message? */
|
||||||
|
for (i = 1; i <= 10; i++) {
|
||||||
|
result = global.get("recv_" + i);
|
||||||
|
if (result == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
log.log("TEST OK\n"); /* Report test success */
|
||||||
|
mote.getSimulation().getGUI().doQuit(false); /* Quit simulator (to end test run)*/
|
Loading…
Reference in a new issue