[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/tossim TossimActiveMessageP.nc, 1.1.2.6, 1.1.2.7 TossimPacketModelC.nc, 1.1.2.4, 1.1.2.5 UscGainInterferenceModelC.nc, 1.1.2.6, 1.1.2.7

Phil Levis scipio at users.sourceforge.net
Mon May 15 09:39:21 PDT 2006


Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/tossim
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv8863/tossim

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	TossimActiveMessageP.nc TossimPacketModelC.nc 
	UscGainInterferenceModelC.nc 
Log Message:
Fix for acknowledgments (from Megan Wachs).



Index: TossimActiveMessageP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/tossim/Attic/TossimActiveMessageP.nc,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -C2 -d -r1.1.2.6 -r1.1.2.7
*** TossimActiveMessageP.nc	16 Mar 2006 19:59:11 -0000	1.1.2.6
--- TossimActiveMessageP.nc	15 May 2006 16:39:18 -0000	1.1.2.7
***************
*** 121,124 ****
--- 121,125 ----
      tossim_header_t* header = getHeader(msg);
      if (header->addr == call amAddress()) {
+       dbg("Acks", "addressed to me so ack it,");
        return TRUE;
      }

Index: TossimPacketModelC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/tossim/Attic/TossimPacketModelC.nc,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** TossimPacketModelC.nc	5 Apr 2006 18:21:02 -0000	1.1.2.4
--- TossimPacketModelC.nc	15 May 2006 16:39:18 -0000	1.1.2.5
***************
*** 179,187 ****
      // sim_time per symbol.
      sim_time_t backoff = sim_random();
-     dbg("TossimPacketModelC", "Starting CMSA.\n");
      backoff %= (sim_csma_init_high() - sim_csma_init_low());
      backoff += sim_csma_init_low();
      backoff *= (sim_ticks_per_sec() / sim_csma_symbols_per_sec());
! 
      first_sample = sim_time() + backoff;
  
--- 179,186 ----
      // sim_time per symbol.
      sim_time_t backoff = sim_random();
      backoff %= (sim_csma_init_high() - sim_csma_init_low());
      backoff += sim_csma_init_low();
      backoff *= (sim_ticks_per_sec() / sim_csma_symbols_per_sec());
!     dbg("TossimPacketModelC", "Starting CMSA with %lli.\n", backoff);
      first_sample = sim_time() + backoff;
  

Index: UscGainInterferenceModelC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/tossim/Attic/UscGainInterferenceModelC.nc,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -C2 -d -r1.1.2.6 -r1.1.2.7
*** UscGainInterferenceModelC.nc	16 Mar 2006 19:59:11 -0000	1.1.2.6
--- UscGainInterferenceModelC.nc	15 May 2006 16:39:18 -0000	1.1.2.7
***************
*** 164,171 ****
      
      if (!mine->lost) {
!       dbg_clear("Gain", "  -signaling reception.\n");
        signal Model.receive(mine->msg);
        // If we scheduled an ack, receiving = 0 when it completes
        if (mine->ack && signal Model.shouldAck(mine->msg)) {
  	sim_gain_schedule_ack(mine->source, sim_time() + 1); 
        }
--- 164,178 ----
      
      if (!mine->lost) {
!       dbg_clear("Gain", "  -signaling reception, ");
        signal Model.receive(mine->msg);
+       if (mine->ack) {
+         dbg_clear("Gain", " acknowledgment requested, ");
+       }
+       else {
+         dbg_clear("Gain", " no acknowledgment requested.\n");
+       }
        // If we scheduled an ack, receiving = 0 when it completes
        if (mine->ack && signal Model.shouldAck(mine->msg)) {
+         dbg_clear("Gain", " scheduling ack.\n");
  	sim_gain_schedule_ack(mine->source, sim_time() + 1); 
        }
***************
*** 195,198 ****
--- 202,206 ----
      rcv->msg = msg;
      rcv->lost = 0;
+     rcv->ack = receive;
      
      // If I'm off, I never receive the packet, but I need to keep track of



More information about the Tinyos-2-commits mailing list