[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/wustl/apps/Agilla/opcodes OPgetClosestAgentM.nc, 1.8, 1.9

Chien-Liang Fok chien-liang at users.sourceforge.net
Sun Apr 9 01:13:12 PDT 2006


Update of /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/opcodes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2807/opcodes

Modified Files:
	OPgetClosestAgentM.nc 
Log Message:


Index: OPgetClosestAgentM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/opcodes/OPgetClosestAgentM.nc,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** OPgetClosestAgentM.nc	7 Apr 2006 01:14:53 -0000	1.8
--- OPgetClosestAgentM.nc	9 Apr 2006 08:13:08 -0000	1.9
***************
*** 70,73 ****
--- 70,78 ----
      interface Timer as Timeout;
      interface Leds; // debug
+ 
+     #if ENABLE_EXP_LOGGING
+       interface ExpLoggerI;
+       interface LocalTime;
+     #endif    
    }
  }
***************
*** 110,113 ****
--- 115,122 ----
    uint16_t _agent_type;
  
+   #if ENABLE_EXP_LOGGING
+     uint32_t _start;
+   #endif  
+ 
    command result_t StdControl.init()
    {
***************
*** 128,131 ****
--- 137,149 ----
    inline result_t finish(result_t success)
    {
+     #if ENABLE_EXP_LOGGING
+       if (success) {
+         _start = call LocalTime.read() - _start;
+       } else {
+         _start = 0;
+       }
+       call ExpLoggerI.sendQueryLatency(_start);
+     #endif
+     
      _currAgent->condition = (uint16_t)success;
      call AgentMgrI.run(_currAgent);
***************
*** 194,199 ****
  
          call MessageBufferI.freeMsg(msg);
!       else
          call Timeout.start(TIMER_ONE_SHOT, TIMEOUT_GET_NUM_AGENTS);
      }
    } // task doSendQuery()
--- 212,225 ----
  
          call MessageBufferI.freeMsg(msg);
!       else {
!         #if ENABLE_EXP_LOGGING
!           AgillaLocation loc;
!           loc.x = loc.y = 0;
!           call ExpLoggerI.sendTraceQid(_currAgent->id.id, TOS_LOCAL_ADDRESS, 
!             QUERY_GET_CLOSEST_AGENT_ISSUED, qMsg->qid, SUCCESS, loc);
!           _start = call LocalTime.read();
!         #endif      
          call Timeout.start(TIMER_ONE_SHOT, TIMEOUT_GET_NUM_AGENTS);
+       }
      }
    } // task doSendQuery()
***************
*** 295,298 ****
--- 321,331 ----
          call OpStackI.pushLocation(_currAgent, &reply->nearest_agent_loc);
          call OpStackI.pushAgentID(_currAgent, &reply->nearest_agent_id);
+         
+         #if ENABLE_EXP_LOGGING
+           call ExpLoggerI.sendTraceQid(_currAgent->id.id, TOS_LOCAL_ADDRESS, 
+             QUERY_GET_CLOSEST_AGENT_RESULTS_RECEIVED, 
+             reply->qid, SUCCESS, reply->nearest_agent_loc);
+         #endif
+         
          finish(SUCCESS);
  
***************
*** 320,323 ****
--- 353,364 ----
    event result_t Timeout.fired()
    {
+     #if ENABLE_EXP_LOGGING
+       AgillaLocation loc;
+       call LocationMgrI.getLocation(TOS_LOCAL_ADDRESS, &loc);
+       call ExpLoggerI.sendTraceQid(_currAgent->id.id, TOS_LOCAL_ADDRESS, 
+         QUERY_GET_CLOSEST_AGENT_RESULTS_RECEIVED, 
+         ((TOS_LOCAL_ADDRESS & 0xff) << 8) | (_qid-1), FAIL, loc);
+     #endif
+     
      #if DEBUG_OP_GET_CLOSEST_AGENT
        dbg(DBG_USR1, "OPgetClosestAgentM: ERROR: Timed out while waiting for results.\n");



More information about the Tinyos-contrib-commits mailing list