From 795ed9bd632111d54581771a9c1b760c411adbfb Mon Sep 17 00:00:00 2001 From: prabal Date: Thu, 19 Apr 2007 07:39:18 +0000 Subject: [PATCH 1/1] Bugfix. Now works with MicaZ nodes as the PacketParrot --- apps/tutorials/PacketParrot/PacketParrotP.nc | 14 ++++++-------- apps/tutorials/PacketParrot/README.txt | 4 +--- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/apps/tutorials/PacketParrot/PacketParrotP.nc b/apps/tutorials/PacketParrot/PacketParrotP.nc index 730cfd68..926dca3d 100644 --- a/apps/tutorials/PacketParrot/PacketParrotP.nc +++ b/apps/tutorials/PacketParrot/PacketParrotP.nc @@ -64,10 +64,9 @@ implementation { 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(); @@ -97,11 +96,10 @@ implementation { 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); diff --git a/apps/tutorials/PacketParrot/README.txt b/apps/tutorials/PacketParrot/README.txt index 184dfa3b..57d8e215 100644 --- a/apps/tutorials/PacketParrot/README.txt +++ b/apps/tutorials/PacketParrot/README.txt @@ -55,6 +55,4 @@ Tools: 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. -- 2.39.2