[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/wustl/apps/Agilla/components AddressMgrC.nc, 1.6, 1.7 AddressMgrM.nc, 1.10, 1.11 AgentMgrC.nc, 1.11, 1.12 AgentMgrM.nc, 1.28, 1.29 AgillaEngineC.nc, 1.5, 1.6 AgillaEngineM.nc, 1.12, 1.13 CodeMgrC.nc, 1.2, 1.3 CodeMgrM.nc, 1.6, 1.7 ErrorMgrC.nc, 1.3, 1.4 ErrorMgrDummy.nc, 1.2, 1.3 ErrorMgrM.nc, 1.4, 1.5 ErrorMgrProxy.nc, 1.1, 1.2 ExpLoggerC.nc, 1.4, 1.5 ExpLoggerM.nc, 1.7, 1.8 HeapMgrC.nc, 1.1, 1.2 HeapMgrM.nc, 1.4, 1.5 LocationMgrC.nc, 1.6, 1.7 LocationMgrM.nc, 1.5, 1.6 LocationUtils.nc, 1.2, 1.3 MessageBufferM.nc, 1.3, 1.4 OpStackC.nc, 1.2, 1.3 OpStackM.nc, 1.3, 1.4 Queue.nc, 1.1, 1.2 QueueProxy.nc, 1.2, 1.3 RemoteTSOpMgrC.nc, 1.5, 1.6 RemoteTSOpMgrDummy.nc, 1.1, 1.2 RemoteTSOpMgrM.nc, 1.20, 1.21 RemoteTSOpMgrProxy.nc, 1.1, 1.2 ResetMgrC.nc, 1.9, 1.10 ResetMgrM.nc, 1.7, 1.8 RxnMgrC.nc, 1.5, 1.6 RxnMgrDummy.nc, 1.1, 1.2 RxnMgrM.nc, 1.8, 1.9 RxnMgrProxy.nc, 1.1, 1.2 SystemTSMgrC.nc, 1.2, 1.3 SystemTSMgrM.nc, 1.3, 1.4 TimeSyncC.nc, 1.2, 1.3 TimeSyncM.nc, 1.4, 1.5 TupleSpaceC.nc, 1.2, 1.3 TupleSpaceDummy.nc, 1.1, 1.2 TupleSpaceM.nc, 1.12, 1.13 TupleSpaceProxy.nc, 1.1, 1.2 TupleUtilC.nc, 1.2, 1.3 TupleUtilM.nc, 1.7, 1.8 VarUtilC.nc, 1.2, 1.3 VarUtilM.nc, 1.1, 1.2

Chien-Liang Fok chien-liang at users.sourceforge.net
Thu May 18 12:58:44 PDT 2006


Update of /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25569/contrib/wustl/apps/Agilla/components

Modified Files:
	AddressMgrC.nc AddressMgrM.nc AgentMgrC.nc AgentMgrM.nc 
	AgillaEngineC.nc AgillaEngineM.nc CodeMgrC.nc CodeMgrM.nc 
	ErrorMgrC.nc ErrorMgrDummy.nc ErrorMgrM.nc ErrorMgrProxy.nc 
	ExpLoggerC.nc ExpLoggerM.nc HeapMgrC.nc HeapMgrM.nc 
	LocationMgrC.nc LocationMgrM.nc LocationUtils.nc 
	MessageBufferM.nc OpStackC.nc OpStackM.nc Queue.nc 
	QueueProxy.nc RemoteTSOpMgrC.nc RemoteTSOpMgrDummy.nc 
	RemoteTSOpMgrM.nc RemoteTSOpMgrProxy.nc ResetMgrC.nc 
	ResetMgrM.nc RxnMgrC.nc RxnMgrDummy.nc RxnMgrM.nc 
	RxnMgrProxy.nc SystemTSMgrC.nc SystemTSMgrM.nc TimeSyncC.nc 
	TimeSyncM.nc TupleSpaceC.nc TupleSpaceDummy.nc TupleSpaceM.nc 
	TupleSpaceProxy.nc TupleUtilC.nc TupleUtilM.nc VarUtilC.nc 
	VarUtilM.nc 
Log Message:





Index: AgentMgrM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/AgentMgrM.nc,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** AgentMgrM.nc	27 Apr 2006 23:53:18 -0000	1.28
--- AgentMgrM.nc	18 May 2006 19:58:40 -0000	1.29
***************
*** 1,500 ****
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis
!  * By Chien-Liang Fok.
!  *
!  * Washington University states that Agilla is free software;
!  * you can redistribute it and/or modify it under the terms of
!  * the current version of the GNU Lesser General Public License
!  * as published by the Free Software Foundation.
[...971 lines suppressed...]
!       #endif
!     }
!     return SUCCESS;
!   }*/
!   
!   
!   /**
!    * Send a location update heartbeat to the base station.
!    */
!   event result_t LocationUpdateTimer.fired() {
!     int i;
!     for (i=0; i < AGILLA_NUM_AGENTS; i++) {
!       if (agents[i].state != AGILLA_STATE_HALT)
!         call LocationReporterI.updateLocation(&agents[i]);
!     }
!     return SUCCESS;    
!   }
! }
! 
! 

