mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-08-16 22:28:59 +00:00
23 lines
496 B
JavaScript
23 lines
496 B
JavaScript
TIMEOUT(200000, log.log("last message: " + msg + "\n"));
|
|
|
|
data = 0;
|
|
alive = 0;
|
|
while(true) {
|
|
YIELD();
|
|
if(msg.startsWith('Data')) {
|
|
data++;
|
|
log.log("Heard " + data + " data messages\n");
|
|
}
|
|
if(msg.startsWith('Alive')) {
|
|
alive++;
|
|
log.log("Heard " + alive + " alive messages\n");
|
|
}
|
|
if(data == 0 && alive == 10) {
|
|
if(msg.startsWith('Alive 10')) {
|
|
log.testOK();
|
|
} else {
|
|
log.testError();
|
|
}
|
|
}
|
|
}
|