I: [Tinyos-help] SendMsg

Cucco Cristiano cristiano.cucco at guest.telecomitalia.it
Wed Nov 15 01:46:22 PST 2006


Hi,
I got exactly the same problem.
My questions are:

1) Is there a component implementing a queued SendMsg/ReceiveMsg in Tinyos 1.x ?

2) I read there is a conflict between SendMsg and ReceiveMsg as they use the same buffer to store the incoming and leaving message, making it hard to send and receive at the same time. Is it true?

Thank you in advance,
Cristiano


-----Messaggio originale-----
Da: tinyos-help-bounces at Millennium.Berkeley.EDU per conto di Philip Levis
Inviato: mer 15/11/2006 0.30
A: ricardo tiago
Cc: tinyos-help at Millennium.Berkeley.EDU
Oggetto: Re: [Tinyos-help] SendMsg
 
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
Tinyos-help at Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help





More information about the Tinyos-help mailing list