[Tinyos-help] Help regarding usage of PacketLink for Software Acks

Razvan Musaloiu-E. razvanm at cs.jhu.edu
Sun Jan 18 17:06:40 PST 2009


Hi!

On Sun, 18 Jan 2009, Nithin Kumar Dara wrote:

> Hi,
>
> Iam trying to use software ACKs to achieve some degree of guaranteed
> delivery. This is my understanding. Can you please correct me if iam wrong?
>
> First we need to set the auto acks for CC2420 radio.
> by calling CC2420.setAutoAck(TRUE,FALSE)
> and then call CC2420.sync()
> (both at the sender side and receiver side)

The acks (software acks to be more precise) are enabled by default in the 
CC2420 stack so you don't really need the above calls.

> before each message_t msg is sent. i have to call
> PacketLink.setRetries(&msg,10); (for 10 attempts)
> PacketLink.setRetryDelay(&msg,1000); (the delay before which another
> attempt is made if ACK is not delivered.)
> PacketAcknowledgement.requestACK(&msg);
> and then i call AMSend.send to send the packet to a destination node.
>
> Is there anything more i have to do at the receiving side?

The PacketLink is calling the PacketAcknowledgement.requestACK (take a 
look at Send.send from /chips/cc2420/link/PacketLinkP.nc) so you don't 
need to do it.

> I have defined the macro PACKET_LINK in the makefile to additionally
> compile the optional PacketLink layer into the CC2420 stack.

Yup, you need this in order for the PacketLink.setRetries/setRetryDelay to 
have any effect.

> Where in the code should i call PacketLink.wasDelivered(&buffer) to
> ensure whether the packet is delivered or not?
>

You should call it in AMSend.sendDone. :-)

All the best!
Razvan ME


More information about the Tinyos-help mailing list