task void uartSendTask() {
uint8_t len;
am_id_t id;
- am_addr_t addr;
+ am_addr_t dest;
+ am_addr_t src;
message_t* msg;
atomic
if (uartIn == uartOut && !uartFull)
msg = uartQueue[uartOut];
tmpLen = len = call RadioPacket.payloadLength(msg);
id = call RadioAMPacket.type(msg);
- addr = call RadioAMPacket.destination(msg);
-
- if (call UartSend.send[id](addr, uartQueue[uartOut], len) == SUCCESS)
+ dest = call RadioAMPacket.destination(msg);
+ src = call RadioAMPacket.source(msg);
+ call UartAMPacket.setSource(msg, src);
+
+ if (call UartSend.send[id](dest, uartQueue[uartOut], len) == SUCCESS)
call Leds.led1Toggle();
else
{
task void radioSendTask() {
uint8_t len;
am_id_t id;
- am_addr_t addr;
+ am_addr_t dest;
+ am_addr_t src;
message_t* msg;
atomic
msg = radioQueue[radioOut];
len = call UartPacket.payloadLength(msg);
- addr = call UartAMPacket.destination(msg);
+ dest = call UartAMPacket.destination(msg);
id = call UartAMPacket.type(msg);
- if (call RadioSend.send[id](addr, msg, len) == SUCCESS)
+ src = call UartAMPacket.source(msg);
+ call RadioAMPacket.setSource(msg, src);
+ if (call RadioSend.send[id](dest, msg, len) == SUCCESS)
call Leds.led0Toggle();
else
{