2009-01-08 17:11:06 +00:00
|
|
|
TIMEOUT(100000, log.log("Node 1: " + nr_packets[1] + ".\nNode 2: " + nr_packets[2] + ".\n"));
|
2008-10-02 21:18:59 +00:00
|
|
|
|
2009-01-08 17:11:06 +00:00
|
|
|
nr_packets = new Array();
|
|
|
|
nr_packets[1] = 0;
|
|
|
|
nr_packets[2] = 0;
|
2008-10-02 21:18:59 +00:00
|
|
|
|
2009-01-08 17:11:06 +00:00
|
|
|
while (true) {
|
|
|
|
/* Only handle receive messages */
|
|
|
|
YIELD_THEN_WAIT_UNTIL(msg.contains('received'));
|
|
|
|
|
|
|
|
/* Count received packets */
|
|
|
|
nr_packets[id]++;
|
|
|
|
//log.log("Node " + id + " received " + nr_packets[id] + " messages\n");
|
|
|
|
|
|
|
|
if (nr_packets[1] >= 30 && nr_packets[2] >= 30) {
|
|
|
|
log.log("Node 1: " + nr_packets[1] + ".\nNode 2: " + nr_packets[2] + ".\n");
|
|
|
|
log.testOK(); /* Report test success */
|
2008-11-11 15:17:44 +00:00
|
|
|
}
|
2009-01-08 17:11:06 +00:00
|
|
|
|
2008-10-02 21:18:59 +00:00
|
|
|
}
|
|
|
|
|
2009-01-08 17:11:06 +00:00
|
|
|
|