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

Rodrigo Fonseca rfonseca76 at users.sourceforge.net
Thu Nov 2 08:23:13 PST 2006


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

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	MultihopOscilloscopeAppC.nc MultihopOscilloscopeC.nc 
Log Message:
Fixed a memcopy bug. Tested: collection is working.


Index: MultihopOscilloscopeAppC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/MultihopOscilloscope/MultihopOscilloscopeAppC.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
*** MultihopOscilloscopeAppC.nc	2 Nov 2006 02:29:31 -0000	1.1.2.4
--- MultihopOscilloscopeAppC.nc	2 Nov 2006 16:23:11 -0000	1.1.2.5
***************
*** 58,63 ****
    // Components for debugging collection.
    //
!   components new PoolC(message_t, 10) as DebugMessagePool,
!     new QueueC(message_t*, 10) as DebugSendQueue,
      new SerialAMSenderC(AM_CTP_DEBUG) as DebugSerialSender,
      UARTDebugSenderP as DebugSender;
--- 58,63 ----
    // Components for debugging collection.
    //
!   components new PoolC(message_t, 20) as DebugMessagePool,
!     new QueueC(message_t*, 20) as DebugSendQueue,
      new SerialAMSenderC(AM_CTP_DEBUG) as DebugSerialSender,
      UARTDebugSenderP as DebugSender;

Index: MultihopOscilloscopeC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/MultihopOscilloscope/MultihopOscilloscopeC.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
*** MultihopOscilloscopeC.nc	2 Nov 2006 02:29:31 -0000	1.1.2.5
--- MultihopOscilloscopeC.nc	2 Nov 2006 16:23:11 -0000	1.1.2.6
***************
*** 78,81 ****
--- 78,82 ----
      local.interval = DEFAULT_INTERVAL;
      local.id = TOS_NODE_ID;
+     local.version = 0;
  
      // Beginning our initialization phases:
***************
*** 111,115 ****
    static void startTimer() {
      if (call Timer.isRunning()) call Timer.stop();
!     call Timer.startOneShot(local.interval);
      reading = 0;
    }
--- 112,116 ----
    static void startTimer() {
      if (call Timer.isRunning()) call Timer.stop();
!     call Timer.startPeriodic(local.interval);
      reading = 0;
    }
***************
*** 125,131 ****
    event message_t*
    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;
--- 126,133 ----
    event message_t*
    Receive.receive(message_t* msg, void *payload, uint8_t len) {
+     oscilloscope_t* in = (oscilloscope_t*)payload;
+     oscilloscope_t* out;
      if (uartbusy == FALSE) {
!       out = (oscilloscope_t*)call SerialSend.getPayload(&uartbuf);
        if (len != sizeof(oscilloscope_t)) {
  	return msg;
***************
*** 146,150 ****
        }
  
!       memcpy(newmsg, msg, sizeof(message_t));
  
        if (call UARTQueue.enqueue(newmsg) != SUCCESS) {
--- 148,154 ----
        }
  
!       //Prepare message to be sent over the uart
!       out = (oscilloscope_t*)call SerialSend.getPayload(newmsg);
!       memcpy(out, in, sizeof(oscilloscope_t));
  
        if (call UARTQueue.enqueue(newmsg) != SUCCESS) {
***************
*** 219,223 ****
    */
    event void Timer.fired() {
-     call Timer.startOneShot(local.interval);
      if (reading == NREADINGS) {
        if (!sendbusy) {
--- 223,226 ----
***************
*** 259,262 ****
--- 262,266 ----
    }
  
+ 
    // Use LEDs to report various status issues.
    static void fatal_problem() { 



More information about the Tinyos-2-commits mailing list