[Tinyos-beta-commits] CVS: tinyos-1.x/beta/Drain DrainM.nc, 1.14, 1.15

Gilman Tolle gtolle at users.sourceforge.net
Tue Jul 5 18:52:46 PDT 2005


Update of /cvsroot/tinyos/tinyos-1.x/beta/Drain
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21343

Modified Files:
	DrainM.nc 
Log Message:
Drain ordinarily doesn't wait for an ACK when it's transmitting to the final destination, because this destination might be a TOSBase that doesn't ACK. Now there's an attribute you can change to enable ACKs for the last hop, if you know that you're using an ACKing TOSBase. Last-hop ACKs drastically improve the message success rate.

Index: DrainM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Drain/DrainM.nc,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** DrainM.nc	16 Jun 2005 17:46:30 -0000	1.14
--- DrainM.nc	6 Jul 2005 01:52:44 -0000	1.15
***************
*** 37,40 ****
--- 37,43 ----
      interface Intercept[uint8_t id];
      interface Intercept as Snoop[uint8_t id];
+     
+     interface Attr<bool> as DrainBaseAcks @nucleusAttr("DrainBaseAcks");
+     interface AttrSet<bool> as DrainBaseAcksSet @nucleusAttr("DrainBaseAcks");
    }
    uses {
***************
*** 78,81 ****
--- 81,86 ----
    bool queuesBusy;
  
+   bool baseAcks;
+ 
    uint8_t backoff;
  
***************
*** 391,402 ****
        // It didn't have a destination.
  
! #ifndef DRAIN_BASE_ACKS
! 
!     } else if (mhMsg->dest == pMsg->addr) {
!       
!       // It's for the destination. This might be a TOSBase. TOSBase
!       // does not currently do acks. This ugliness will go away.
        
! #endif
  
      } else {
--- 396,403 ----
        // It didn't have a destination.
  
!     } else if (mhMsg->dest == pMsg->addr && !baseAcks) {
        
!       // It's for the destination. This might be a TOSBase that
!       // doesn't know how to ACK packets.
  
      } else {
***************
*** 459,462 ****
--- 460,475 ----
    }
  
+   command result_t DrainBaseAcks.get(bool* buf) {
+     memcpy(buf, &baseAcks, sizeof(bool));
+     signal DrainBaseAcks.getDone(buf);
+     return SUCCESS;
+   }
+ 
+   command result_t DrainBaseAcksSet.set(bool* buf) {
+     memcpy(&baseAcks, buf, sizeof(bool));
+     signal DrainBaseAcksSet.setDone(buf);
+     return SUCCESS;
+   }
+ 
    default event result_t Send.sendDone[uint8_t id](TOS_MsgPtr pMsg, 
  						   result_t success) {



More information about the Tinyos-beta-commits mailing list