[Tinyos-2-commits] CVS: tinyos-2.x/apps/MViz MViz.h, 1.1.2.1, 1.1.2.2 MVizAppC.nc, 1.1.2.1, 1.1.2.2 MVizC.nc, 1.1.2.1, 1.1.2.2 Makefile, 1.1.2.1, 1.1.2.2

Phil Levis scipio at users.sourceforge.net
Wed Oct 25 17:37:25 PDT 2006


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

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	MViz.h MVizAppC.nc MVizC.nc Makefile 
Log Message:
MViz app.


Index: MViz.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/MViz/Attic/MViz.h,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** MViz.h	25 Oct 2006 01:54:44 -0000	1.1.2.1
--- MViz.h	26 Oct 2006 00:37:22 -0000	1.1.2.2
***************
*** 21,28 ****
    /* Default sampling period. */
    DEFAULT_INTERVAL = 256,
!   AM_MVIZ = 0x93
  };
  
! typedef nx_struct oscilloscope {
    nx_uint16_t version; /* Version of the interval. */
    nx_uint16_t interval; /* Samping period. */
--- 21,28 ----
    /* Default sampling period. */
    DEFAULT_INTERVAL = 256,
!   AM_MVIZ_MSG = 0x93
  };
  
! typedef nx_struct mviz_msg{
    nx_uint16_t version; /* Version of the interval. */
    nx_uint16_t interval; /* Samping period. */
***************
*** 30,34 ****
    nx_uint16_t count; /* The readings are samples count * NREADINGS onwards */
    nx_uint16_t reading;
! } oscilloscope_t;
  
  #endif
--- 30,34 ----
    nx_uint16_t count; /* The readings are samples count * NREADINGS onwards */
    nx_uint16_t reading;
! } mviz_msg_t;
  
  #endif

Index: MVizAppC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/MViz/Attic/MVizAppC.nc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** MVizAppC.nc	25 Oct 2006 01:54:44 -0000	1.1.2.1
--- MVizAppC.nc	26 Oct 2006 00:37:22 -0000	1.1.2.2
***************
*** 18,22 ****
   */
  
