event void AMControl.startDone(error_t err) {
if (err == SUCCESS) {
- error_t e;
- do {
- e = call LogRead.read(&m_entry, sizeof(logentry_t));
- } while (e != SUCCESS);
+ if (call LogRead.read(&m_entry, sizeof(logentry_t)) != SUCCESS) {
+ // Handle error.
+ }
}
else {
call AMControl.start();
event void Send.sendDone(message_t* msg, error_t err) {
call Leds.led1Off();
if ( (err == SUCCESS) && (msg == &m_entry.msg) ) {
- error_t e;
call Packet.clear(&m_entry.msg);
- do {
- e = call LogRead.read(&m_entry, sizeof(logentry_t));
- } while (e != SUCCESS);
+ if (call LogRead.read(&m_entry, sizeof(logentry_t)) != SUCCESS) {
+ // Handle error.
+ }
}
else {
call Timer0.startOneShot(INTER_PACKET_INTERVAL);
Known bugs/limitations:
Only works on motes with the CC2420 radio. Tested and verified with
- TelosB and Tmote nodes. Also works with MicaZ (as the BlinkToRadio
- node) and TelosB/Tmote as the parrot node. Currently, using a MicaZ
- as the parrot does not work and needs to be debugged.
+ TelosB, Tmote, and MicaZ nodes.