2009-01-08 18:11:06 +01:00
|
|
|
TIMEOUT(100000, log.log("Node 1: " + nr_packets[1] + ".\nNode 2: " + nr_packets[2] + ".\n"));
|
2008-10-02 23:18:59 +02:00
|
|
|
|
2009-01-08 18:11:06 +01:00
|
|
|
nr_packets = new Array();
|
|
|
|
nr_packets[1] = 0;
|
|
|
|
nr_packets[2] = 0;
|
2008-10-02 23:18:59 +02:00
|
|
|
|
2009-01-08 18:11:06 +01: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 16:17:44 +01:00
|
|
|
}
|
2009-01-08 18:11:06 +01:00
|
|
|
|
2008-10-02 23:18:59 +02:00
|
|
|
}
|
|
|
|
|
2009-01-08 18:11:06 +01:00
|
|
|
|