On 11/15/06, Philip Levis <[EMAIL PROTECTED]> wrote:
2
On Nov 14, 2006, at 12:58 PM, ricardo tiago wrote:
> Hi
> i've made a program that sends 3 messages to his neighbors, but if
> i send the messages in a consecutive way , only the last message is
> received. If i send the first message then wait a x'time , send the
> second message and wait again the x'time, etc, the 3 messages are
> received by the 3 nodes.
>
> Sending 3 consecutive messages...
> for ( NeighsPos = 0; NeighsPos < size ; NeighsPos ++) {
> dbg("DominantSet","Sending Packet Neighbor Table to Neighbor %d
> \n",Neighs[NeighsPos]);
> call AMSend.send(Neighs[NeighsPos],&pkt,sizeof(DominantSetMsg));
> }
>
> i get in TOSSIM ...
> DEBUG (2): Sending Packet Neighbor Table to Neighbor 0
> DEBUG (2): Sending Packet Neighbor Table to Neighbor 1
> DEBUG (2): Sending Packet Neighbor Table to Neighbor 3
>
> Only the last Neighbor 3 receives the message. I think i know what
> is the problem. Its probably because i'm not waiting for SendDone
> before calling again AMSend.send. But isn't there a queue
> associated with the command send? or am i wrong?
There is a queue: it's depth one. You cannot call send twice in a
row. You must wait for sendDone. You can safely call send() in the
sendDone() event. If you want a deeper queue you need to instantiate
a QueueC and probably a PoolC so you have more than one buffer.
Please read TEP 116: Packet Protocols.
Phil
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
--
Regards,
Tie
_______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
