2009-01-08 18:11:06 +01:00
|
|
|
TIMEOUT(120000);
|
2008-11-03 15:05:30 +01:00
|
|
|
|
2009-01-08 18:11:06 +01:00
|
|
|
var nr_packets = new Array();
|
|
|
|
for (i=1; i <= 10; i++) {
|
|
|
|
nr_packets[i] = 0;
|
2008-11-03 15:05:30 +01:00
|
|
|
}
|
|
|
|
|
2009-01-08 18:11:06 +01:00
|
|
|
while (true) {
|
|
|
|
|
|
|
|
/* Listen for receive notifications */
|
|
|
|
if (msg.contains('abc message received')) {
|
2008-11-03 15:05:30 +01:00
|
|
|
|
2009-01-08 18:11:06 +01:00
|
|
|
/* Log receiving node */
|
|
|
|
nr_packets[id] ++;
|
|
|
|
log.log("Node " + id + " received message: " + nr_packets[id] + "\n");
|
2009-05-26 16:05:35 +02:00
|
|
|
|
|
|
|
log.log("TEST STATUS: ");
|
|
|
|
for (i = 1; i <= 10; i++) {
|
|
|
|
log.log(nr_packets[i] + " ");
|
|
|
|
}
|
|
|
|
log.log("\n");
|
2008-11-03 15:05:30 +01:00
|
|
|
}
|
|
|
|
|
2009-01-08 18:11:06 +01:00
|
|
|
/* Did all nodes (1-10) receive at least one message? */
|
|
|
|
for (i = 1; i <= 10; i++) {
|
2009-05-26 16:05:35 +02:00
|
|
|
if (nr_packets[i] < 1) break;
|
|
|
|
if (i == 10) log.testOK();
|
2009-01-08 18:11:06 +01:00
|
|
|
}
|
2008-11-03 15:05:30 +01:00
|
|
|
|
2009-01-08 18:11:06 +01:00
|
|
|
YIELD();
|
|
|
|
}
|