[Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/TestNetwork TestNetworkC.nc, 1.1.2.11, 1.1.2.12 TestNetworkAppC.nc, 1.1.2.10, 1.1.2.11 TestNetwork.h, 1.1.2.3, 1.1.2.4

Rodrigo Fonseca rfonseca76 at users.sourceforge.net
Fri Jun 16 05:55:27 PDT 2006


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

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	TestNetworkC.nc TestNetworkAppC.nc TestNetwork.h 
Log Message:
Changed format of message:
 - added a sequence number for application messages
 - changed parent and source to be nx_am_addr_t instead of uint8_t
Changed wiring to DebugSender


Index: TestNetworkC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestNetwork/Attic/TestNetworkC.nc,v
retrieving revision 1.1.2.11
retrieving revision 1.1.2.12
diff -C2 -d -r1.1.2.11 -r1.1.2.12
*** TestNetworkC.nc	15 Jun 2006 17:21:46 -0000	1.1.2.11
--- TestNetworkC.nc	16 Jun 2006 12:55:23 -0000	1.1.2.12
***************
*** 39,42 ****
--- 39,43 ----
    bool busy = FALSE, uartbusy = FALSE;
    bool firstTimer = TRUE;
+   uint16_t seqno;
    
    event void Boot.booted() {
***************
*** 55,59 ****
  	call RootControl.setRoot();
        }
!       call Timer.startOneShot(call Random.rand16() & 0x7FFF);
      }
    }
--- 56,63 ----
  	call RootControl.setRoot();
        }
!       seqno = 0;
!       if (TOS_NODE_ID == 142) {
!       	call Timer.startOneShot(call Random.rand16() & 0x7FFF);
!       }
      }
    }
***************
*** 90,93 ****
--- 94,99 ----
      call TreeRoutingInspect.getMetric(&metric);
  
+     msg->source = TOS_NODE_ID;
+     msg->seqno = seqno;
      msg->data = val;
      msg->parent = parent;
***************
*** 105,108 ****
--- 111,115 ----
      }
      else {
+       seqno++; 
        dbg("TestNetworkC", "%s: Transmission succeeded.\n", __FUNCTION__);
  
***************
*** 134,138 ****
        recvPtr = msg;
        uartbusy = TRUE;
!       msglen = len;
        post uartEchoTask();
        call Leds.led2Toggle();
--- 141,145 ----
        recvPtr = msg;
        uartbusy = TRUE;
!       msglen = len + 4;
        post uartEchoTask();
        call Leds.led2Toggle();

Index: TestNetworkAppC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestNetwork/Attic/TestNetworkAppC.nc,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -C2 -d -r1.1.2.10 -r1.1.2.11
*** TestNetworkAppC.nc	15 Jun 2006 17:21:45 -0000	1.1.2.10
--- TestNetworkAppC.nc	16 Jun 2006 12:55:23 -0000	1.1.2.11
***************
*** 43,48 ****
--- 43,52 ----
    TestNetworkC.Random -> RandomC;
  
+   components new PoolC(message_t, 10) as DebugMessagePool;
+   components new QueueC(message_t*, 10) as DebugSendQueue;
    DebugSender.Boot -> MainC;
    DebugSender.UARTSend -> UARTSender;
+   DebugSender.MessagePool -> DebugMessagePool;
+   DebugSender.SendQueue -> DebugSendQueue;
    Collector.CollectionDebug -> DebugSender;
  }

Index: TestNetwork.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestNetwork/Attic/TestNetwork.h,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** TestNetwork.h	14 Jun 2006 14:38:37 -0000	1.1.2.3
--- TestNetwork.h	16 Jun 2006 12:55:23 -0000	1.1.2.4
***************
*** 2,10 ****
  #define TEST_NETWORK_H
  
  #include "TestNetworkC.h"
  
  typedef nx_struct TestNetworkMsg {
!   nx_uint8_t source;
!   nx_uint8_t parent;
    nx_uint16_t metric;
    nx_uint16_t data;
--- 2,12 ----
  #define TEST_NETWORK_H
  
+ #include <AM.h>
  #include "TestNetworkC.h"
  
  typedef nx_struct TestNetworkMsg {
!   nx_am_addr_t source;
!   nx_uint16_t seqno;
!   nx_am_addr_t parent;
    nx_uint16_t metric;
    nx_uint16_t data;



More information about the Tinyos-2-commits mailing list