]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - apps/tests/mica2/mts300/TestMts300C.nc
Add new app to test xmts310 sensor driver.
[tinyos-2.x.git] / apps / tests / mica2 / mts300 / TestMts300C.nc
index 42c78527422d3d13438bcc5bd3f13cc5570b8d3e..c08f06f9cbad451955e043cef93fe5b8e0a69bba 100644 (file)
@@ -1,55 +1,86 @@
-/**
- *  Copyright (c) 2004-2005 Crossbow Technology, Inc.
- *  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 (updated) modification history and the author appear in
- *  all copies of this source code.
- *
- *  Permission is also granted to distribute this software under the
- *  standard BSD license as contained in the TinyOS distribution.
- *
- *  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 COPYRIGHT HOLDERS OR CONTRIBUTORS 
- *  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
- *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, LOSS OF USE, DATA, 
- *  OR PROFITS) 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.
- *
- *  @author Martin Turon <mturon@xbow.com>
- *
- *  $Id$
- */
-
-/**
- * This application tests the mts300 sensorboard.
- * Specifically, this handles the thermistor and light sensors.
- * 
- * @author  Martin Turon
- * @date    October 19, 2005
- */
-configuration TestMts300C {
-}
-implementation
-{
-  components MainC, TestMts300P, LedsC, new OskiTimerMilliC(),
-      SensorMts300C;
-
-  
-  MainC.SoftwareInit -> SensorMts300C;
-
-  TestMts300P -> MainC.Boot;
-  TestMts300P.Leds -> LedsC;
-  TestMts300P.AppTimer -> OskiTimerMilliC;
-
-  TestMts300P.SensorControl -> SensorMts300C;
-  TestMts300P.Temp -> SensorMts300C.Temp;
-  TestMts300P.Light -> SensorMts300C.Light;
-}
-
+// $Id$\r
+\r
+/*\r
+ *  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\r
+ *  downloading, copying, installing or using the software you agree to\r
+ *  this license.  If you do not agree to this license, do not download,\r
+ *  install, copy or use the software.\r
+ *\r
+ *  Copyright (c) 2004-2006 Crossbow Technology, Inc.\r
+ *  All rights reserved.\r
+ *\r
+ *  Permission to use, copy, modify, and distribute this software and its\r
+ *  documentation for any purpose, without fee, and without written\r
+ *  agreement is hereby granted, provided that the above copyright\r
+ *  notice, the (updated) modification history and the author appear in\r
+ *  all copies of this source code.\r
+ *\r
+ *  Permission is also granted to distribute this software under the\r
+ *  standard BSD license as contained in the TinyOS distribution.\r
+ *\r
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+ *  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\r
+ *  PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE INTEL OR ITS\r
+ *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
+ *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
+ *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\r
+ *  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\r
+ *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
+ *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r
+ *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ */\r
+\r
+/**\r
+ *  TinyOS 1.x to TinyOS 2.x translation layer.\r
+ *\r
+ *  @author Alif <rlchen@xbow.com.cn>  \r
+ */\r
+\r
+#include "XMTS300.h"\r
+#include "mts300.h"\r
+\r
+configuration TestMts300C\r
+{\r
+}\r
+implementation\r
+{\r
+  components MainC, TestMts300P, LedsC, NoLedsC;\r
+  components new TimerMilliC() as MTS300Timer;\r
+\r
+  components ActiveMessageC as Radio;\r
+  components SerialActiveMessageC as Serial;\r
+\r
+// sensorboard devices\r
+  components new SensorMts300C();\r
+  components SounderC;\r
+\r
+  TestMts300P -> MainC.Boot;\r
+\r
+  TestMts300P.MTS300Timer -> MTS300Timer;\r
+  TestMts300P.Leds -> NoLedsC;\r
+\r
+  // communication\r
+  TestMts300P.RadioControl -> Radio;\r
+  TestMts300P.RadioSend -> Radio.AMSend[AM_MTS300MSG];\r
+  TestMts300P.RadioPacket -> Radio;\r
+\r
+  TestMts300P.UartControl -> Serial;\r
+  TestMts300P.UartSend -> Serial.AMSend[AM_MTS300MSG];\r
+  TestMts300P.UartPacket -> Serial;\r
+\r
+  // sensor components\r
+  MainC.SoftwareInit -> SensorMts300C;\r
+  TestMts300P.MTS300Control -> SensorMts300C.StdControl;\r
+  TestMts300P.Vref -> SensorMts300C.Vref;\r
+  TestMts300P.Light -> SensorMts300C.Light;\r
+  TestMts300P.Temp -> SensorMts300C.Temp;\r
+  TestMts300P.Microphone -> SensorMts300C.Microphone;\r
+  TestMts300P.AccelX -> SensorMts300C.AccelX;\r
+  TestMts300P.AccelY -> SensorMts300C.AccelY;\r
+  TestMts300P.MagX -> SensorMts300C.MagX;\r
+  TestMts300P.MagY -> SensorMts300C.MagY;\r
+\r
+  MainC.SoftwareInit -> SounderC;\r
+  TestMts300P.Sounder -> SounderC;\r
+}\r