Index: AgillaEngineC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/AgillaEngineC.nc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** AgillaEngineC.nc	17 Mar 2006 01:15:18 -0000	1.5
--- AgillaEngineC.nc	18 May 2006 19:58:40 -0000	1.6
***************
*** 1,178 ****
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! /*                  tab:4
!  *
!  *
!  * "Copyright (c) 2000-2002 The Regents of the University  of California.  
!  * All rights reserved.
!  *
!  * Permission to use, copy, modify, and distribute this software and
!  * its documentation for any purpose, without fee, and without written
!  * agreement is hereby granted, provided that the above copyright
!  * notice, the following two paragraphs and the author appear in all
!  * copies of this software.
!  * 
!  * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY
!  * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
!  * DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
!  * DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN
!  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!  * 
!  * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
!  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
!  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE
!  * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
!  * CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
!  * UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
!  *
!  */
! /*                  tab:4
!  *                  
!  *  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
!  *  By downloading, copying, installing or using the software you
!  *  agree to this license.  If you do not agree to this license, do
!  *  not download, install, copy or use the software.
!  *
!  *  Intel Open Source License 
!  *
!  *  Copyright (c) 2002 Intel Corporation 
!  *  All rights reserved. 
!  *  Redistribution and use in source and binary forms, with or without
!  *  modification, are permitted provided that the following conditions are
!  *  met:
!  * 
!  *  Redistributions of source code must retain the above copyright
!  *  notice, this list of conditions and the following disclaimer.
!  *  Redistributions in binary form must reproduce the above copyright
!  *  notice, this list of conditions and the following disclaimer in the
!  *  documentation and/or other materials provided with the distribution.
!  *      Neither the name of the Intel Corporation nor the names of its
!  *  contributors may be used to endorse or promote products derived from
!  *  this software without specific prior written permission.
!  *  
!  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  *  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
!  *  PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE INTEL OR ITS
!  *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
!  *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
!  *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
!  *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
!  *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
!  *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
!  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!  * 
!  * 
!  */
! 
! /*
!  * Authors:   Neil Patel
!  * History:   Apr 11, 2003         Inception.
!  *         
!  */
! 
! /**
!  * @author Neil Patel
!  * @author Chien-Liang Fok
!  */
! 
! 
! includes Agilla;
! 
! configuration AgillaEngineC {
!   provides {
!     interface StdControl;    
!     interface AgentExecutorI;
!   }
!   uses {
!     interface BytecodeI as BasicISA[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA1[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA2[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA3[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA4[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA5[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA6[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA7[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA8[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA9[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA10[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA11[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA12[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA13[uint8_t bytecode]; 
!   }
! }
! 
! implementation {
!   components AgillaEngineM, AddressMgrC, ErrorMgrProxy, ResetMgrC;
!   components AgentMgrC, CodeMgrC, ResetC, SystemTSMgrC, RemoteTSOpMgrProxy;
!   components QueueProxy, RxnMgrProxy;
!   
!   components TimeSyncC;
!   components LocationReporterC;
!   
!   StdControl = AgillaEngineM;
!   StdControl = AgentMgrC;  
!   StdControl = SystemTSMgrC;  
!   StdControl = ResetMgrC;
!   StdControl = RxnMgrProxy;
!   StdControl = TimeSyncC;
!   StdControl = LocationReporterC;
!   
!   AgentExecutorI = AgillaEngineM.AgentExecutorI;  
!   BasicISA = AgillaEngineM.BasicISA;  // Instruction set
!   ExtendedISA1 = AgillaEngineM.ExtendedISA1;
!   ExtendedISA2 = AgillaEngineM.ExtendedISA2;
!   ExtendedISA3 = AgillaEngineM.ExtendedISA3;
!   ExtendedISA4 = AgillaEngineM.ExtendedISA4;
!   ExtendedISA5 = AgillaEngineM.ExtendedISA5;
!   ExtendedISA6 = AgillaEngineM.ExtendedISA6;
!   ExtendedISA7 = AgillaEngineM.ExtendedISA7;
!   ExtendedISA8 = AgillaEngineM.ExtendedISA8;
!   ExtendedISA9 = AgillaEngineM.ExtendedISA9;
!   ExtendedISA10 = AgillaEngineM.ExtendedISA10;
!   ExtendedISA11 = AgillaEngineM.ExtendedISA11;
!   ExtendedISA12 = AgillaEngineM.ExtendedISA12;
!   ExtendedISA13 = AgillaEngineM.ExtendedISA13;  
!   
!   AgillaEngineM.QueueI -> QueueProxy;
!   AgillaEngineM.CodeMgrI -> CodeMgrC;  
!   AgillaEngineM.ErrorMgrI -> ErrorMgrProxy;
!   AgillaEngineM.ResetMgrI -> ResetMgrC;
!   AgillaEngineM.RxnMgrI -> RxnMgrProxy; 
! }
--- 1,178 ----
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! /*                  tab:4
!  *
!  *
!  * "Copyright (c) 2000-2002 The Regents of the University  of California.  
!  * All rights reserved.
!  *
!  * Permission to use, copy, modify, and distribute this software and
!  * its documentation for any purpose, without fee, and without written
!  * agreement is hereby granted, provided that the above copyright
!  * notice, the following two paragraphs and the author appear in all
!  * copies of this software.
!  * 
!  * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY
!  * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
!  * DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
!  * DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN
!  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!  * 
!  * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
!  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
!  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE
!  * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
!  * CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
!  * UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
!  *
!  */
! /*                  tab:4
!  *                  
!  *  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
!  *  By downloading, copying, installing or using the software you
!  *  agree to this license.  If you do not agree to this license, do
!  *  not download, install, copy or use the software.
!  *
!  *  Intel Open Source License 
!  *
!  *  Copyright (c) 2002 Intel Corporation 
!  *  All rights reserved. 
!  *  Redistribution and use in source and binary forms, with or without
!  *  modification, are permitted provided that the following conditions are
!  *  met:
!  * 
!  *  Redistributions of source code must retain the above copyright
!  *  notice, this list of conditions and the following disclaimer.
!  *  Redistributions in binary form must reproduce the above copyright
!  *  notice, this list of conditions and the following disclaimer in the
!  *  documentation and/or other materials provided with the distribution.
!  *      Neither the name of the Intel Corporation nor the names of its
!  *  contributors may be used to endorse or promote products derived from
!  *  this software without specific prior written permission.
!  *  
!  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!  *  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
!  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
!  *  PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE INTEL OR ITS
!  *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
!  *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
!  *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
!  *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
!  *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
!  *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
!  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!  * 
!  * 
!  */
! 
! /*
!  * Authors:   Neil Patel
!  * History:   Apr 11, 2003         Inception.
!  *         
!  */
! 
! /**
!  * @author Neil Patel
!  * @author Chien-Liang Fok
!  */
! 
! 
! includes Agilla;
! 
! configuration AgillaEngineC {
!   provides {
!     interface StdControl;    
!     interface AgentExecutorI;
!   }
!   uses {
!     interface BytecodeI as BasicISA[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA1[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA2[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA3[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA4[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA5[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA6[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA7[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA8[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA9[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA10[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA11[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA12[uint8_t bytecode]; 
!     interface BytecodeI as ExtendedISA13[uint8_t bytecode]; 
!   }
! }
! 
! implementation {
!   components AgillaEngineM, AddressMgrC, ErrorMgrProxy, ResetMgrC;
!   components AgentMgrC, CodeMgrC, ResetC, SystemTSMgrC, RemoteTSOpMgrProxy;
!   components QueueProxy, RxnMgrProxy;
!   
!   components TimeSyncC;
!   components LocationReporterC;
!   
!   StdControl = AgillaEngineM;
!   StdControl = AgentMgrC;  
!   StdControl = SystemTSMgrC;  
!   StdControl = ResetMgrC;
!   StdControl = RxnMgrProxy;
!   StdControl = TimeSyncC;
!   StdControl = LocationReporterC;
!   
!   AgentExecutorI = AgillaEngineM.AgentExecutorI;  
!   BasicISA = AgillaEngineM.BasicISA;  // Instruction set
!   ExtendedISA1 = AgillaEngineM.ExtendedISA1;
!   ExtendedISA2 = AgillaEngineM.ExtendedISA2;
!   ExtendedISA3 = AgillaEngineM.ExtendedISA3;
!   ExtendedISA4 = AgillaEngineM.ExtendedISA4;
!   ExtendedISA5 = AgillaEngineM.ExtendedISA5;
!   ExtendedISA6 = AgillaEngineM.ExtendedISA6;
!   ExtendedISA7 = AgillaEngineM.ExtendedISA7;
!   ExtendedISA8 = AgillaEngineM.ExtendedISA8;
!   ExtendedISA9 = AgillaEngineM.ExtendedISA9;
!   ExtendedISA10 = AgillaEngineM.ExtendedISA10;
!   ExtendedISA11 = AgillaEngineM.ExtendedISA11;
!   ExtendedISA12 = AgillaEngineM.ExtendedISA12;
!   ExtendedISA13 = AgillaEngineM.ExtendedISA13;  
!   
!   AgillaEngineM.QueueI -> QueueProxy;
!   AgillaEngineM.CodeMgrI -> CodeMgrC;  
!   AgillaEngineM.ErrorMgrI -> ErrorMgrProxy;
!   AgillaEngineM.ResetMgrI -> ResetMgrC;
!   AgillaEngineM.RxnMgrI -> RxnMgrProxy; 
! }

Index: AgillaEngineM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/AgillaEngineM.nc,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** AgillaEngineM.nc	6 Feb 2006 09:40:39 -0000	1.12
--- AgillaEngineM.nc	18 May 2006 19:58:40 -0000	1.13
***************
*** 327,331 ****
        return FAIL;
      }
!     else if (context->queue != &runQueue) 
      {
        call QueueI.enqueue(context, &runQueue, context);    
--- 327,332 ----
        return FAIL;
      }
!     //else if (context->queue != &runQueue) 
!     else if (context->queue == NULL) // do not run the agent if it is in any other queue
      {
        call QueueI.enqueue(context, &runQueue, context);    

Index: CodeMgrC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/CodeMgrC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CodeMgrC.nc	6 Feb 2006 09:40:39 -0000	1.2
--- CodeMgrC.nc	18 May 2006 19:58:40 -0000	1.3
***************
*** 1,53 ****
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! includes Agilla;
! includes MigrationMsgs;
! 
! configuration CodeMgrC {
!   provides interface CodeMgrI;       
! }
! implementation {
!   components Main, CodeMgrM, ErrorMgrProxy;
!   
!   CodeMgrI = CodeMgrM;
!   
!   Main.StdControl -> CodeMgrM;
!   
!   CodeMgrM.ErrorMgrI -> ErrorMgrProxy;        
! }
--- 1,53 ----
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! includes Agilla;
! includes MigrationMsgs;
! 
! configuration CodeMgrC {
!   provides interface CodeMgrI;       
! }
! implementation {
!   components Main, CodeMgrM, ErrorMgrProxy;
!   
!   CodeMgrI = CodeMgrM;
!   
!   Main.StdControl -> CodeMgrM;
!   
!   CodeMgrM.ErrorMgrI -> ErrorMgrProxy;        
! }






Index: ExpLoggerC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/ExpLoggerC.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ExpLoggerC.nc	21 Apr 2006 21:56:58 -0000	1.4
--- ExpLoggerC.nc	18 May 2006 19:58:40 -0000	1.5
***************
*** 1,26 ****
! includes ExpLogger;
! 
! configuration ExpLoggerC
! {
!   provides {
!     interface ExpLoggerI;
!   }
! }
! implementation
! {
!   components Main, ExpLoggerM, NetworkInterfaceProxy, MessageBufferM, SimpleTime;
! 
!   ExpLoggerI = ExpLoggerM;
! 
!   Main.StdControl -> ExpLoggerM;
!   Main.StdControl -> MessageBufferM;
!   Main.StdControl -> SimpleTime;
! 
!   ExpLoggerM.SendResults -> NetworkInterfaceProxy.SendMsg[AM_AGILLAEXPRESULTSMSG];
!   ExpLoggerM.SendLatency -> NetworkInterfaceProxy.SendMsg[AM_AGILLAEXPLATENCYMSG];
!   ExpLoggerM.SendTrace -> NetworkInterfaceProxy.SendMsg[AM_AGILLATRACEMSG];
!   ExpLoggerM.SendGetAgentsResultsTrace -> NetworkInterfaceProxy.SendMsg[AM_AGILLATRACEGETAGENTSMSG];
!   //ExpLoggerM.ReceiveQuery -> NetworkInterfaceProxy.ReceiveMsg[AM_AGILLAEXPQUERYRESULTSMSG];  
!   ExpLoggerM.MessageBufferI -> MessageBufferM;
!   ExpLoggerM.Time -> SimpleTime;
! }
--- 1,26 ----
! includes ExpLogger;
! 
! configuration ExpLoggerC
! {
!   provides {
!     interface ExpLoggerI;
!   }
! }
! implementation
! {
!   components Main, ExpLoggerM, NetworkInterfaceProxy, MessageBufferM, SimpleTime;
! 
!   ExpLoggerI = ExpLoggerM;
! 
!   Main.StdControl -> ExpLoggerM;
!   Main.StdControl -> MessageBufferM;
!   Main.StdControl -> SimpleTime;
! 
!   ExpLoggerM.SendResults -> NetworkInterfaceProxy.SendMsg[AM_AGILLAEXPRESULTSMSG];
!   ExpLoggerM.SendLatency -> NetworkInterfaceProxy.SendMsg[AM_AGILLAEXPLATENCYMSG];
!   ExpLoggerM.SendTrace -> NetworkInterfaceProxy.SendMsg[AM_AGILLATRACEMSG];
!   ExpLoggerM.SendGetAgentsResultsTrace -> NetworkInterfaceProxy.SendMsg[AM_AGILLATRACEGETAGENTSMSG];
!   //ExpLoggerM.ReceiveQuery -> NetworkInterfaceProxy.ReceiveMsg[AM_AGILLAEXPQUERYRESULTSMSG];  
!   ExpLoggerM.MessageBufferI -> MessageBufferM;
!   ExpLoggerM.Time -> SimpleTime;
! }

Index: ExpLoggerM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/ExpLoggerM.nc,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ExpLoggerM.nc	21 Apr 2006 21:56:58 -0000	1.7
--- ExpLoggerM.nc	18 May 2006 19:58:40 -0000	1.8
***************
*** 1,192 ****
! module ExpLoggerM
! {
!   provides {
!     interface StdControl;
!     interface ExpLoggerI;
!   }
!   uses {
!     interface SendMsg as SendResults;
!     interface SendMsg as SendLatency;
!     interface SendMsg as SendTrace;
!     interface SendMsg as SendGetAgentsResultsTrace;
!     //interface ReceiveMsg as ReceiveQuery;
!     interface MessageBufferI;
!     interface Time;
!   }
! }
! implementation {
! 
!   //uint16_t _numQueries, _numUpdates, _numReplies;
! 
!   command result_t StdControl.init() {
!     call ExpLoggerI.reset();
!     return SUCCESS;
!   }
! 
!   command result_t StdControl.start() {
!     return SUCCESS;
!   }
! 
!   command result_t StdControl.stop() {
!     return SUCCESS;
!   }
! 
!   command result_t ExpLoggerI.reset() {
!     /*_numQueries = 0;
!     _numUpdates = 0;
!     _numReplies = 0;*/
!     return SUCCESS;
!   }
! 
! /*  command result_t ExpLoggerI.incQueryMsg() {
!     _numQueries++;
!     return SUCCESS;
!   }
! 
!   command result_t ExpLoggerI.incNumUpdates() {
!     _numUpdates++;
!     return SUCCESS;
!   }
!   
!   command result_t ExpLoggerI.incNumReplies() {
!     _numReplies++;
!     return SUCCESS;
!   }
! */
! 
!   command result_t ExpLoggerI.sendQueryLatency(uint32_t latency) {
!     TOS_MsgPtr msg = call MessageBufferI.getMsg();
!     if (msg != NULL)
!     {
!       struct AgillaExpLatencyMsg *lMsg = (struct AgillaExpLatencyMsg *)msg->data;
!       lMsg->latency = latency;
!       if (!call SendLatency.send(TOS_UART_ADDR, sizeof(AgillaExpLatencyMsg), msg))
!         call MessageBufferI.freeMsg(msg);
!     }
!     return SUCCESS;
!   }
! 
!   command result_t ExpLoggerI.sendTrace(uint16_t agentID, uint16_t nodeID,
!     uint16_t action, uint16_t success, AgillaLocation loc)
!   {   
!     return call ExpLoggerI.sendTraceQid(agentID, nodeID, action, 0, success, loc);
!   }
! 
!   command result_t ExpLoggerI.sendTraceQid(uint16_t agentID, uint16_t nodeID,
!     uint16_t action, uint16_t qid, uint16_t success, AgillaLocation loc)
!   {
!     TOS_MsgPtr msg = call MessageBufferI.getMsg();
!     if (msg != NULL)
!     {
!       struct AgillaTraceMsg *traceMsg = (struct AgillaTraceMsg *)msg->data;
!       traceMsg->timestamp = call Time.get();
!       traceMsg->agentID = agentID;
!       traceMsg->nodeID = nodeID;
!       traceMsg->action = action;
!       traceMsg->qid = qid;
!       traceMsg->success = success;
!       traceMsg->loc = loc;
!       if (!call SendTrace.send(TOS_UART_ADDR, sizeof(AgillaTraceMsg), msg))
!         call MessageBufferI.freeMsg(msg);
!     }
!     return SUCCESS;
!   }  
!   
!   
!   /**
!    * This is a special trace for recording operation GetAgents.
!    */
!   command result_t ExpLoggerI.sendGetAgentsResultsTrace(AgillaQueryReplyAllAgentsMsg* replyMsg)
!   {
!     TOS_MsgPtr msg = call MessageBufferI.getMsg();    
!     if (msg != NULL)
!     {
!       uint16_t i;
!       struct AgillaTraceGetAgentsMsg *traceMsg = (struct AgillaTraceGetAgentsMsg *)msg->data;
!       traceMsg->timestamp = call Time.get();
!       traceMsg->agentID = replyMsg->agent_id.id;
!       traceMsg->nodeID = TOS_LOCAL_ADDRESS;
!       traceMsg->qid = replyMsg->qid;
!       traceMsg->num_agents = replyMsg->num_agents;
!       for (i = 0; i < MAX_AGENT_NUM; i++) {
!         traceMsg->agent_id[i] = replyMsg->agent_info[i].agent_id;
!         traceMsg->loc[i] = replyMsg->agent_info[i].loc;
!       }
!       if (!call SendGetAgentsResultsTrace.send(TOS_UART_ADDR, sizeof(AgillaTraceGetAgentsMsg), msg))
!         call MessageBufferI.freeMsg(msg);
!     }
!     return SUCCESS;
!   }    
!   
! 
!   command result_t ExpLoggerI.sendSetCluster(uint16_t newClusterHead)
!   {
!     TOS_MsgPtr msg = call MessageBufferI.getMsg();
!     if (msg != NULL)
!     {
!       struct AgillaTraceMsg *traceMsg = (struct AgillaTraceMsg *)msg->data;
!       traceMsg->timestamp = call Time.get();
!       traceMsg->agentID = 0;
!       traceMsg->nodeID = TOS_LOCAL_ADDRESS;
!       traceMsg->action = SET_CLUSTER_HEAD;
!       traceMsg->success = newClusterHead;
!       traceMsg->loc.x = 0;
!       traceMsg->loc.y = 0;
!       if (!call SendTrace.send(TOS_UART_ADDR, sizeof(AgillaTraceMsg), msg))
!         call MessageBufferI.freeMsg(msg);
!     }
!     return SUCCESS;
!   }
! 
!   /**
!    * This task is executed when a query is received.
!    */
! /*  task void sendResults() {
!     TOS_MsgPtr msg = call MessageBufferI.getMsg();
!     if (msg != NULL)
!     {
!       struct AgillaExpResultsMsg *rMsg = (struct AgillaExpResultsMsg *)msg->data;
!       rMsg->numQueries = _numQueries;
!       rMsg->numUpdates = _numUpdates;
!       rMsg->numReplies = _numReplies;
!       if (!call SendResults.send(TOS_UART_ADDR, sizeof(AgillaExpResultsMsg), msg))
!         call MessageBufferI.freeMsg(msg);
!     }
!   }
! */
! 
! /*
!   event TOS_MsgPtr ReceiveQuery.receive(TOS_MsgPtr m)
!   {
!     #if DEBUG_EXP_LOGGER
!       dbg(DBG_USR1, "ExpLoggerM: Sending Results.\n");
!     #endif
!     post sendResults();
!     return m;
!   }
! */
! 
!   event result_t SendLatency.sendDone(TOS_MsgPtr m, result_t success)
!   {
!     call MessageBufferI.freeMsg(m);
!     return SUCCESS;
!   }
! 
!   event result_t SendResults.sendDone(TOS_MsgPtr m, result_t success)
!   {
!     call MessageBufferI.freeMsg(m);
!     return SUCCESS;
!   }
! 
!   event result_t SendTrace.sendDone(TOS_MsgPtr m, result_t success)
!   {
!     call MessageBufferI.freeMsg(m);
!     return SUCCESS;
!   }
! 
!   event result_t SendGetAgentsResultsTrace.sendDone(TOS_MsgPtr m, result_t success)
!   {
!     call MessageBufferI.freeMsg(m);
!     return SUCCESS;
!   }    
! }
--- 1,192 ----
! module ExpLoggerM
! {
!   provides {
!     interface StdControl;
!     interface ExpLoggerI;
!   }
!   uses {
!     interface SendMsg as SendResults;
!     interface SendMsg as SendLatency;
!     interface SendMsg as SendTrace;
!     interface SendMsg as SendGetAgentsResultsTrace;
!     //interface ReceiveMsg as ReceiveQuery;
!     interface MessageBufferI;
!     interface Time;
!   }
! }
! implementation {
! 
!   //uint16_t _numQueries, _numUpdates, _numReplies;
! 
!   command result_t StdControl.init() {
!     call ExpLoggerI.reset();
!     return SUCCESS;
!   }
! 
!   command result_t StdControl.start() {
!     return SUCCESS;
!   }
! 
!   command result_t StdControl.stop() {
!     return SUCCESS;
!   }
! 
!   command result_t ExpLoggerI.reset() {
!     /*_numQueries = 0;
!     _numUpdates = 0;
!     _numReplies = 0;*/
!     return SUCCESS;
!   }
! 
! /*  command result_t ExpLoggerI.incQueryMsg() {
!     _numQueries++;
!     return SUCCESS;
!   }
! 
!   command result_t ExpLoggerI.incNumUpdates() {
!     _numUpdates++;
!     return SUCCESS;
!   }
!   
!   command result_t ExpLoggerI.incNumReplies() {
!     _numReplies++;
!     return SUCCESS;
!   }
! */
! 
!   command result_t ExpLoggerI.sendQueryLatency(uint32_t latency) {
!     TOS_MsgPtr msg = call MessageBufferI.getMsg();
!     if (msg != NULL)
!     {
!       struct AgillaExpLatencyMsg *lMsg = (struct AgillaExpLatencyMsg *)msg->data;
!       lMsg->latency = latency;
!       if (!call SendLatency.send(TOS_UART_ADDR, sizeof(AgillaExpLatencyMsg), msg))
!         call MessageBufferI.freeMsg(msg);
!     }
!     return SUCCESS;
!   }
! 
!   command result_t ExpLoggerI.sendTrace(uint16_t agentID, uint16_t nodeID,
!     uint16_t action, uint16_t success, AgillaLocation loc)
!   {   
!     return call ExpLoggerI.sendTraceQid(agentID, nodeID, action, 0, success, loc);
!   }
! 
!   command result_t ExpLoggerI.sendTraceQid(uint16_t agentID, uint16_t nodeID,
!     uint16_t action, uint16_t qid, uint16_t success, AgillaLocation loc)
!   {
!     TOS_MsgPtr msg = call MessageBufferI.getMsg();
!     if (msg != NULL)
!     {
!       struct AgillaTraceMsg *traceMsg = (struct AgillaTraceMsg *)msg->data;
!       traceMsg->timestamp = call Time.get();
!       traceMsg->agentID = agentID;
!       traceMsg->nodeID = nodeID;
!       traceMsg->action = action;
!       traceMsg->qid = qid;
!       traceMsg->success = success;
!       traceMsg->loc = loc;
!       if (!call SendTrace.send(TOS_UART_ADDR, sizeof(AgillaTraceMsg), msg))
!         call MessageBufferI.freeMsg(msg);
!     }
!     return SUCCESS;
!   }  
!   
!   
!   /**
!    * This is a special trace for recording operation GetAgents.
!    */
!   command result_t ExpLoggerI.sendGetAgentsResultsTrace(AgillaQueryReplyAllAgentsMsg* replyMsg)
!   {
!     TOS_MsgPtr msg = call MessageBufferI.getMsg();    
!     if (msg != NULL)
!     {
!       uint16_t i;
!       struct AgillaTraceGetAgentsMsg *traceMsg = (struct AgillaTraceGetAgentsMsg *)msg->data;
!       traceMsg->timestamp = call Time.get();
!       traceMsg->agentID = replyMsg->agent_id.id;
!       traceMsg->nodeID = TOS_LOCAL_ADDRESS;
!       traceMsg->qid = replyMsg->qid;
!       traceMsg->num_agents = replyMsg->num_agents;
!       for (i = 0; i < MAX_AGENT_NUM; i++) {
!         traceMsg->agent_id[i] = replyMsg->agent_info[i].agent_id;
!         traceMsg->loc[i] = replyMsg->agent_info[i].loc;
!       }
!       if (!call SendGetAgentsResultsTrace.send(TOS_UART_ADDR, sizeof(AgillaTraceGetAgentsMsg), msg))
!         call MessageBufferI.freeMsg(msg);
!     }
!     return SUCCESS;
!   }    
!   
! 
!   command result_t ExpLoggerI.sendSetCluster(uint16_t newClusterHead)
!   {
!     TOS_MsgPtr msg = call MessageBufferI.getMsg();
!     if (msg != NULL)
!     {
!       struct AgillaTraceMsg *traceMsg = (struct AgillaTraceMsg *)msg->data;
!       traceMsg->timestamp = call Time.get();
!       traceMsg->agentID = 0;
!       traceMsg->nodeID = TOS_LOCAL_ADDRESS;
!       traceMsg->action = SET_CLUSTER_HEAD;
!       traceMsg->success = newClusterHead;
!       traceMsg->loc.x = 0;
!       traceMsg->loc.y = 0;
!       if (!call SendTrace.send(TOS_UART_ADDR, sizeof(AgillaTraceMsg), msg))
!         call MessageBufferI.freeMsg(msg);
!     }
!     return SUCCESS;
!   }
! 
!   /**
!    * This task is executed when a query is received.
!    */
! /*  task void sendResults() {
!     TOS_MsgPtr msg = call MessageBufferI.getMsg();
!     if (msg != NULL)
!     {
!       struct AgillaExpResultsMsg *rMsg = (struct AgillaExpResultsMsg *)msg->data;
!       rMsg->numQueries = _numQueries;
!       rMsg->numUpdates = _numUpdates;
!       rMsg->numReplies = _numReplies;
!       if (!call SendResults.send(TOS_UART_ADDR, sizeof(AgillaExpResultsMsg), msg))
!         call MessageBufferI.freeMsg(msg);
!     }
!   }
! */
! 
! /*
!   event TOS_MsgPtr ReceiveQuery.receive(TOS_MsgPtr m)
!   {
!     #if DEBUG_EXP_LOGGER
!       dbg(DBG_USR1, "ExpLoggerM: Sending Results.\n");
!     #endif
!     post sendResults();
!     return m;
!   }
! */
! 
!   event result_t SendLatency.sendDone(TOS_MsgPtr m, result_t success)
!   {
!     call MessageBufferI.freeMsg(m);
!     return SUCCESS;
!   }
! 
!   event result_t SendResults.sendDone(TOS_MsgPtr m, result_t success)
!   {
!     call MessageBufferI.freeMsg(m);
!     return SUCCESS;
!   }
! 
!   event result_t SendTrace.sendDone(TOS_MsgPtr m, result_t success)
!   {
!     call MessageBufferI.freeMsg(m);
!     return SUCCESS;
!   }
! 
!   event result_t SendGetAgentsResultsTrace.sendDone(TOS_MsgPtr m, result_t success)
!   {
!     call MessageBufferI.freeMsg(m);
!     return SUCCESS;
!   }    
! }



Index: LocationMgrC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/LocationMgrC.nc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** LocationMgrC.nc	7 Feb 2006 02:19:43 -0000	1.6
--- LocationMgrC.nc	18 May 2006 19:58:40 -0000	1.7
***************
*** 1,90 ****
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! includes Agilla;
! includes SpaceLocalizer;
! 
! /**
!  * Implements a virtual grid topology through which mote addresses may be
!  * mapped to specific location and vice-versa.  Also interfaces with the
!  * components that interact with the Cricket motes to obtain physical 
!  * location data.
!  *
!  * @author Chien-Liang Fok
!  */
! configuration LocationMgrC {
!   provides interface LocationMgrI; 
! }
! implementation {
!   components Main, LocationMgrM, NetworkInterfaceProxy as Comm, TimerC;
!   components LedsC;
! 
!   #if ENABLE_SPACE_LOCALIZER
!   #ifdef TOSH_HARDWARE_MICA2
!     components LEDBlinkerC, SpaceLocalizerC, CC1000RadioC;
!   #endif
!   #endif
! 
!   Main.StdControl -> LocationMgrM;
!   Main.StdControl -> TimerC;
!   
!   #if ENABLE_SPACE_LOCALIZER
!   #ifdef TOSH_HARDWARE_MICA2
!     Main.StdControl -> CC1000RadioC;
!   #endif
!   #endif
! 
!   LocationMgrI = LocationMgrM;
!     
!   // Grid size change
!   LocationMgrM.GridSizeTimer -> TimerC.Timer[unique("Timer")];
!   LocationMgrM.ReceiveGridSizeMsg -> Comm.ReceiveMsg[AM_AGILLAGRIDSIZEMSG];  
!   LocationMgrM.SendGridSizeMsg -> Comm.SendMsg[AM_AGILLAGRIDSIZEMSG];    
! 
!   #if ENABLE_SPACE_LOCALIZER
!   #ifdef TOSH_HARDWARE_MICA2
!     LocationMgrM.SpaceLocalizerI -> SpaceLocalizerC;
!     LocationMgrM.RadioControl -> CC1000RadioC;
!     LocationMgrM.CC1000Control -> CC1000RadioC;
!     //LocationMgrM.MoveTimer -> TimerC.Timer[unique("Timer")];
!     LocationMgrM.LEDBlinkerI -> LEDBlinkerC;
!   #endif
!   #endif
!   
!   LocationMgrM.Leds -> LedsC;
! }
--- 1,90 ----
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! includes Agilla;
! includes SpaceLocalizer;
! 
! /**
!  * Implements a virtual grid topology through which mote addresses may be
!  * mapped to specific location and vice-versa.  Also interfaces with the
!  * components that interact with the Cricket motes to obtain physical 
!  * location data.
!  *
!  * @author Chien-Liang Fok
!  */
! configuration LocationMgrC {
!   provides interface LocationMgrI; 
! }
! implementation {
!   components Main, LocationMgrM, NetworkInterfaceProxy as Comm, TimerC;
!   components LedsC;
! 
!   #if ENABLE_SPACE_LOCALIZER
!   #ifdef TOSH_HARDWARE_MICA2
!     components LEDBlinkerC, SpaceLocalizerC, CC1000RadioC;
!   #endif
!   #endif
! 
!   Main.StdControl -> LocationMgrM;
!   Main.StdControl -> TimerC;
!   
!   #if ENABLE_SPACE_LOCALIZER
!   #ifdef TOSH_HARDWARE_MICA2
!     Main.StdControl -> CC1000RadioC;
!   #endif
!   #endif
! 
!   LocationMgrI = LocationMgrM;
!     
!   // Grid size change
!   LocationMgrM.GridSizeTimer -> TimerC.Timer[unique("Timer")];
!   LocationMgrM.ReceiveGridSizeMsg -> Comm.ReceiveMsg[AM_AGILLAGRIDSIZEMSG];  
!   LocationMgrM.SendGridSizeMsg -> Comm.SendMsg[AM_AGILLAGRIDSIZEMSG];    
! 
!   #if ENABLE_SPACE_LOCALIZER
!   #ifdef TOSH_HARDWARE_MICA2
!     LocationMgrM.SpaceLocalizerI -> SpaceLocalizerC;
!     LocationMgrM.RadioControl -> CC1000RadioC;
!     LocationMgrM.CC1000Control -> CC1000RadioC;
!     //LocationMgrM.MoveTimer -> TimerC.Timer[unique("Timer")];
!     LocationMgrM.LEDBlinkerI -> LEDBlinkerC;
!   #endif
!   #endif
!   
!   LocationMgrM.Leds -> LedsC;
! }

Index: LocationMgrM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/LocationMgrM.nc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** LocationMgrM.nc	19 Dec 2005 16:22:38 -0000	1.5
--- LocationMgrM.nc	18 May 2006 19:58:40 -0000	1.6
***************
*** 1,236 ****
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! includes Agilla;
! includes SpaceLocalizer;
! includes LEDBlinker;
! 
! /**
!  * Implements a virtual grid topology through which mote addresses may be
!  * mapped to specific location and vice-versa.  Also interfaces with the
!  * components that interact with the Cricket motes to obtain physical 
!  * location data.
!  *
!  * @author Chien-Liang Fok
!  */
! module LocationMgrM {
!   provides {
!     interface StdControl;
!     interface LocationMgrI;
!   }
!   uses {
!     // The following interfaces allow the grid size to change.
!     interface Timer as GridSizeTimer;
!     interface ReceiveMsg as ReceiveGridSizeMsg;
!     interface SendMsg as SendGridSizeMsg;
!     
!     // Interfaces with the Cricket 2 Motes.
!     #if ENABLE_SPACE_LOCALIZER
!     #ifdef TOSH_HARDWARE_MICA2
!       interface SpaceLocalizerI;
!       interface StdControl as RadioControl;
!       interface CC1000Control;
!       interface LEDBlinkerI;
!       //interface Timer as MoveTimer;
!     #endif
!     #endif
!     
!     interface Leds;
!   }
! }
! implementation {
!   /**
!    * This is the number of rows and columns.  It is initialized to
!    * DEFAULT_NUM_COLUMNS as defined within Makefile.Agilla.
!    * It can be changed by broadcasting an AgillaGridSizeMsg
!    */
!   uint16_t numColumns;
! 
!   /**
!    * Keeps track of whether this mote is in the midst of changing
!    * grid sizes.
!    */
!   bool changingGridSize;  
!   
!   /**
!    * A buffer for sending grid update messages.
!    */
!   TOS_Msg msg;
!   
!   /**
!    * The number of times the LEDs blinked after the mote changed spaces.
!    */
!   //uint8_t moveCount;
!   
!   command result_t StdControl.init() {    
!     numColumns = DEFAULT_NUM_COLUMNS;
!     changingGridSize = FALSE;
!     call Leds.init();
!     return SUCCESS;
!   }
! 
!   command result_t StdControl.start() {
!     return SUCCESS;
!   }
! 
!   command result_t StdControl.stop()  {
!     return SUCCESS;
!   }  
!   
!   /**
!    * Converts an address to a location.
!    *
!    * @param addr The address.
!    * @param loc The location.
!    */
!   command result_t LocationMgrI.getLocation(uint16_t addr, AgillaLocation* loc) {
!     if (addr == TOS_BCAST_ADDR) {
!       loc->x = BCAST_X;
!       loc->y = BCAST_Y;
!     } 
!     else if (addr == TOS_UART_ADDR) {
!       loc->x = UART_X;
!       loc->y = UART_Y;
!     } 
!     else {
!       //loc->x = (addr-1) % numColumns + 1;
!       //loc->y = (addr - loc->x)/numColumns + 1;   
!       loc->x = (addr) % numColumns + 1;
!       loc->y = (addr - loc->x + 1)/numColumns + 1;         
!     }
!     return SUCCESS;
!   }
!   
!   /**
!    * Converts a location to an address.
!    *
!    * @param loc The location to convert.
!    * @return The address of the node at that location.
!    */
!   command uint16_t LocationMgrI.getAddress(AgillaLocation* loc) {
!     if (loc->x == UART_X && loc->y == UART_Y)
!       return TOS_UART_ADDR;      
!     else if (loc->x == BCAST_X && loc->y == BCAST_Y)
!       return TOS_BCAST_ADDR;
!     else
!      return loc->x + (loc->y - 1) * numColumns - 1;
!   }    
! 
!   #if ENABLE_SPACE_LOCALIZER
!   #ifdef TOSH_HARDWARE_MICA2
!     /**
!      * This event is generated whenever the closest
!      * cricket beacon mote changes.  It passes the
!      * name of the new closest space.
!      */  
!     event void SpaceLocalizerI.moved(char* spaceID) {
!       uint32_t freq;
!       call RadioControl.stop();
!       if (strcmp("DOCK", spaceID) == 0) {
!         freq = call CC1000Control.TuneManual(CC1000_CHANNEL_2);
!          if (freq == CC1000_CHANNEL_2) {
!            //moveCount = 0;
!            //call MoveTimer.start(TIMER_REPEAT, 128);
!            call LEDBlinkerI.blink(YELLOW | GREEN, 3, 128);
!          }
!       } else  {
!         freq = call CC1000Control.TuneManual(CC1000_CHANNEL_4);
!         if (freq == CC1000_CHANNEL_4) {
!           //moveCount = 0;
!           //call MoveTimer.start(TIMER_REPEAT, 128);
!           call LEDBlinkerI.blink(YELLOW | GREEN, 3, 128);
!         }
!       }
!       call RadioControl.start();   
!     }
! 
!     /*event result_t MoveTimer.fired() {
!       call Leds.yellowToggle();
!       call Leds.greenToggle();
!       if (++moveCount == 6)
!         call MoveTimer.stop();
!       return SUCCESS;
!     }*/
!     
!     event result_t LEDBlinkerI.blinkDone() {
!       return SUCCESS;
!     }    
!   #endif
!   #endif
! 
!   // -----------------------------------------------------------------------------------------
!   // The following methods allow the grid size to change.
!   
!   /**
!    * Floods the grid size message.  Each mote only broadcasts once.   
!    */
!   event TOS_MsgPtr ReceiveGridSizeMsg.receive(TOS_MsgPtr m) {
!     AgillaGridSizeMsg* gsmsg = (AgillaGridSizeMsg*)m->data;
!            
!     if (!changingGridSize) {  // only re-broadcast once (prevents recursive flooding)
!       if (numColumns != gsmsg->numCol) {
!         changingGridSize = TRUE;
!         call Leds.redOn();
!         call Leds.greenOn();
!         call Leds.yellowOn();
!         msg = *m;
!         numColumns = gsmsg->numCol;
!         call SendGridSizeMsg.send(TOS_BCAST_ADDR, sizeof(AgillaGridSizeMsg), &msg);
!         call GridSizeTimer.start(TIMER_ONE_SHOT, 1024);  // wait for flooding to finish   
!       }
!     }         
!     return m;
!   }
!   
!   /**
!    * Whenever the gridsize timer fires, turn off all LEDs and update the
!    * new possible neighbors.
!    */
!   event result_t GridSizeTimer.fired() {
!     call Leds.redOff();
!     call Leds.greenOff();
!     call Leds.yellowOff();    
!     changingGridSize = FALSE;    
!     return SUCCESS;
!   }  
! 
!   event result_t SendGridSizeMsg.sendDone(TOS_MsgPtr mesg, result_t success) {
!     return SUCCESS;
!   }    
! }
! 
--- 1,236 ----
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! includes Agilla;
! includes SpaceLocalizer;
! includes LEDBlinker;
! 
! /**
!  * Implements a virtual grid topology through which mote addresses may be
!  * mapped to specific location and vice-versa.  Also interfaces with the
!  * components that interact with the Cricket motes to obtain physical 
!  * location data.
!  *
!  * @author Chien-Liang Fok
!  */
! module LocationMgrM {
!   provides {
!     interface StdControl;
!     interface LocationMgrI;
!   }
!   uses {
!     // The following interfaces allow the grid size to change.
!     interface Timer as GridSizeTimer;
!     interface ReceiveMsg as ReceiveGridSizeMsg;
!     interface SendMsg as SendGridSizeMsg;
!     
!     // Interfaces with the Cricket 2 Motes.
!     #if ENABLE_SPACE_LOCALIZER
!     #ifdef TOSH_HARDWARE_MICA2
!       interface SpaceLocalizerI;
!       interface StdControl as RadioControl;
!       interface CC1000Control;
!       interface LEDBlinkerI;
!       //interface Timer as MoveTimer;
!     #endif
!     #endif
!     
!     interface Leds;
!   }
! }
! implementation {
!   /**
!    * This is the number of rows and columns.  It is initialized to
!    * DEFAULT_NUM_COLUMNS as defined within Makefile.Agilla.
!    * It can be changed by broadcasting an AgillaGridSizeMsg
!    */
!   uint16_t numColumns;
! 
!   /**
!    * Keeps track of whether this mote is in the midst of changing
!    * grid sizes.
!    */
!   bool changingGridSize;  
!   
!   /**
!    * A buffer for sending grid update messages.
!    */
!   TOS_Msg msg;
!   
!   /**
!    * The number of times the LEDs blinked after the mote changed spaces.
!    */
!   //uint8_t moveCount;
!   
!   command result_t StdControl.init() {    
!     numColumns = DEFAULT_NUM_COLUMNS;
!     changingGridSize = FALSE;
!     call Leds.init();
!     return SUCCESS;
!   }
! 
!   command result_t StdControl.start() {
!     return SUCCESS;
!   }
! 
!   command result_t StdControl.stop()  {
!     return SUCCESS;
!   }  
!   
!   /**
!    * Converts an address to a location.
!    *
!    * @param addr The address.
!    * @param loc The location.
!    */
!   command result_t LocationMgrI.getLocation(uint16_t addr, AgillaLocation* loc) {
!     if (addr == TOS_BCAST_ADDR) {
!       loc->x = BCAST_X;
!       loc->y = BCAST_Y;
!     } 
!     else if (addr == TOS_UART_ADDR) {
!       loc->x = UART_X;
!       loc->y = UART_Y;
!     } 
!     else {
!       //loc->x = (addr-1) % numColumns + 1;
!       //loc->y = (addr - loc->x)/numColumns + 1;   
!       loc->x = (addr) % numColumns + 1;
!       loc->y = (addr - loc->x + 1)/numColumns + 1;         
!     }
!     return SUCCESS;
!   }
!   
!   /**
!    * Converts a location to an address.
!    *
!    * @param loc The location to convert.
!    * @return The address of the node at that location.
!    */
!   command uint16_t LocationMgrI.getAddress(AgillaLocation* loc) {
!     if (loc->x == UART_X && loc->y == UART_Y)
!       return TOS_UART_ADDR;      
!     else if (loc->x == BCAST_X && loc->y == BCAST_Y)
!       return TOS_BCAST_ADDR;
!     else
!      return loc->x + (loc->y - 1) * numColumns - 1;
!   }    
! 
!   #if ENABLE_SPACE_LOCALIZER
!   #ifdef TOSH_HARDWARE_MICA2
!     /**
!      * This event is generated whenever the closest
!      * cricket beacon mote changes.  It passes the
!      * name of the new closest space.
!      */  
!     event void SpaceLocalizerI.moved(char* spaceID) {
!       uint32_t freq;
!       call RadioControl.stop();
!       if (strcmp("DOCK", spaceID) == 0) {
!         freq = call CC1000Control.TuneManual(CC1000_CHANNEL_2);
!          if (freq == CC1000_CHANNEL_2) {
!            //moveCount = 0;
!            //call MoveTimer.start(TIMER_REPEAT, 128);
!            call LEDBlinkerI.blink(YELLOW | GREEN, 3, 128);
!          }
!       } else  {
!         freq = call CC1000Control.TuneManual(CC1000_CHANNEL_4);
!         if (freq == CC1000_CHANNEL_4) {
!           //moveCount = 0;
!           //call MoveTimer.start(TIMER_REPEAT, 128);
!           call LEDBlinkerI.blink(YELLOW | GREEN, 3, 128);
!         }
!       }
!       call RadioControl.start();   
!     }
! 
!     /*event result_t MoveTimer.fired() {
!       call Leds.yellowToggle();
!       call Leds.greenToggle();
!       if (++moveCount == 6)
!         call MoveTimer.stop();
!       return SUCCESS;
!     }*/
!     
!     event result_t LEDBlinkerI.blinkDone() {
!       return SUCCESS;
!     }    
!   #endif
!   #endif
! 
!   // -----------------------------------------------------------------------------------------
!   // The following methods allow the grid size to change.
!   
!   /**
!    * Floods the grid size message.  Each mote only broadcasts once.   
!    */
!   event TOS_MsgPtr ReceiveGridSizeMsg.receive(TOS_MsgPtr m) {
!     AgillaGridSizeMsg* gsmsg = (AgillaGridSizeMsg*)m->data;
!            
!     if (!changingGridSize) {  // only re-broadcast once (prevents recursive flooding)
!       if (numColumns != gsmsg->numCol) {
!         changingGridSize = TRUE;
!         call Leds.redOn();
!         call Leds.greenOn();
!         call Leds.yellowOn();
!         msg = *m;
!         numColumns = gsmsg->numCol;
!         call SendGridSizeMsg.send(TOS_BCAST_ADDR, sizeof(AgillaGridSizeMsg), &msg);
!         call GridSizeTimer.start(TIMER_ONE_SHOT, 1024);  // wait for flooding to finish   
!       }
!     }         
!     return m;
!   }
!   
!   /**
!    * Whenever the gridsize timer fires, turn off all LEDs and update the
!    * new possible neighbors.
!    */
!   event result_t GridSizeTimer.fired() {
!     call Leds.redOff();
!     call Leds.greenOff();
!     call Leds.yellowOff();    
!     changingGridSize = FALSE;    
!     return SUCCESS;
!   }  
! 
!   event result_t SendGridSizeMsg.sendDone(TOS_MsgPtr mesg, result_t success) {
!     return SUCCESS;
!   }    
! }
! 


Index: MessageBufferM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/MessageBufferM.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MessageBufferM.nc	21 Apr 2006 21:56:58 -0000	1.3
--- MessageBufferM.nc	18 May 2006 19:58:40 -0000	1.4
***************
*** 1,120 ****
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2006, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! module MessageBufferM {
!   provides {
!     interface StdControl;
!     interface MessageBufferI;
!   }
! }
! implementation {
!   TOS_Msg msgBuff[MESSAGE_BUFFER_SIZE];
!   TOS_MsgPtr msgBuffPtr[MESSAGE_BUFFER_SIZE];
!   
!   command result_t StdControl.init() {
!     uint16_t i;
!     for (i = 0; i < MESSAGE_BUFFER_SIZE; i++) {
!       msgBuffPtr[i] = &msgBuff[i];
!     }
!     return SUCCESS;
!   }
!   
!   command result_t StdControl.start() {
!     return SUCCESS;
!   }
!   
!   command result_t StdControl.stop() {
!     return SUCCESS;
!   }
!   
!   command TOS_MsgPtr MessageBufferI.getMsg() 
!   {    
!     uint16_t i;
!     
!     #if DEBUG_MESSAGE_BUFFER
!       uint16_t j, k;
!     #endif
!     
!     for (i = 0; i < MESSAGE_BUFFER_SIZE; i++) {
!       if (msgBuffPtr[i] != NULL) {
!         TOS_MsgPtr result = msgBuffPtr[i];
!         msgBuffPtr[i] = NULL;
! 
!         #if DEBUG_MESSAGE_BUFFER
!           j = 0;
!           for (k = 0; k < MESSAGE_BUFFER_SIZE; k++) {
!             if (msgBuffPtr[k] != NULL)
!               j++;
!           }
!           dbg(DBG_USR1, "MessageBufferI: buffer %i allocated, %i free.\n", i, j);      
!         #endif
!         
!         return result;
!       }  
!     }
!     
!     dbg(DBG_USR1, "MessageBufferI.getMsg(): ERROR: No free buffers.\n");          
!     return NULL;
!   }
!   
!   command result_t MessageBufferI.freeMsg(TOS_MsgPtr msg) 
!   {
!     uint16_t i;
!     
!     #if DEBUG_MESSAGE_BUFFER
!       uint16_t freeCount, k;
!     #endif
!     
!     for (i = 0; i < MESSAGE_BUFFER_SIZE; i++) {  
!       if (msgBuffPtr[i] == NULL) {
!         msgBuffPtr[i] = msg;
! 
!         #if DEBUG_MESSAGE_BUFFER
!           freeCount = 0;
!           for (k = 0; k < MESSAGE_BUFFER_SIZE; k++) {
!             if (msgBuffPtr[k] != NULL)
!               freeCount++;
!           }        
!           dbg(DBG_USR1, "MessageBufferI: buffer %i de-allocated, %i free.\n", i, freeCount);      
!         #endif
!         
!         return SUCCESS;
!       }
!     }
!     return FAIL;
!   }
! }
--- 1,120 ----
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2006, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! module MessageBufferM {
!   provides {
!     interface StdControl;
!     interface MessageBufferI;
!   }
! }
! implementation {
!   TOS_Msg msgBuff[MESSAGE_BUFFER_SIZE];
!   TOS_MsgPtr msgBuffPtr[MESSAGE_BUFFER_SIZE];
!   
!   command result_t StdControl.init() {
!     uint16_t i;
!     for (i = 0; i < MESSAGE_BUFFER_SIZE; i++) {
!       msgBuffPtr[i] = &msgBuff[i];
!     }
!     return SUCCESS;
!   }
!   
!   command result_t StdControl.start() {
!     return SUCCESS;
!   }
!   
!   command result_t StdControl.stop() {
!     return SUCCESS;
!   }
!   
!   command TOS_MsgPtr MessageBufferI.getMsg() 
!   {    
!     uint16_t i;
!     
!     #if DEBUG_MESSAGE_BUFFER
!       uint16_t j, k;
!     #endif
!     
!     for (i = 0; i < MESSAGE_BUFFER_SIZE; i++) {
!       if (msgBuffPtr[i] != NULL) {
!         TOS_MsgPtr result = msgBuffPtr[i];
!         msgBuffPtr[i] = NULL;
! 
!         #if DEBUG_MESSAGE_BUFFER
!           j = 0;
!           for (k = 0; k < MESSAGE_BUFFER_SIZE; k++) {
!             if (msgBuffPtr[k] != NULL)
!               j++;
!           }
!           dbg(DBG_USR1, "MessageBufferI: buffer %i allocated, %i free.\n", i, j);      
!         #endif
!         
!         return result;
!       }  
!     }
!     
!     dbg(DBG_USR1, "MessageBufferI.getMsg(): ERROR: No free buffers.\n");          
!     return NULL;
!   }
!   
!   command result_t MessageBufferI.freeMsg(TOS_MsgPtr msg) 
!   {
!     uint16_t i;
!     
!     #if DEBUG_MESSAGE_BUFFER
!       uint16_t freeCount, k;
!     #endif
!     
!     for (i = 0; i < MESSAGE_BUFFER_SIZE; i++) {  
!       if (msgBuffPtr[i] == NULL) {
!         msgBuffPtr[i] = msg;
! 
!         #if DEBUG_MESSAGE_BUFFER
!           freeCount = 0;
!           for (k = 0; k < MESSAGE_BUFFER_SIZE; k++) {
!             if (msgBuffPtr[k] != NULL)
!               freeCount++;
!           }        
!           dbg(DBG_USR1, "MessageBufferI: buffer %i de-allocated, %i free.\n", i, freeCount);      
!         #endif
!         
!         return SUCCESS;
!       }
!     }
!     return FAIL;
!   }
! }

Index: OpStackC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/OpStackC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** OpStackC.nc	6 Feb 2006 09:40:39 -0000	1.2
--- OpStackC.nc	18 May 2006 19:58:40 -0000	1.3
***************
*** 1,53 ****
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! includes Agilla;
! 
! configuration OpStackC {
!   provides interface OpStackI;      
! }
! implementation {
!   components OpStackM, VarUtilC, ErrorMgrProxy, TupleUtilC;
!   
!   OpStackI = OpStackM;
!   
!   OpStackM.VarUtilI -> VarUtilC;
!   OpStackM.TupleUtilI -> TupleUtilC;
!   OpStackM.ErrorMgrI -> ErrorMgrProxy;
! }
!   
--- 1,53 ----
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! includes Agilla;
! 
! configuration OpStackC {
!   provides interface OpStackI;      
! }
! implementation {
!   components OpStackM, VarUtilC, ErrorMgrProxy, TupleUtilC;
!   
!   OpStackI = OpStackM;
!   
!   OpStackM.VarUtilI -> VarUtilC;
!   OpStackM.TupleUtilI -> TupleUtilC;
!   OpStackM.ErrorMgrI -> ErrorMgrProxy;
! }
!   



Index: QueueProxy.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/QueueProxy.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** QueueProxy.nc	6 Feb 2006 09:40:39 -0000	1.2
--- QueueProxy.nc	18 May 2006 19:58:40 -0000	1.3
***************
*** 1,83 ****
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! /*
!  * "Copyright (c) 2002 and The Regents of the University 
!  * of California.  All rights reserved.
!  *
!  * Permission to use, copy, modify, and distribute this software and
!  * its documentation for any purpose, without fee, and without written
!  * agreement is hereby granted, provided that the above copyright
!  * notice, the following two paragraphs and the author appear in all
!  * copies of this software.
!  * 
!  * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY
!  * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
!  * DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
!  * DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN
!  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!  * 
!  * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
!  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
!  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE
!  * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
!  * CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
!  * UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
!  *
!  * Authors:   Philip Levis
!  *              Neil Patel
!  * Date last modified:  9/10/02
!  *
!  */
! 
! /**
!  * @author Philip Levis
!  * @author Neil Patel
!  */
! 
! includes Agilla;
! configuration QueueProxy {
!   provides interface QueueI;
! }
! implementation {
!   components Queue, ErrorMgrProxy;
! 
!   QueueI = Queue;
!   Queue.ErrorMgrI -> ErrorMgrProxy;
! }
!   
--- 1,83 ----
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! /*
!  * "Copyright (c) 2002 and The Regents of the University 
!  * of California.  All rights reserved.
!  *
!  * Permission to use, copy, modify, and distribute this software and
!  * its documentation for any purpose, without fee, and without written
!  * agreement is hereby granted, provided that the above copyright
!  * notice, the following two paragraphs and the author appear in all
!  * copies of this software.
!  * 
!  * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY
!  * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
!  * DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
!  * DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN
!  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
!  * 
!  * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
!  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
!  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE
!  * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
!  * CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
!  * UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
!  *
!  * Authors:   Philip Levis
!  *              Neil Patel
!  * Date last modified:  9/10/02
!  *
!  */
! 
! /**
!  * @author Philip Levis
!  * @author Neil Patel
!  */
! 
! includes Agilla;
! configuration QueueProxy {
!   provides interface QueueI;
! }
! implementation {
!   components Queue, ErrorMgrProxy;
! 
!   QueueI = Queue;
!   Queue.ErrorMgrI -> ErrorMgrProxy;
! }
!   

Index: RemoteTSOpMgrC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/RemoteTSOpMgrC.nc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** RemoteTSOpMgrC.nc	6 Feb 2006 09:40:39 -0000	1.5
--- RemoteTSOpMgrC.nc	18 May 2006 19:58:40 -0000	1.6
***************
*** 1,85 ****
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! /**
!  * Handles remote tuple space requests.
!  *
!  * @author Chien-Liang Fok
!  */
! configuration RemoteTSOpMgrC {
!   provides interface RemoteTSOpMgrI;
! }
! implementation {
!   components Main, RemoteTSOpMgrM;
!   components NetworkInterfaceProxy as Comm, TupleUtilC, TupleSpaceProxy;
!   components TimerC, RandomLFSR, NeighborListProxy, AddressMgrC;
!   components ErrorMgrProxy, MessageBufferM;
!   components LocationMgrC;
!   components LedsC;
!   
! 
!   Main.StdControl -> RemoteTSOpMgrM;
!   Main.StdControl -> TupleSpaceProxy;
!   Main.StdControl -> MessageBufferM;
!   Main.StdControl -> TimerC;
!   
!   RemoteTSOpMgrI = RemoteTSOpMgrM;
!   
!   RemoteTSOpMgrM.Rcv_Req -> Comm.ReceiveMsg[AM_AGILLATSREQMSG];
!   RemoteTSOpMgrM.Rcv_Res -> Comm.ReceiveMsg[AM_AGILLATSRESMSG];
!   RemoteTSOpMgrM.Rcv_GRes -> Comm.ReceiveMsg[AM_AGILLATSGRESMSG];
!   
!   RemoteTSOpMgrM.Send_Req -> Comm.SendMsg[AM_AGILLATSREQMSG];    // for forwarding to BS
!   RemoteTSOpMgrM.Send_Res -> Comm.SendMsg[AM_AGILLATSRESMSG];
!   RemoteTSOpMgrM.Send_GRes -> Comm.SendMsg[AM_AGILLATSGRESMSG];
!   
!   RemoteTSOpMgrM.Timeout -> TimerC.Timer[unique("Timer")];  
!   
!   RemoteTSOpMgrM.BackoffTimer -> TimerC.Timer[unique("Timer")];
!   RemoteTSOpMgrM.Random -> RandomLFSR;
!   
!   RemoteTSOpMgrM.AddressMgrI-> AddressMgrC;  
!   RemoteTSOpMgrM.NeighborListI -> NeighborListProxy;
!   RemoteTSOpMgrM.TupleSpaceI -> TupleSpaceProxy;
!   RemoteTSOpMgrM.TupleUtilI -> TupleUtilC;  
!   RemoteTSOpMgrM.ErrorMgrI -> ErrorMgrProxy;  
!   RemoteTSOpMgrM.MessageBufferI -> MessageBufferM;
!   RemoteTSOpMgrM.LocationMgrI -> LocationMgrC;
!   
!   RemoteTSOpMgrM.Leds -> LedsC;
! }
--- 1,85 ----
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! /**
!  * Handles remote tuple space requests.
!  *
!  * @author Chien-Liang Fok
!  */
! configuration RemoteTSOpMgrC {
!   provides interface RemoteTSOpMgrI;
! }
! implementation {
!   components Main, RemoteTSOpMgrM;
!   components NetworkInterfaceProxy as Comm, TupleUtilC, TupleSpaceProxy;
!   components TimerC, RandomLFSR, NeighborListProxy, AddressMgrC;
!   components ErrorMgrProxy, MessageBufferM;
!   components LocationMgrC;
!   components LedsC;
!   
! 
!   Main.StdControl -> RemoteTSOpMgrM;
!   Main.StdControl -> TupleSpaceProxy;
!   Main.StdControl -> MessageBufferM;
!   Main.StdControl -> TimerC;
!   
!   RemoteTSOpMgrI = RemoteTSOpMgrM;
!   
!   RemoteTSOpMgrM.Rcv_Req -> Comm.ReceiveMsg[AM_AGILLATSREQMSG];
!   RemoteTSOpMgrM.Rcv_Res -> Comm.ReceiveMsg[AM_AGILLATSRESMSG];
!   RemoteTSOpMgrM.Rcv_GRes -> Comm.ReceiveMsg[AM_AGILLATSGRESMSG];
!   
!   RemoteTSOpMgrM.Send_Req -> Comm.SendMsg[AM_AGILLATSREQMSG];    // for forwarding to BS
!   RemoteTSOpMgrM.Send_Res -> Comm.SendMsg[AM_AGILLATSRESMSG];
!   RemoteTSOpMgrM.Send_GRes -> Comm.SendMsg[AM_AGILLATSGRESMSG];
!   
!   RemoteTSOpMgrM.Timeout -> TimerC.Timer[unique("Timer")];  
!   
!   RemoteTSOpMgrM.BackoffTimer -> TimerC.Timer[unique("Timer")];
!   RemoteTSOpMgrM.Random -> RandomLFSR;
!   
!   RemoteTSOpMgrM.AddressMgrI-> AddressMgrC;  
!   RemoteTSOpMgrM.NeighborListI -> NeighborListProxy;
!   RemoteTSOpMgrM.TupleSpaceI -> TupleSpaceProxy;
!   RemoteTSOpMgrM.TupleUtilI -> TupleUtilC;  
!   RemoteTSOpMgrM.ErrorMgrI -> ErrorMgrProxy;  
!   RemoteTSOpMgrM.MessageBufferI -> MessageBufferM;
!   RemoteTSOpMgrM.LocationMgrI -> LocationMgrC;
!   
!   RemoteTSOpMgrM.Leds -> LedsC;
! }

Index: RemoteTSOpMgrDummy.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/RemoteTSOpMgrDummy.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RemoteTSOpMgrDummy.nc	6 Feb 2006 09:40:39 -0000	1.1
--- RemoteTSOpMgrDummy.nc	18 May 2006 19:58:40 -0000	1.2
***************
*** 1,63 ****
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2006, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! includes Agilla;
! includes TupleSpace;
! includes AgillaOpcodes;
! 
! /**
!  * A dummy RemoteTSOpMgr.
!  *
!  * @author Chien-Liang Fok
!  */
! module RemoteTSOpMgrDummy {
!   provides interface RemoteTSOpMgrI;
! }
! implementation 
! {
!   default event result_t RemoteTSOpMgrI.done(AgillaAgentContext* agent, uint16_t dest, result_t success){
!     return SUCCESS;
!   }
!   
!   command result_t RemoteTSOpMgrI.execute(AgillaAgentContext* agent, 
!     uint16_t op, uint16_t dest, AgillaTuple tuple)
!   {
!     return SUCCESS;
!   }
! }
! 
--- 1,63 ----
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2006, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! includes Agilla;
! includes TupleSpace;
! includes AgillaOpcodes;
! 
! /**
!  * A dummy RemoteTSOpMgr.
!  *
!  * @author Chien-Liang Fok
!  */
! module RemoteTSOpMgrDummy {
!   provides interface RemoteTSOpMgrI;
! }
! implementation 
! {
!   default event result_t RemoteTSOpMgrI.done(AgillaAgentContext* agent, uint16_t dest, result_t success){
!     return SUCCESS;
!   }
!   
!   command result_t RemoteTSOpMgrI.execute(AgillaAgentContext* agent, 
!     uint16_t op, uint16_t dest, AgillaTuple tuple)
!   {
!     return SUCCESS;
!   }
! }
! 

Index: RemoteTSOpMgrM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/RemoteTSOpMgrM.nc,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** RemoteTSOpMgrM.nc	20 Apr 2006 22:05:58 -0000	1.20
--- RemoteTSOpMgrM.nc	18 May 2006 19:58:40 -0000	1.21
***************
*** 1,687 ****
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2006, Washington University in Saint Louis
!  * By Chien-Liang Fok.
!  *
!  * Washington University states that Agilla is free software;
!  * you can redistribute it and/or modify it under the terms of
!  * the current version of the GNU Lesser General Public License
!  * as published by the Free Software Foundation.
[...1345 lines suppressed...]
!     call MessageBufferI.freeMsg(m);
!     return SUCCESS;
!   }
! 
! 
!   event result_t Send_GRes.sendDone(TOS_MsgPtr m, result_t success)
!   {
!     call MessageBufferI.freeMsg(m);
!     return SUCCESS;
!   }
! 
! 
!   event result_t Send_Res.sendDone(TOS_MsgPtr m, result_t success)
!   {
!     call MessageBufferI.freeMsg(m);
!     return SUCCESS;
!   }
! 
! }
! 


Index: ResetMgrC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/ResetMgrC.nc,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** ResetMgrC.nc	7 Apr 2006 01:14:35 -0000	1.9
--- ResetMgrC.nc	18 May 2006 19:58:40 -0000	1.10
***************
*** 50,54 ****
  
  implementation {
!   components ResetMgrM;//, ResetC;
    components NetworkInterfaceProxy as Comm, AddressMgrC;
    components LEDBlinkerC;
--- 50,54 ----
  
  implementation {
!   components ResetMgrM, ResetC;
    components NetworkInterfaceProxy as Comm, AddressMgrC;
    components LEDBlinkerC;
***************
*** 73,77 ****
    ResetMgrM.TupleSpaceI -> TupleSpaceProxy;
    ResetMgrM.AgentMgrI -> AgentMgrC;
!   //ResetMgrM.Reset -> ResetC;
    ResetMgrM.AddressMgrI -> AddressMgrC;
    ResetMgrM.ErrorMgrI -> ErrorMgrProxy;
--- 73,77 ----
    ResetMgrM.TupleSpaceI -> TupleSpaceProxy;
    ResetMgrM.AgentMgrI -> AgentMgrC;
!   ResetMgrM.Reset -> ResetC;
    ResetMgrM.AddressMgrI -> AddressMgrC;
    ResetMgrM.ErrorMgrI -> ErrorMgrProxy;

Index: ResetMgrM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/ResetMgrM.nc,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ResetMgrM.nc	7 Apr 2006 01:14:37 -0000	1.7
--- ResetMgrM.nc	18 May 2006 19:58:40 -0000	1.8
***************
*** 51,55 ****
    }
    uses {
!     //interface Reset;
      interface AgentMgrI;
      interface TupleSpaceI;
--- 51,56 ----
    }
    uses {
!     interface Reset;
!     
      interface AgentMgrI;
      interface TupleSpaceI;
***************
*** 172,176 ****
      {
        dbg(DBG_USR1, "ResetMgrM: Resetting...\n");
!       //call Reset.reset();
        call AgentMgrI.resetAll();
        call TupleSpaceI.reset();
--- 173,178 ----
      {
        dbg(DBG_USR1, "ResetMgrM: Resetting...\n");
!       call Reset.reset();
!       
        call AgentMgrI.resetAll();
        call TupleSpaceI.reset();







Index: TimeSyncC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/TimeSyncC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TimeSyncC.nc	20 Mar 2006 14:31:46 -0000	1.2
--- TimeSyncC.nc	18 May 2006 19:58:40 -0000	1.3
***************
*** 1,68 ****
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! includes TimeSync;
! 
! 
! /**
!  * Wires up all of the components used for synchronizing the time.
!  *
!  * @author Chien-Liang Fok
!  */
! configuration TimeSyncC 
! {
!   provides interface StdControl;  
! }
! implementation 
! {
!   components TimeSyncM, AddressMgrC, SimpleTime, MessageBufferM;
!   components LedsC, TimerC, NetworkInterfaceProxy as NIC;
!  
!   StdControl = TimerC;
!   StdControl = TimeSyncM;
!   StdControl = MessageBufferM;
! 
!   TimeSyncM.AddressMgrI -> AddressMgrC;
!   TimeSyncM.Time -> SimpleTime;
!   TimeSyncM.TimeSet -> SimpleTime;
!   TimeSyncM.MessageBufferI -> MessageBufferM;
!   TimeSyncM.Timer -> TimerC.Timer[unique("Timer")];  
!   TimeSyncM.SendTime -> NIC.SendMsg[AM_AGILLATIMESYNCMSG];
!   TimeSyncM.ReceiveTime -> NIC.ReceiveMsg[AM_AGILLATIMESYNCMSG]; 
!   TimeSyncM.Leds -> LedsC;
! }
--- 1,68 ----
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! includes TimeSync;
! 
! 
! /**
!  * Wires up all of the components used for synchronizing the time.
!  *
!  * @author Chien-Liang Fok
!  */
! configuration TimeSyncC 
! {
!   provides interface StdControl;  
! }
! implementation 
! {
!   components TimeSyncM, AddressMgrC, SimpleTime, MessageBufferM;
!   components LedsC, TimerC, NetworkInterfaceProxy as NIC;
!  
!   StdControl = TimerC;
!   StdControl = TimeSyncM;
!   StdControl = MessageBufferM;
! 
!   TimeSyncM.AddressMgrI -> AddressMgrC;
!   TimeSyncM.Time -> SimpleTime;
!   TimeSyncM.TimeSet -> SimpleTime;
!   TimeSyncM.MessageBufferI -> MessageBufferM;
!   TimeSyncM.Timer -> TimerC.Timer[unique("Timer")];  
!   TimeSyncM.SendTime -> NIC.SendMsg[AM_AGILLATIMESYNCMSG];
!   TimeSyncM.ReceiveTime -> NIC.ReceiveMsg[AM_AGILLATIMESYNCMSG]; 
!   TimeSyncM.Leds -> LedsC;
! }

Index: TimeSyncM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/TimeSyncM.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TimeSyncM.nc	6 Apr 2006 02:10:05 -0000	1.4
--- TimeSyncM.nc	18 May 2006 19:58:40 -0000	1.5
***************
*** 1,133 ****
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! includes TimeSync;
! 
! /**
!  * Wires up all of the components used for synchronizing the time.
!  *
!  * @author Chien-Liang Fok
!  */
! module TimeSyncM
! {
!   provides interface StdControl;  
!   uses 
!   {
!     interface AddressMgrI;
!     interface Time;
!     interface TimeSet;
!     interface MessageBufferI;
!     interface Timer;
!     interface SendMsg as SendTime;
!     interface ReceiveMsg as ReceiveTime;
!     interface Leds;
!   }
! }
! implementation 
! {
!   
!   command result_t StdControl.init() 
!   {
!     tos_time_t t;
!     t.high32 = 0;
!     t.low32 = 0;
!     call TimeSet.set(t);
!     call Leds.init();  // reset time to be 0
!     return SUCCESS;
!   }
!   
!   command result_t StdControl.start() 
!   {
!     call Timer.start(TIMER_REPEAT, 1024*10);
!     return SUCCESS;
!   }
!   
!   command result_t StdControl.stop() 
!   {
!     return SUCCESS;
!   }
!   
!   /**
!    * Send the time to the base station.
!    */
!   task void sendTime() 
!   {
!     TOS_MsgPtr msg = call MessageBufferI.getMsg();
!     if (msg != NULL)
!     {
!       AgillaTimeSyncMsg* timeMsg = (AgillaTimeSyncMsg *)msg->data;
!       timeMsg->time = call Time.get();
!       
!       if (!call SendTime.send(TOS_UART_ADDR, sizeof(AgillaTimeSyncMsg), msg))
!       {
!         call MessageBufferI.freeMsg(msg);
!       }
!     }
!   }
!   
!   event result_t Timer.fired()
!   {
!     if (call AddressMgrI.isGW())
!     {
!       #if DEBUG_TIMESYNC
!         dbg(DBG_USR1, "TimeSyncM: Timer.fired(): Sending time sync message\n");    
!       #endif    
!       post sendTime();      
!     } else
!     {
!       #if DEBUG_TIMESYNC
!         dbg(DBG_USR1, "TimeSyncM: Timer.fired(): NOT sending time sync message\n");    
!       #endif        
!     }
!     return SUCCESS;
!   }
!   
!   event TOS_MsgPtr ReceiveTime.receive(TOS_MsgPtr m)
!   {
!     AgillaTimeSyncMsg* timeMsg = (AgillaTimeSyncMsg *)m->data;
!     call TimeSet.set(timeMsg->time);
!     //call Leds.yellowToggle();
!     return m;
!   }
!   
!   event result_t SendTime.sendDone(TOS_MsgPtr m, result_t success)
!   {
!     call MessageBufferI.freeMsg(m);
!     return SUCCESS;
!   }
! }
--- 1,133 ----
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! includes TimeSync;
! 
! /**
!  * Wires up all of the components used for synchronizing the time.
!  *
!  * @author Chien-Liang Fok
!  */
! module TimeSyncM
! {
!   provides interface StdControl;  
!   uses 
!   {
!     interface AddressMgrI;
!     interface Time;
!     interface TimeSet;
!     interface MessageBufferI;
!     interface Timer;
!     interface SendMsg as SendTime;
!     interface ReceiveMsg as ReceiveTime;
!     interface Leds;
!   }
! }
! implementation 
! {
!   
!   command result_t StdControl.init() 
!   {
!     tos_time_t t;
!     t.high32 = 0;
!     t.low32 = 0;
!     call TimeSet.set(t);
!     call Leds.init();  // reset time to be 0
!     return SUCCESS;
!   }
!   
!   command result_t StdControl.start() 
!   {
!     call Timer.start(TIMER_REPEAT, 1024*10);
!     return SUCCESS;
!   }
!   
!   command result_t StdControl.stop() 
!   {
!     return SUCCESS;
!   }
!   
!   /**
!    * Send the time to the base station.
!    */
!   task void sendTime() 
!   {
!     TOS_MsgPtr msg = call MessageBufferI.getMsg();
!     if (msg != NULL)
!     {
!       AgillaTimeSyncMsg* timeMsg = (AgillaTimeSyncMsg *)msg->data;
!       timeMsg->time = call Time.get();
!       
!       if (!call SendTime.send(TOS_UART_ADDR, sizeof(AgillaTimeSyncMsg), msg))
!       {
!         call MessageBufferI.freeMsg(msg);
!       }
!     }
!   }
!   
!   event result_t Timer.fired()
!   {
!     if (call AddressMgrI.isGW())
!     {
!       #if DEBUG_TIMESYNC
!         dbg(DBG_USR1, "TimeSyncM: Timer.fired(): Sending time sync message\n");    
!       #endif    
!       post sendTime();      
!     } else
!     {
!       #if DEBUG_TIMESYNC
!         dbg(DBG_USR1, "TimeSyncM: Timer.fired(): NOT sending time sync message\n");    
!       #endif        
!     }
!     return SUCCESS;
!   }
!   
!   event TOS_MsgPtr ReceiveTime.receive(TOS_MsgPtr m)
!   {
!     AgillaTimeSyncMsg* timeMsg = (AgillaTimeSyncMsg *)m->data;
!     call TimeSet.set(timeMsg->time);
!     //call Leds.yellowToggle();
!     return m;
!   }
!   
!   event result_t SendTime.sendDone(TOS_MsgPtr m, result_t success)
!   {
!     call MessageBufferI.freeMsg(m);
!     return SUCCESS;
!   }
! }

Index: TupleSpaceC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/wustl/apps/Agilla/components/TupleSpaceC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TupleSpaceC.nc	6 Feb 2006 09:40:39 -0000	1.2
--- TupleSpaceC.nc	18 May 2006 19:58:40 -0000	1.3
***************
*** 1,58 ****
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By Chien-Liang Fok.
!  * 
!  * Washington University states that Agilla is free software; 
!  * you can redistribute it and/or modify it under the terms of 
!  * the current version of the GNU Lesser General Public License 
!  * as published by the Free Software Foundation.
!  * 
!  * Agilla is distributed in the hope that it will be useful, but 
!  * THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR 
!  * IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 
!  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
!  *
!  * YOU UNDERSTAND THAT AGILLA IS PROVIDED "AS IS" FOR WHICH NO 
!  * WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO 
!  * WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF 
!  * INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER 
!  * PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS 
!  * FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS", 
!  * OR OTHER HARMFUL CODE.  
!  *
!  * YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR 
!  * ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF 
!  * INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to 
!  * indemnify, defend, and hold harmless WU, its employees, officers and 
!  * agents from any and all claims, costs, or liabilities, including 
!  * attorneys fees and court costs at both the trial and appellate levels 
!  * for any loss, damage, or injury caused by your actions or actions of 
!  * your officers, servants, agents or third parties acting on behalf or 
!  * under authorization from you, as a result of using Agilla. 
!  *
!  * See the GNU Lesser General Public License for more details, which can 
!  * be found here: http://www.gnu.org/copyleft/lesser.html
!  */
! 
! includes Agilla;
! includes TupleSpace;
! 
! configuration TupleSpaceC {
!   provides interface TupleSpaceI;   
!   provides interface StdControl;
! }
! implementation {
!   components TupleSpaceM, OpStackC;
!   components ErrorMgrProxy, TupleUtilC;
!   components LedsC;
!     
!   TupleSpaceI = TupleSpaceM;
!   StdControl = TupleSpaceM;    
!   
!   TupleSpaceM.OpStackI -> OpStackC;
!   TupleSpaceM.ErrorMgrI -> ErrorMgrProxy;  
!   TupleSpaceM.TupleUtilI -> TupleUtilC;  
!   TupleSpaceM.Leds -> LedsC;
! }
--- 1,58 ----
! // $Id$
! 
! /* Agilla - A middleware for wireless sensor networks.
!  * Copyright (C) 2004, Washington University in Saint Louis 
!  * By