[Tinyos-2-commits] CVS: tinyos-2.x/apps/MultihopOscilloscope Makefile, 1.1.2.2, 1.1.2.3 MultihopOscilloscopeAppC.nc, 1.1.2.5, 1.1.2.6 MultihopOscilloscopeC.nc, 1.1.2.6, 1.1.2.7

Rodrigo Fonseca rfonseca76 at users.sourceforge.net
Mon Nov 6 14:33:12 PST 2006


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

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	Makefile MultihopOscilloscopeAppC.nc MultihopOscilloscopeC.nc 
Log Message:
Added default implementations for collection debug commands and made debugging traffic disabled by default in the Makefile.


Index: Makefile
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/MultihopOscilloscope/Makefile,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** Makefile	8 Sep 2006 20:13:00 -0000	1.1.2.2
--- Makefile	6 Nov 2006 22:33:07 -0000	1.1.2.3
***************
*** 1,4 ****
--- 1,5 ----
  COMPONENT=MultihopOscilloscopeAppC
  CFLAGS += -I$(TOSDIR)/lib/net/ -I$(TOSDIR)/lib/net/ctp -I$(TOSDIR)/lib/net/le -I.
+ #CFLAGS += -DDEBUG_INFRA
  
  include $(MAKERULES)

Index: MultihopOscilloscopeAppC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/MultihopOscilloscope/MultihopOscilloscopeAppC.nc,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -C2 -d -r1.1.2.5 -r1.1.2.6
*** MultihopOscilloscopeAppC.nc	2 Nov 2006 16:23:11 -0000	1.1.2.5
--- MultihopOscilloscopeAppC.nc	6 Nov 2006 22:33:10 -0000	1.1.2.6
***************
*** 58,61 ****
--- 58,62 ----
    // Components for debugging collection.
    //
+ #ifdef DEBUG_INFRA
    components new PoolC(message_t, 20) as DebugMessagePool,
      new QueueC(message_t*, 20) as DebugSendQueue,
***************
*** 68,70 ****
--- 69,72 ----
    DebugSender.SendQueue -> DebugSendQueue;
    Collector.CollectionDebug -> DebugSender;
+ #endif
  }

Index: MultihopOscilloscopeC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/MultihopOscilloscope/MultihopOscilloscopeC.nc,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -C2 -d -r1.1.2.6 -r1.1.2.7
*** MultihopOscilloscopeC.nc	2 Nov 2006 16:23:11 -0000	1.1.2.6
--- MultihopOscilloscopeC.nc	6 Nov 2006 22:33:10 -0000	1.1.2.7
***************
*** 39,43 ****
      interface Pool<message_t> as UARTMessagePool;
  
!     // Miscalleny:
      interface Timer<TMilli>;
      interface Read<uint16_t>;
--- 39,43 ----
      interface Pool<message_t> as UARTMessagePool;
  
!     // Miscellany:
      interface Timer<TMilli>;
      interface Read<uint16_t>;
***************
*** 225,232 ****
      if (reading == NREADINGS) {
        if (!sendbusy) {
! 	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();
--- 225,232 ----
      if (reading == NREADINGS) {
        if (!sendbusy) {
!         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();
***************
*** 274,276 ****
--- 274,298 ----
    static void report_sent() { call Leds.led1Toggle(); }
    static void report_received() { call Leds.led2Toggle(); }
+ 
+   /* Default implementations for CollectionDebug calls.
+    * These allow CollectionDebug not to be wired to anything if debugging
+    * is not desired. */
+ 
+     default command error_t CollectionDebug.logEvent(uint8_t type) {
+         return SUCCESS;
+     }
+     default command error_t CollectionDebug.logEventSimple(uint8_t type, uint16_t arg) {
+         return SUCCESS;
+     }
+     default command error_t CollectionDebug.logEventDbg(uint8_t type, uint16_t arg1, uint16_t arg2, uint16_t arg3) {
+         return SUCCESS;
+     }
+     default command error_t CollectionDebug.logEventMsg(uint8_t type, uint16_t msg, am_addr_t origin, am_addr_t node) {
+         return SUCCESS;
+     }
+     default command error_t CollectionDebug.logEventRoute(uint8_t type, am_addr_t parent, uint8_t hopcount, uint16_t metric) {
+         return SUCCESS;
+     }
+  
+ 
  }



More information about the Tinyos-2-commits mailing list