[Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/TestNetwork kaisen-topo.txt, NONE, 1.1.2.1 TestNetworkC.nc, 1.1.2.4, 1.1.2.5 test.py, 1.1.2.1, 1.1.2.2

Phil Levis scipio at users.sourceforge.net
Thu Jun 1 19:05:35 PDT 2006


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

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	TestNetworkC.nc test.py 
Added Files:
      Tag: tinyos-2_0_devel-BRANCH
	kaisen-topo.txt 
Log Message:
Fixes, some better error messages, and a simple topology from Kaisen.


--- NEW FILE: kaisen-topo.txt ---
noise 0 -105 5
noise 1 -105 5
noise 2 -105 5
noise 3 -105 5
noise 4 -105 5
noise 5 -105 5
noise 6 -105 5
noise 7 -105 5

gain 0 1 -90 
gain 1 0 -90 
gain 0 2 -96.5
gain 2 0 -96.5
gain 0 3 -97.0
gain 3 0 -97.0
gain 0 4 -97.5
gain 4 0 -97.5
gain 5 0 -98.0
gain 0 5 -98.0
gain 0 6 -99.0
gain 6 0 -99.0

gain 4 2 -90
gain 2 4 -90


Index: TestNetworkC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestNetwork/Attic/TestNetworkC.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
*** TestNetworkC.nc	26 May 2006 16:06:15 -0000	1.1.2.4
--- TestNetworkC.nc	2 Jun 2006 02:05:32 -0000	1.1.2.5
***************
*** 68,75 ****
      TestNetworkMsg* msg = (TestNetworkMsg*)call Send.getPayload(&packet);
      msg->data = val;
!     if (err != SUCCESS ||
!         call Send.send(&packet, sizeof(TestNetworkMsg)) != SUCCESS) {
!       call Leds.led0On();
        busy = FALSE;
      }
    }
--- 68,80 ----
      TestNetworkMsg* msg = (TestNetworkMsg*)call Send.getPayload(&packet);
      msg->data = val;
!     if (err != SUCCESS) {
        busy = FALSE;
+       call Leds.led0On();
+       dbg("TestNetworkC", "Sensor sample failed.\n");
+     }
+     else if (call Send.send(&packet, sizeof(TestNetworkMsg)) != SUCCESS) {
+       busy = FALSE;      
+       call Leds.led0On();
+       dbg("TestNetworkC", "Transmission failed.\n");
      }
    }
***************
*** 79,83 ****
        call Leds.led0On();
      }
!     busy = FALSE;
    }
    
--- 84,91 ----
        call Leds.led0On();
      }
!     else {
!       busy = FALSE;
!     }
!     dbg("TestNetworkC", "Send completed.\n");
    }
    
***************
*** 88,93 ****
    }
  
!   event message_t* 
!   Receive.receive(message_t* msg, void* payload, uint8_t len) {
      dbg("TestNetworkC", "Received packet at %s.\n", sim_time_string());
      if (!uartbusy) {
--- 96,100 ----
    }
  
!   event message_t* Receive.receive(message_t* msg, void* payload, uint8_t len) {
      dbg("TestNetworkC", "Received packet at %s.\n", sim_time_string());
      if (!uartbusy) {

Index: test.py
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestNetwork/Attic/test.py,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** test.py	26 May 2006 00:25:03 -0000	1.1.2.1
--- test.py	2 Jun 2006 02:05:32 -0000	1.1.2.2
***************
*** 9,13 ****
  r = t.radio()
  
! f = open("topo.txt", "r")
  lines = f.readlines()
  for line in lines:
--- 9,13 ----
  r = t.radio()
  
! f = open("kaisen-topo.txt", "r")
  lines = f.readlines()
  for line in lines:
***************
*** 19,23 ****
        r.setNoise(int(s[1]), float(s[2]), float(s[3]))
  
! for i in (0, 11, 14):
    m = t.getNode(i);
    time = randint(t.ticksPerSecond(), 10 * t.ticksPerSecond())
--- 19,23 ----
        r.setNoise(int(s[1]), float(s[2]), float(s[3]))
  
! for i in range(0, 6):
    m = t.getNode(i);
    time = randint(t.ticksPerSecond(), 10 * t.ticksPerSecond())
***************
*** 28,34 ****
  
  #t.addChannel("AM", sys.stdout)
! t.addChannel("TreeRouting", sys.stdout)
  t.addChannel("TestNetworkC", sys.stdout)
! t.addChannel("LI", sys.stdout)
  
  while (t.time() < 300 * t.ticksPerSecond()):
--- 28,36 ----
  
  #t.addChannel("AM", sys.stdout)
! #t.addChannel("TreeRouting", sys.stdout)
  t.addChannel("TestNetworkC", sys.stdout)
! t.addChannel("PhilTest", sys.stdout)
! #t.addChannel("LI", sys.stdout)
! #t.addChannel("LITest", sys.stdout)
  
  while (t.time() < 300 * t.ticksPerSecond()):



More information about the Tinyos-2-commits mailing list