! configuration MVizC { }
  implementation {
    components MainC, MVizC, LedsC, new TimerMilliC(), 
--- 18,24 ----
   */
  
! #include <MViz.h>
! 
! configuration MVizAppC { }
  implementation {
    components MainC, MVizC, LedsC, new TimerMilliC(), 
***************
*** 36,42 ****
    components CollectionC as Collector,  // Collection layer
      ActiveMessageC,                         // AM layer
!     new CollectionSenderC(AM_MVIZ), // Sends multihop RF
      SerialActiveMessageC,                   // Serial messaging
!     new SerialAMSenderC(AM_MVIZ);   // Sends to the serial port
  
    MVizC.RadioControl -> ActiveMessageC;
--- 38,44 ----
    components CollectionC as Collector,  // Collection layer
      ActiveMessageC,                         // AM layer
!     new CollectionSenderC(AM_MVIZ_MSG), // Sends multihop RF
      SerialActiveMessageC,                   // Serial messaging
!     new SerialAMSenderC(AM_MVIZ_MSG);   // Sends to the serial port
  
    MVizC.RadioControl -> ActiveMessageC;
***************
*** 46,51 ****
    MVizC.Send -> CollectionSenderC;
    MVizC.SerialSend -> SerialAMSenderC.AMSend;
!   MVizC.Snoop -> Collector.Snoop[AM_MVIZ];
!   MVizC.Receive -> Collector.Receive[AM_MVIZ];
    MVizC.RootControl -> Collector;
  
--- 48,53 ----
    MVizC.Send -> CollectionSenderC;
    MVizC.SerialSend -> SerialAMSenderC.AMSend;
!   MVizC.Snoop -> Collector.Snoop[AM_MVIZ_MSG];
!   MVizC.Receive -> Collector.Receive[AM_MVIZ_MSG];
    MVizC.RootControl -> Collector;
  

Index: MVizC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/MViz/Attic/MVizC.nc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** MVizC.nc	25 Oct 2006 01:54:44 -0000	1.1.2.1
--- MVizC.nc	26 Oct 2006 00:37:22 -0000	1.1.2.2
***************
*** 57,61 ****
  
    /* Current local state - interval, version and accumulated readings */
!   oscilloscope_t local;
  
    uint8_t reading; /* 0 to NREADINGS */
--- 57,61 ----
  
    /* Current local state - interval, version and accumulated readings */
!   mviz_msg_t local;
  
    uint8_t reading; /* 0 to NREADINGS */
***************
*** 100,104 ****
  
      // This is how to set yourself as a root to the collection layer:
!     if (local.id % 500 == 0)
        call RootControl.setRoot();
  
--- 100,104 ----
  
      // This is how to set yourself as a root to the collection layer:
!     if (local.origin % 500 == 0)
        call RootControl.setRoot();
  
***************
*** 122,135 ****
    Receive.receive(message_t* msg, void *payload, uint8_t len) {
      if (uartbusy == FALSE) {
!       oscilloscope_t* in = (oscilloscope_t*)payload;
!       oscilloscope_t* out = (oscilloscope_t*)call SerialSend.getPayload(&uartbuf);
!       if (len != sizeof(oscilloscope_t)) {
  	return msg;
        }
        else {
! 	memcpy(out, in, sizeof(oscilloscope_t));
        }
        uartbusy = TRUE;
!       uartlen = sizeof(oscilloscope_t);
        post uartSendTask();
      }
--- 122,135 ----
    Receive.receive(message_t* msg, void *payload, uint8_t len) {
      if (uartbusy == FALSE) {
!       mviz_msg_t* in = (mviz_msg_t*)payload;
!       mviz_msg_t* out = (mviz_msg_t*)call SerialSend.getPayload(&uartbuf);
!       if (len != sizeof(mviz_msg_t)) {
  	return msg;
        }
        else {
! 	memcpy(out, in, sizeof(mviz_msg_t));
        }
        uartbusy = TRUE;
!       uartlen = sizeof(mviz_msg_t);
        post uartSendTask();
      }
***************
*** 148,152 ****
    event message_t* 
    Snoop.receive(message_t* msg, void* payload, uint8_t len) {
!     oscilloscope_t *omsg = payload;
  
      report_received();
--- 148,152 ----
    event message_t* 
    Snoop.receive(message_t* msg, void* payload, uint8_t len) {
!     mviz_msg_t *omsg = payload;
  
      report_received();
***************
*** 175,179 ****
    event void Timer.fired() {
      if (!sendbusy) {
!       oscilloscope_t *o = (oscilloscope_t *)call Send.getPayload(&sendbuf);
        memcpy(o, &local, sizeof(local));
        if (call Send.send(&sendbuf, sizeof(local)) == SUCCESS)
--- 175,179 ----
    event void Timer.fired() {
      if (!sendbusy) {
!       mviz_msg_t *o = (mviz_msg_t *)call Send.getPayload(&sendbuf);
        memcpy(o, &local, sizeof(local));
        if (call Send.send(&sendbuf, sizeof(local)) == SUCCESS)

Index: Makefile
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/MViz/Attic/Makefile,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** Makefile	25 Oct 2006 01:54:44 -0000	1.1.2.1
--- Makefile	26 Oct 2006 00:37:22 -0000	1.1.2.2
***************
*** 1,4 ****
! COMPONENT=MultihopOscilloscopeAppC
  CFLAGS += -I$(TOSDIR)/lib/net/ -I$(TOSDIR)/lib/net/ctp -I$(TOSDIR)/lib/net/le -I.
  
  include $(MAKERULES)
--- 1,11 ----
! COMPONENT=MVizAppC
  CFLAGS += -I$(TOSDIR)/lib/net/ -I$(TOSDIR)/lib/net/ctp -I$(TOSDIR)/lib/net/le -I.
+ BUILD_EXTRA_DEPS = MVizMsg.class
+ 
+ MVizMsg.java: MViz.h
+ 	mig -target=null -java-classname=MVizMsg java MViz.h mviz_msg -o $@
+ 
+ MVizMsg.class: MVizMsg.java
+ 	javac MVizMsg.java
  
  include $(MAKERULES)



More information about the Tinyos-2-commits mailing list