Hi Mohammed,

 

The solution and explanation given to my problem seems to solve my problem. I 
very much appreciate your help. I will try it and get back to you if I need 
further assistance. Thank you.

 

Kind regards,

Imran Shafique Ansari
 




Date: Thu, 9 Jul 2009 15:33:01 -0400
From: [email protected]
To: [email protected]
Subject: Re: [Tinyos-help] Acknowledgments (Mohammed Biloo)

Hi Imran, 

What you could do is create a 16-bit variable that is used as a packet counter 
and include that as part of the structure of the data. In other words, in your 
header file, packet_counter would be a field of the struct. On the transmitter 
side, you would initialize the variable in Boot.booted to 0. In 
Receive.receive, you could have the following (in pseudocode):

if (received_packet_counter == Current local counter)
   if (current local counter == 2^16-1) % Just in case
      { Current local counter = 0; }
  if (current local counter != 2^16-1)
  { Current local counter ++; }
   AMSend.send (next packet)
end

On the receive side, you could send acknowledgments by updating the 
packet_counter field of the struct based on the data received. So, in the 
receivers Receive.receive, you could have:

Current local counter = Received packet counter; 
AMSend.Send acknowldgement with packet counter = Current local counter
You could differentiate between transmissions and acknowledgements by having 
another field in the structure called "packet_type" and set it to 1 if it's a 
transmission or set it to 0 if an acknowledgment, and have appropriate if 
statements in the Receive.receive of transmitter and receiver. 

Hope that helps, feel free to contact me if you need any more help. 

Cheers,
-- 
Mohammed Billoo
_________________________________________________________________
Windows Live™ SkyDrive™: Get 25 GB of free online storage.
http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to