[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/tossim UscGainInterferenceModelC.nc, 1.4, 1.5

Phil Levis scipio at users.sourceforge.net
Thu Mar 29 17:28:02 PDT 2007


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

Modified Files:
	UscGainInterferenceModelC.nc 
Log Message:
Add some comments and fix a bug for concurrent receptions.


Index: UscGainInterferenceModelC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/tossim/UscGainInterferenceModelC.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** UscGainInterferenceModelC.nc	12 Dec 2006 18:23:32 -0000	1.4
--- UscGainInterferenceModelC.nc	30 Mar 2007 00:27:59 -0000	1.5
***************
*** 135,138 ****
--- 135,140 ----
      receive_message_t* list = outstandingReceptionHead;
      dbg("Gain", "Handling reception event @ %s.\n", sim_time_string());
+     // Scan the list for the node which precedes the one pointing
+     // to the received packet.
      while (list != NULL) {
        if (list->next == mine) {
***************
*** 140,144 ****
        }
        if (list != mine) {
! 	if ((list->power - sim_gain_sensitivity()) < heardSignal()) {
  	  dbg("Gain", "Lost packet from %i as I concurrently received a packet stronger than %lf\n", list->source, list->power);
  	  list->lost = 1;
--- 142,146 ----
        }
        if (list != mine) {
! 	if ((list->power - sim_gain_sensitivity()) < mine->power) {
  	  dbg("Gain", "Lost packet from %i as I concurrently received a packet stronger than %lf\n", list->source, list->power);
  	  list->lost = 1;
***************
*** 147,150 ****
--- 149,155 ----
        list = list->next;
      }
+     // Remove the received packet from the oustanding list by updating
+     // the list pointers: A->B->C becomes A->C. If the received packet
+     // is the head of the queue, then update the head pointer.
      if (predecessor) {
        predecessor->next = mine->next;
***************
*** 156,160 ****
        dbgerror("Gain", "Incoming packet list structure is corrupted: entry is not the head and no entry points to it.\n");
      }
! 
      if ((mine->power - sim_gain_sensitivity()) < heardSignal()) {
        dbg("Gain", "Lost packet from %i as its power %lf was below sensitivity threshold\n", mine->source, mine->power);
--- 161,168 ----
        dbgerror("Gain", "Incoming packet list structure is corrupted: entry is not the head and no entry points to it.\n");
      }
!     // Because the packet has been removed from the queue, it is not
!     // included in heardSignal(): this line tests if the Signal of the
!     // packet is above the threshold over the Noise of all other RF
!     // energy sources (local noise, other packets, etc.).
      if ((mine->power - sim_gain_sensitivity()) < heardSignal()) {
        dbg("Gain", "Lost packet from %i as its power %lf was below sensitivity threshold\n", mine->source, mine->power);



More information about the Tinyos-2-commits mailing list