]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Updated test code and scripts.
authorscipio <scipio>
Wed, 4 Jul 2007 15:51:54 +0000 (15:51 +0000)
committerscipio <scipio>
Wed, 4 Jul 2007 15:51:54 +0000 (15:51 +0000)
apps/tests/TestMultihopLqi/CC2420ActiveMessageC.nc
apps/tests/TestMultihopLqi/MultihopOscilloscope.h
apps/tests/TestMultihopLqi/MultihopOscilloscopeAppC.nc
apps/tests/TestMultihopLqi/MultihopOscilloscopeC.nc
apps/tests/TestMultihopLqi/script.py

index 07890b1605e2d3197c90289cf739cb816dc62f23..ad1228af940df401f65057c31105b1e0947619ab 100644 (file)
@@ -59,5 +59,10 @@ implementation {
     
     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 5f04053921da7d7eb56ffca1fc5ad93f6029e8e6..29ebb8b7eb0ffbcefa05279586b4dc6acb8675ec 100644 (file)
@@ -21,7 +21,7 @@ enum {
      increase the message_t size. */
   NREADINGS = 5,
   /* Default sampling period. */
-  DEFAULT_INTERVAL = 1024,
+  DEFAULT_INTERVAL = 200,
   AM_OSCILLOSCOPE = 0x93
 };
 
index 74540f185a89ccfa180f614847c02b2468deb4a2..d2f0e48292776ee5094bb60fb6f91dc37df479cc 100644 (file)
@@ -57,14 +57,14 @@ implementation {
   //
   // Components for debugging collection.
   //
-  /*  components new PoolC(message_t, 20) as DebugMessagePool,
+   components new PoolC(message_t, 20) as DebugMessagePool,
     new QueueC(message_t*, 20) as DebugSendQueue,
-    new SerialAMSenderC(AM_CTP_DEBUG) as DebugSerialSender,
+    new SerialAMSenderC(AM_LQI_DEBUG) as DebugSerialSender,
     UARTDebugSenderP as DebugSender;
 
   DebugSender.Boot -> MainC;
   DebugSender.UARTSend -> DebugSerialSender;
   DebugSender.MessagePool -> DebugMessagePool;
   DebugSender.SendQueue -> DebugSendQueue;
-  Collector.CollectionDebug -> DebugSender;*/
+  Collector.CollectionDebug -> DebugSender;
 }
index fff54d7ca7bc5f9988dd17022332573ed6845f9d..55351c5207936726babb6fb34cd5700020ac2085 100644 (file)
@@ -78,7 +78,7 @@ implementation {
     local.interval = DEFAULT_INTERVAL;
     local.id = TOS_NODE_ID;
     local.version = 0;
-
+    dbg("App", "Booted.");
     // Beginning our initialization phases:
     if (call RadioControl.start() != SUCCESS)
       fatal_problem();
@@ -127,6 +127,14 @@ implementation {
   Receive.receive(message_t* msg, void *payload, uint8_t len) {
     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);
       if (len != sizeof(oscilloscope_t)) {
@@ -226,8 +234,10 @@ implementation {
       if (!sendbusy) {
        oscilloscope_t *o = (oscilloscope_t *)call Send.getPayload(&sendbuf);
        memcpy(o, &local, sizeof(local));
-       if (call Send.send(&sendbuf, sizeof(local)) == SUCCESS)
+       if (call Send.send(&sendbuf, sizeof(local)) == SUCCESS) {
+          dbg("App", "Sending a packet.\n");
          sendbusy = TRUE;
+        }
         else
           report_problem();
       }
index 221ab9454de90b69e19d3cd1ad0916513bf2d0e6..15d2e3425ac2b489efcedeb951794994119fc447 100644 (file)
@@ -11,11 +11,13 @@ r = t.radio()
 #t.addChannel("RadioCountToLedsC", sys.stdout)
 #t.addChannel("CpmModelC", sys.stdout)
 #t.addChannel("Gain", sys.stdout)
-#t.addChannel("AM", 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("LQIDeliver", sys.stdout)
+#t.addChannel("LQIRoute", sys.stdout)
+#t.addChannel("PointerBug", sys.stdout)
 
 start = time.time();
 noise = open("meyer-short.txt", "r")
@@ -44,7 +46,7 @@ for line in lines:
 start = time.time();
 for i in range(0, 7):
     t.getNode(i).createNoiseModel();
-    t.getNode(i).bootAtTime(random.random() * 10000000 + 20000000);
+    t.getNode(i).bootAtTime(int(random.random() * 10000000 + 20000000));
 
 duration = end - start;
 print "time: ", duration;
@@ -52,5 +54,5 @@ print "time: ", duration;
 #for i in range(0, 196607):
 #    print m1.generateNoise(i)
 
-for i in range(0, 1000000):
+for i in range(0, 2000):
     t.runNextEvent();