[Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/TestMultihopLqi CC2420ActiveMessageC.nc, 1.1, 1.2 MultihopOscilloscope.h, 1.1, 1.2 MultihopOscilloscopeAppC.nc, 1.1, 1.2 MultihopOscilloscopeC.nc, 1.1, 1.2 script.py, 1.1, 1.2

Phil Levis scipio at users.sourceforge.net
Wed Jul 4 08:52:03 PDT 2007


Update of /cvsroot/tinyos/tinyos-2.x/apps/tests/TestMultihopLqi
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30258

Modified Files:
	CC2420ActiveMessageC.nc MultihopOscilloscope.h 
	MultihopOscilloscopeAppC.nc MultihopOscilloscopeC.nc script.py 
Log Message:
Updated test code and scripts.


Index: CC2420ActiveMessageC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestMultihopLqi/CC2420ActiveMessageC.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CC2420ActiveMessageC.nc	12 Apr 2007 23:23:58 -0000	1.1
--- CC2420ActiveMessageC.nc	4 Jul 2007 15:51:54 -0000	1.2
***************
*** 60,63 ****
      return (uint8_t)sig;
    }
!   
  }
--- 60,68 ----
      return (uint8_t)sig;
    }
!   async command cc2420_header_t* Packet.getHeader(message_t* msg) {
!     return NULL;
!   }  
!   async command cc2420_metadata_t* Packet.getMetadata(message_t* msg) {
!     return NULL;
!   }  
  }

Index: MultihopOscilloscope.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestMultihopLqi/MultihopOscilloscope.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MultihopOscilloscope.h	12 Apr 2007 23:23:58 -0000	1.1
--- MultihopOscilloscope.h	4 Jul 2007 15:51:55 -0000	1.2
***************
*** 22,26 ****
    NREADINGS = 5,
    /* Default sampling period. */
!   DEFAULT_INTERVAL = 1024,
    AM_OSCILLOSCOPE = 0x93
  };
--- 22,26 ----
    NREADINGS = 5,
    /* Default sampling period. */
!   DEFAULT_INTERVAL = 200,
    AM_OSCILLOSCOPE = 0x93
  };

Index: MultihopOscilloscopeAppC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestMultihopLqi/MultihopOscilloscopeAppC.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MultihopOscilloscopeAppC.nc	12 Apr 2007 23:23:58 -0000	1.1
--- MultihopOscilloscopeAppC.nc	4 Jul 2007 15:51:55 -0000	1.2
***************
*** 58,64 ****
    // Components for debugging collection.
    //
!   /*  components new PoolC(message_t, 20) as DebugMessagePool,
      new QueueC(message_t*, 20) as DebugSendQueue,
!     new SerialAMSenderC(AM_CTP_DEBUG) as DebugSerialSender,
      UARTDebugSenderP as DebugSender;
  
--- 58,64 ----
    // Components for debugging collection.
    //
!    components new PoolC(message_t, 20) as DebugMessagePool,
      new QueueC(message_t*, 20) as DebugSendQueue,
!     new SerialAMSenderC(AM_LQI_DEBUG) as DebugSerialSender,
      UARTDebugSenderP as DebugSender;
  
***************
*** 67,70 ****
    DebugSender.MessagePool -> DebugMessagePool;
    DebugSender.SendQueue -> DebugSendQueue;
!   Collector.CollectionDebug -> DebugSender;*/
  }
--- 67,70 ----
    DebugSender.MessagePool -> DebugMessagePool;
    DebugSender.SendQueue -> DebugSendQueue;
!   Collector.CollectionDebug -> DebugSender;
  }

Index: MultihopOscilloscopeC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestMultihopLqi/MultihopOscilloscopeC.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MultihopOscilloscopeC.nc	12 Apr 2007 23:23:58 -0000	1.1
--- MultihopOscilloscopeC.nc	4 Jul 2007 15:51:55 -0000	1.2
***************
*** 79,83 ****
      local.id = TOS_NODE_ID;
      local.version = 0;
! 
      // Beginning our initialization phases:
      if (call RadioControl.start() != SUCCESS)
--- 79,83 ----
      local.id = TOS_NODE_ID;
      local.version = 0;
!     dbg("App", "Booted.");
      // Beginning our initialization phases:
      if (call RadioControl.start() != SUCCESS)
***************
*** 128,131 ****
--- 128,139 ----
      oscilloscope_t* in = (oscilloscope_t*)payload;
      oscilloscope_t* out;
+     dbg("App", "Received a packet.\n\t");
+     {
+       int i;
+       for (i = 0; i < len; i++) {
+         dbg_clear("App", "[%hhx] ", ((uint8_t*)payload)[i]);
+       }
+       dbg_clear("App", "\n");
+     }
      if (uartbusy == FALSE) {
        out = (oscilloscope_t*)call SerialSend.getPayload(&uartbuf);
***************
*** 227,232 ****
  	oscilloscope_t *o = (oscilloscope_t *)call Send.getPayload(&sendbuf);
  	memcpy(o, &local, sizeof(local));
! 	if (call Send.send(&sendbuf, sizeof(local)) == SUCCESS)
  	  sendbusy = TRUE;
          else
            report_problem();
--- 235,242 ----
  	oscilloscope_t *o = (oscilloscope_t *)call Send.getPayload(&sendbuf);
  	memcpy(o, &local, sizeof(local));
! 	if (call Send.send(&sendbuf, sizeof(local)) == SUCCESS) {
!           dbg("App", "Sending a packet.\n");
  	  sendbusy = TRUE;
+         }
          else
            report_problem();

Index: script.py
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestMultihopLqi/script.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** script.py	12 Apr 2007 23:23:59 -0000	1.1
--- script.py	4 Jul 2007 15:51:55 -0000	1.2
***************
*** 12,20 ****
  #t.addChannel("CpmModelC", sys.stdout)
  #t.addChannel("Gain", sys.stdout)
! #t.addChannel("AM", sys.stdout)
  #t.addChannel("LQI", sys.stdout)
- t.addChannel("LQIRoute", sys.stdout)
- t.addChannel("LQIDeliver", sys.stdout)
  #t.addChannel("LQIRoute", sys.stdout)
  
  start = time.time();
--- 12,22 ----
  #t.addChannel("CpmModelC", sys.stdout)
  #t.addChannel("Gain", sys.stdout)
! t.addChannel("AM", sys.stdout)
! t.addChannel("App", sys.stdout)
  #t.addChannel("LQI", sys.stdout)
  #t.addChannel("LQIRoute", sys.stdout)
+ #t.addChannel("LQIDeliver", sys.stdout)
+ #t.addChannel("LQIRoute", sys.stdout)
+ #t.addChannel("PointerBug", sys.stdout)
  
  start = time.time();
***************
*** 45,49 ****
  for i in range(0, 7):
      t.getNode(i).createNoiseModel();
!     t.getNode(i).bootAtTime(random.random() * 10000000 + 20000000);
  
  duration = end - start;
--- 47,51 ----
  for i in range(0, 7):
      t.getNode(i).createNoiseModel();
!     t.getNode(i).bootAtTime(int(random.random() * 10000000 + 20000000));
  
  duration = end - start;
***************
*** 53,56 ****
  #    print m1.generateNoise(i)
  
! for i in range(0, 1000000):
      t.runNextEvent();
--- 55,58 ----
  #    print m1.generateNoise(i)
  
! for i in range(0, 2000):
      t.runNextEvent();



More information about the Tinyos-2-commits mailing list