]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Clear out the packets.
authorscipio <scipio>
Tue, 19 Feb 2008 19:54:34 +0000 (19:54 +0000)
committerscipio <scipio>
Tue, 19 Feb 2008 19:54:34 +0000 (19:54 +0000)
apps/BaseStation/BaseStationP.nc

index 3395508ea731a97fc8c2dcf6350152c101eb14f8..a024da10f247cef04e408293640e090894ae45db 100644 (file)
@@ -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