From: scipio Date: Tue, 19 Feb 2008 19:54:34 +0000 (+0000) Subject: Clear out the packets. X-Git-Tag: release_tinyos_2_1_0_0~518 X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=commitdiff_plain;h=9853b0475b27e557bd44f35a88432adee6f66de1;p=tinyos-2.x.git Clear out the packets. --- diff --git a/apps/BaseStation/BaseStationP.nc b/apps/BaseStation/BaseStationP.nc index 3395508e..a024da10 100644 --- a/apps/BaseStation/BaseStationP.nc +++ b/apps/BaseStation/BaseStationP.nc @@ -191,6 +191,7 @@ implementation id = call RadioAMPacket.type(msg); addr = call RadioAMPacket.destination(msg); src = call RadioAMPacket.source(msg); + call RadioAMPacket.clear(msg); call UartAMPacket.setSource(msg, src); if (call UartSend.send[id](addr, uartQueue[uartOut], len) == SUCCESS) @@ -253,7 +254,7 @@ implementation task void radioSendTask() { uint8_t len; am_id_t id; - am_addr_t addr; + am_addr_t addr,source; message_t* msg; atomic @@ -266,7 +267,12 @@ implementation msg = radioQueue[radioOut]; len = call UartPacket.payloadLength(msg); addr = call UartAMPacket.destination(msg); + source = call UartAMPacket.source(msg); id = call UartAMPacket.type(msg); + + call RadioAMPacket.clear(msg); + call RadioAMPacket.setSource(msg, source); + if (call RadioSend.send[id](addr, msg, len) == SUCCESS) call Leds.led0Toggle(); else