On Jan 15, 2007, at 2:17 PM, ricardo tiago wrote:

Hi,

I'm trying to send a msg from one mote to another. Mote A has a msg in a buffer that will send to mote B. Everything works , except in one situation where mote A sends to mote B, but the msg doesn't get there and consequently no ack, then in sendDone i repost the task of the msg.

The weird thing is that when i repost the task, the addr should be B, but for some weird reason the var addr in the repost becomes mote A addr and enters an infinite loop.

I haven't tested this in real motes, only in tossim, here's a part of the simulation:

Well , i found why that was happening , tks to Miguel for the help. I was sending the msg but it never got there, nevertheless the radio layer changed the source , and i wasn't saving the old one.
This line in SendDone solved my problem:
"call AMPacket.setSource(msg, call AMPacket.destination(msg))".

Maybe this can help anyone that may have the same/similar problem.

The radio stack would only change the source if it used the buffer to receive a new packet. Don't forget that the reception path uses a buffer swap. So you can't just keep a handle on the pointer, unless you pass it a new buffer to use...

Phil
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to