osd-contiki/tools/cooja/contiki_tests/rime_trickle.js

26 lines
855 B
JavaScript
Raw Normal View History

2009-01-08 18:11:06 +01:00
TIMEOUT(120000, log.log(nr_packets[1] + ", " + nr_packets[2] + ", " + nr_packets[3] + ", " + nr_packets[4] + ", " + nr_packets[5] + ", " + nr_packets[6] + ", " + nr_packets[7] + ", " + nr_packets[8] + ", " + nr_packets[9] + ", " + nr_packets[10] + "\n"));
2009-01-08 18:11:06 +01:00
nr_packets = new Array();
for (i=1; i <= 10; i++) {
nr_packets[i] = 0;
}
2009-01-08 18:11:06 +01:00
WAIT_UNTIL(id == 1 && msg.contains('Starting'));
log.log("Node 1 started. Clicking node button.\n");
mote.getInterfaces().getButton().clickButton()
while (true) {
/* Only handle receive messages */
2009-01-08 18:46:25 +01:00
YIELD_THEN_WAIT_UNTIL(msg.contains('received'));
2009-01-08 18:11:06 +01:00
/* Remember receiving node */
log.log(id + " received a message\n");
nr_packets[id]++;
2009-01-08 18:11:06 +01:00
/* Did all nodes (2-10) receive a message? */
for (i = 2; i <= 10; i++) {
if (nr_packets[i] < 1) break;
if (i == 10) log.testOK(); /* Report test success */
}
}