2009-03-11 13:25:40 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<simconf>
|
|
|
|
<project>../apps/mrm</project>
|
|
|
|
<project>../apps/mspsim</project>
|
2009-06-24 14:42:50 +00:00
|
|
|
<project>../apps/avrora</project>
|
2009-03-11 13:25:40 +00:00
|
|
|
<project>../apps/native_gateway</project>
|
|
|
|
<simulation>
|
|
|
|
<title>My simulation</title>
|
|
|
|
<delaytime>0</delaytime>
|
2009-06-24 14:42:50 +00:00
|
|
|
<randomseed>generated</randomseed>
|
|
|
|
<motedelay_us>1000000</motedelay_us>
|
2009-03-11 13:25:40 +00:00
|
|
|
<radiomedium>
|
|
|
|
se.sics.cooja.radiomediums.UDGM
|
|
|
|
<transmitting_range>50.0</transmitting_range>
|
2009-10-19 20:48:43 +00:00
|
|
|
<interference_range>50.0</interference_range>
|
2009-03-11 13:25:40 +00:00
|
|
|
<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-collect.c</source>
|
2010-02-03 21:16:13 +00:00
|
|
|
<commands>make clean TARGET=sky
|
|
|
|
make example-collect.sky TARGET=sky</commands>
|
2009-03-11 13:25:40 +00:00
|
|
|
<firmware>../../../examples/rime/example-collect.sky</firmware>
|
|
|
|
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
|
2009-06-24 14:42:50 +00:00
|
|
|
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
|
2009-03-11 13:25:40 +00:00
|
|
|
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
|
|
|
|
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
|
|
|
|
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
|
|
|
|
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface>
|
|
|
|
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface>
|
|
|
|
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface>
|
|
|
|
<moteinterface>se.sics.cooja.mspmote.interfaces.SkySerial</moteinterface>
|
|
|
|
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface>
|
|
|
|
</motetype>
|
|
|
|
<mote>
|
|
|
|
se.sics.cooja.mspmote.SkyMote
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>87.29845932913939</x>
|
|
|
|
<y>60.286214311723164</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>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>94.30809966340686</x>
|
|
|
|
<y>22.50388779326399</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>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>82.40423567500785</x>
|
|
|
|
<y>39.56979106929553</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>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>26.185019854469438</x>
|
|
|
|
<y>4.800834369523899</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>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>1.9530156130507015</x>
|
|
|
|
<y>78.3175061800706</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>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>48.35216700543414</x>
|
|
|
|
<y>80.36988713780997</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>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>24.825985087266833</x>
|
|
|
|
<y>74.27809432062487</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>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>8.356165164293616</x>
|
|
|
|
<y>94.33967355724187</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>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>45.11740613004886</x>
|
|
|
|
<y>31.7059041432301</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>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>68.9908548386292</x>
|
|
|
|
<y>55.01991960639596</y>
|
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
|
|
|
<id>10</id>
|
|
|
|
</interface_config>
|
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
se.sics.cooja.mspmote.SkyMote
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>13.181122543889046</x>
|
|
|
|
<y>55.9636533130127</y>
|
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
|
|
|
<id>11</id>
|
|
|
|
</interface_config>
|
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
se.sics.cooja.mspmote.SkyMote
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>2.1749985906538427</x>
|
|
|
|
<y>78.39666095789707</y>
|
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
|
|
|
<id>12</id>
|
|
|
|
</interface_config>
|
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
se.sics.cooja.mspmote.SkyMote
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>37.79795217518357</x>
|
|
|
|
<y>7.164284163506062</y>
|
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
|
|
|
<id>13</id>
|
|
|
|
</interface_config>
|
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
se.sics.cooja.mspmote.SkyMote
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>64.4595177394984</x>
|
|
|
|
<y>72.115414337433</y>
|
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
|
|
|
<id>14</id>
|
|
|
|
</interface_config>
|
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
se.sics.cooja.mspmote.SkyMote
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>81.85663737096085</x>
|
|
|
|
<y>89.31412706434035</y>
|
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
|
|
|
<id>15</id>
|
|
|
|
</interface_config>
|
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
se.sics.cooja.mspmote.SkyMote
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>44.74952276297882</x>
|
|
|
|
<y>18.78566116347574</y>
|
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
|
|
|
<id>16</id>
|
|
|
|
</interface_config>
|
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
se.sics.cooja.mspmote.SkyMote
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>96.11333426285873</x>
|
|
|
|
<y>90.64560410751824</y>
|
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
|
|
|
<id>17</id>
|
|
|
|
</interface_config>
|
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
se.sics.cooja.mspmote.SkyMote
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>21.651464136783527</x>
|
|
|
|
<y>7.1381043251259495</y>
|
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
|
|
|
<id>18</id>
|
|
|
|
</interface_config>
|
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
se.sics.cooja.mspmote.SkyMote
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>83.6006916200628</x>
|
|
|
|
<y>26.97170140682981</y>
|
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
|
|
|
<id>19</id>
|
|
|
|
</interface_config>
|
|
|
|
</mote>
|
|
|
|
<mote>
|
|
|
|
se.sics.cooja.mspmote.SkyMote
|
|
|
|
<motetype_identifier>sky1</motetype_identifier>
|
2009-06-24 14:42:50 +00:00
|
|
|
<breakpoints />
|
2009-03-11 13:25:40 +00:00
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.interfaces.Position
|
|
|
|
<x>1.3446070721664705</x>
|
|
|
|
<y>7.340373220385176</y>
|
|
|
|
<z>0.0</z>
|
|
|
|
</interface_config>
|
|
|
|
<interface_config>
|
|
|
|
se.sics.cooja.mspmote.interfaces.MspMoteID
|
|
|
|
<id>20</id>
|
|
|
|
</interface_config>
|
|
|
|
</mote>
|
|
|
|
</simulation>
|
|
|
|
<plugin>
|
|
|
|
se.sics.cooja.plugins.SimControl
|
2009-06-24 14:42:50 +00:00
|
|
|
<width>247</width>
|
|
|
|
<z>3</z>
|
2009-03-11 13:25:40 +00:00
|
|
|
<height>227</height>
|
|
|
|
<location_x>0</location_x>
|
|
|
|
<location_y>0</location_y>
|
|
|
|
<minimized>false</minimized>
|
|
|
|
</plugin>
|
|
|
|
<plugin>
|
2009-06-24 14:42:50 +00:00
|
|
|
se.sics.cooja.plugins.Visualizer
|
|
|
|
<plugin_config>
|
|
|
|
<skin>Mote IDs</skin>
|
|
|
|
<skin>Radio environment (UDGM)</skin>
|
|
|
|
</plugin_config>
|
|
|
|
<width>224</width>
|
|
|
|
<z>1</z>
|
|
|
|
<height>225</height>
|
|
|
|
<location_x>247</location_x>
|
|
|
|
<location_y>1</location_y>
|
2009-03-11 13:25:40 +00:00
|
|
|
<minimized>false</minimized>
|
|
|
|
</plugin>
|
|
|
|
<plugin>
|
|
|
|
se.sics.cooja.plugins.LogListener
|
|
|
|
<plugin_config>
|
|
|
|
<filter />
|
|
|
|
</plugin_config>
|
2009-06-24 14:42:50 +00:00
|
|
|
<width>469</width>
|
2009-03-11 13:25:40 +00:00
|
|
|
<z>2</z>
|
2009-06-24 14:42:50 +00:00
|
|
|
<height>473</height>
|
2009-03-11 13:25:40 +00:00
|
|
|
<location_x>0</location_x>
|
2009-06-24 14:42:50 +00:00
|
|
|
<location_y>226</location_y>
|
|
|
|
<minimized>false</minimized>
|
|
|
|
</plugin>
|
|
|
|
<plugin>
|
|
|
|
se.sics.cooja.plugins.ScriptRunner
|
|
|
|
<plugin_config>
|
|
|
|
<script>TIMEOUT(300000, log.log("Timeout\n"));
|
|
|
|
|
|
|
|
function
|
|
|
|
print_stats()
|
|
|
|
{
|
|
|
|
log.log("Received " + total_received + " messages, " +
|
|
|
|
(total_received / nrNodes) + " messages/node, " +
|
|
|
|
total_lost + " lost, " +
|
|
|
|
(total_lost / nrNodes) + " lost/node, " +
|
|
|
|
total_dups + " dups, " +
|
|
|
|
(total_dups / nrNodes) + " dups/node, " +
|
|
|
|
(total_hops / total_received) + " hops/message\n");
|
|
|
|
log.log("Seqnos: ");
|
|
|
|
for(i = 1; i <= nrNodes; i++) {
|
|
|
|
log.log(seqnos[i] + " ");
|
|
|
|
}
|
|
|
|
log.log("\n");
|
|
|
|
log.log("Lost: ");
|
|
|
|
for(i = 1; i <= nrNodes; i++) {
|
|
|
|
log.log(lost[i] + " ");
|
|
|
|
}
|
|
|
|
log.log("\n");
|
|
|
|
log.log("Dups: ");
|
|
|
|
for(i = 1; i <= nrNodes; i++) {
|
|
|
|
log.log(dups[i] + " ");
|
|
|
|
}
|
|
|
|
log.log("\n");
|
|
|
|
log.log("Hops: ");
|
|
|
|
for(i = 1; i <= nrNodes; i++) {
|
|
|
|
log.log(hops[i] + " ");
|
|
|
|
}
|
|
|
|
log.log("\n");
|
|
|
|
log.log("Received: ");
|
|
|
|
for(i = 1; i <= nrNodes; i++) {
|
|
|
|
log.log(count[i] + " ");
|
|
|
|
}
|
|
|
|
log.log("\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Conf. */
|
|
|
|
booted = new Array();
|
|
|
|
count = new Array();
|
|
|
|
hops = new Array();
|
|
|
|
seqnos = new Array();
|
|
|
|
lost = new Array();
|
|
|
|
dups = new Array();
|
|
|
|
nrNodes = 20;
|
|
|
|
total_received = 0;
|
|
|
|
total_lost = 0;
|
|
|
|
total_hops = 0;
|
|
|
|
total_dups = 0;
|
|
|
|
nodes_starting = true;
|
|
|
|
for(i = 1; i <= nrNodes; i++) {
|
|
|
|
booted[i] = false;
|
|
|
|
count[i] = 0;
|
|
|
|
hops[i] = 0;
|
|
|
|
seqnos[i] = -1;
|
|
|
|
lost[i] = 0;
|
|
|
|
dups[i] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Wait until all nodes have started */
|
|
|
|
while(nodes_starting) {
|
|
|
|
YIELD_THEN_WAIT_UNTIL(msg.startsWith('Starting'));
|
|
|
|
|
|
|
|
log.log("Node " + id + " booted\n");
|
|
|
|
booted[id] = true;
|
|
|
|
|
|
|
|
for(i = 1; i <= nrNodes; i++) {
|
|
|
|
if(!booted[i]) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if(i == nrNodes) {
|
|
|
|
nodes_starting = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Create sink */
|
2010-02-03 21:24:24 +00:00
|
|
|
sink = id;
|
|
|
|
GENERATE_MSG(1000, "continue");
|
|
|
|
YIELD_THEN_WAIT_UNTIL(msg.equals("continue"));
|
|
|
|
log.log("All nodes booted, creating sink at node " + sink + "\n");
|
2009-06-24 14:42:50 +00:00
|
|
|
mote.getInterfaces().getButton().clickButton()
|
|
|
|
|
|
|
|
while(true) {
|
|
|
|
YIELD();
|
|
|
|
|
|
|
|
/* Count sensor data packets */
|
|
|
|
if(msg.startsWith("Sink")) {
|
|
|
|
node_text = msg.split(" ")[4];
|
|
|
|
seqno_text = msg.split(" ")[6];
|
|
|
|
hops_text = msg.split(" ")[8];
|
|
|
|
if(node_text) {
|
|
|
|
source = parseInt(node_text);
|
|
|
|
seqno = parseInt(seqno_text);
|
|
|
|
hop = parseInt(hops_text);
|
|
|
|
count[source]++;
|
|
|
|
hops[source] = hop;
|
|
|
|
seqno_gap = seqno - seqnos[source];
|
|
|
|
seqnos[source] = seqno;
|
|
|
|
|
|
|
|
total_received++;
|
|
|
|
total_hops += hop;
|
|
|
|
|
|
|
|
if(seqno_gap == 2) {
|
|
|
|
total_lost += seqno_gap - 1;
|
|
|
|
lost[source] += seqno_gap - 1;
|
|
|
|
} else if(seqno_gap == 0) {
|
|
|
|
total_dups += 1;
|
|
|
|
dups[source] += 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* Fail if the sink has received more than 10 messages from any node. */
|
|
|
|
for(i = 1; i <= nrNodes; i++) {
|
|
|
|
if(count[i] > 10) {
|
|
|
|
print_stats();
|
|
|
|
log.testFailed(); /* We are done! */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Wait until the sink have received at least two messages from every node */
|
|
|
|
for(i = 1; i <= nrNodes; i++) {
|
|
|
|
if(count[i] < 2) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if(i == nrNodes) {
|
|
|
|
print_stats();
|
|
|
|
log.testOK();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
print_stats();
|
|
|
|
}
|
|
|
|
}</script>
|
|
|
|
<active>true</active>
|
|
|
|
</plugin_config>
|
|
|
|
<width>600</width>
|
|
|
|
<z>0</z>
|
|
|
|
<height>700</height>
|
|
|
|
<location_x>469</location_x>
|
|
|
|
<location_y>0</location_y>
|
2009-03-11 13:25:40 +00:00
|
|
|
<minimized>false</minimized>
|
|
|
|
</plugin>
|
|
|
|
</simconf>
|
|
|
|
|