]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Initial revision
authorkristinwright <kristinwright>
Fri, 4 Nov 2005 18:20:16 +0000 (18:20 +0000)
committerkristinwright <kristinwright>
Fri, 4 Nov 2005 18:20:16 +0000 (18:20 +0000)
21 files changed:
apps/tests/eyesIFX/Radio/TestBasicMac/Makefile [new file with mode: 0644]
apps/tests/eyesIFX/Radio/TestBasicMac/TestBasicMacC.nc [new file with mode: 0644]
apps/tests/eyesIFX/Radio/TestBasicMac/TestBasicMacM.nc [new file with mode: 0644]
apps/tests/eyesIFX/Radio/TestHAL/TestTDA5250Control/Makefile [new file with mode: 0644]
apps/tests/eyesIFX/Radio/TestHAL/TestTDA5250Control/TestTDA5250ControlC.nc [new file with mode: 0644]
apps/tests/eyesIFX/Radio/TestHAL/TestTDA5250Control/TestTDA5250ControlM.nc [new file with mode: 0644]
apps/tests/eyesIFX/Radio/TestHPL/Makefile [new file with mode: 0644]
apps/tests/eyesIFX/Radio/TestHPL/TestHPLTDA5250C.nc [new file with mode: 0644]
apps/tests/eyesIFX/Radio/TestHPL/TestHPLTDA5250M.nc [new file with mode: 0644]
apps/tests/eyesIFX/Radio/TestPacketSerializer/Makefile [new file with mode: 0644]
apps/tests/eyesIFX/Radio/TestPacketSerializer/TestPacketSerializerC.nc [new file with mode: 0644]
apps/tests/eyesIFX/Radio/TestPacketSerializer/TestPacketSerializerM.nc [new file with mode: 0644]
apps/tests/eyesIFX/Radio/TestUARTPhy/Makefile [new file with mode: 0644]
apps/tests/eyesIFX/Radio/TestUARTPhy/TestUARTPhyC.nc [new file with mode: 0644]
apps/tests/eyesIFX/Radio/TestUARTPhy/TestUARTPhyM.nc [new file with mode: 0644]
apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/Makefile [new file with mode: 0644]
apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/TestUARTPhyC.nc [new file with mode: 0644]
apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/TestUARTPhyM.nc [new file with mode: 0644]
apps/tests/eyesIFX/Timer/Makefile [new file with mode: 0644]
apps/tests/eyesIFX/Timer/TestTimerC.nc [new file with mode: 0644]
apps/tests/eyesIFX/Timer/TestTimerM.nc [new file with mode: 0644]

diff --git a/apps/tests/eyesIFX/Radio/TestBasicMac/Makefile b/apps/tests/eyesIFX/Radio/TestBasicMac/Makefile
new file mode 100644 (file)
index 0000000..f27412b
--- /dev/null
@@ -0,0 +1,4 @@
+COMPONENT=TestBasicMacC
+CFLAGS += -I%T/oski/services -I%T/oski/interfaces -I%T/oski/types -I%T/oski/impls
+include $(MAKERULES)
+
diff --git a/apps/tests/eyesIFX/Radio/TestBasicMac/TestBasicMacC.nc b/apps/tests/eyesIFX/Radio/TestBasicMac/TestBasicMacC.nc
new file mode 100644 (file)
index 0000000..dcc451d
--- /dev/null
@@ -0,0 +1,79 @@
+/*                                  tab:4
+ * "Copyright (c) 2000-2003 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."
+ *
+ * Copyright (c) 2002-2003 Intel Corporation
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached INTEL-LICENSE
+ * file. If you do not find these files, copies can be found by writing to
+ * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
+ * 94704.  Attention:  Intel License Inquiry.
+ */
+/**
+ *
+ **/
+
+includes Timer;
+includes TOSMsg;
+configuration TestBasicMacC {
+}
+implementation {
+  components Main, TestBasicMacM
+           , new AlarmMilliC() as SendTimer
+           , new OSKITimerMsC() as RxTimeoutTimer
+           , LedsC
+           , TDA5250RadioC
+           , RandomLfsrC
+           , UARTPhyM
+           , PacketSerializerM
+           , BasicMacM
+           ;
+
+  Main.SoftwareInit -> TDA5250RadioC.Init;
+  Main.SoftwareInit -> RandomLfsrC.Init;
+  Main.SoftwareInit -> LedsC.Init;
+  Main.SoftwareInit -> UARTPhyM.Init;
+       Main.SoftwareInit -> PacketSerializerM.Init;
+  Main.SoftwareInit -> BasicMacM.Init;
+  TestBasicMacM -> Main.Boot;
+
+  TestBasicMacM.Random -> RandomLfsrC.Random;
+  TestBasicMacM.SendTimer -> SendTimer;
+  TestBasicMacM.Leds  -> LedsC;
+  TestBasicMacM.Send -> PacketSerializerM.Send; 
+  TestBasicMacM.Receive -> PacketSerializerM.Receive; 
+  TestBasicMacM.MacSplitControl -> BasicMacM.SplitControl; 
+  
+  PacketSerializerM.RadioByteComm -> BasicMacM.RadioByteComm;
+  PacketSerializerM.PhyPacketTx -> BasicMacM.PhyPacketTx;
+  PacketSerializerM.PhyPacketRx -> BasicMacM.PhyPacketRx;    
+  
+  BasicMacM.TDA5250Control -> TDA5250RadioC.TDA5250Control; 
+  BasicMacM.TDA5250RadioByteComm -> UARTPhyM.SerializerRadioByteComm;
+  BasicMacM.TDA5250PhyPacketTx -> UARTPhyM.PhyPacketTx;
+  BasicMacM.TDA5250PhyPacketRx -> UARTPhyM.PhyPacketRx;     
+  BasicMacM.RxTimeoutTimer -> RxTimeoutTimer;  
+  BasicMacM.RadioSplitControl -> TDA5250RadioC.SplitControl;    
+
+  UARTPhyM.RadioByteComm -> TDA5250RadioC.RadioByteComm;    
+}
+
+
+
diff --git a/apps/tests/eyesIFX/Radio/TestBasicMac/TestBasicMacM.nc b/apps/tests/eyesIFX/Radio/TestBasicMac/TestBasicMacM.nc
new file mode 100644 (file)
index 0000000..10e5800
--- /dev/null
@@ -0,0 +1,83 @@
+// $Id$
+
+/*                                  tab:4
+ * "Copyright (c) 2000-2003 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."
+ *
+ * Copyright (c) 2002-2003 Intel Corporation
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached INTEL-LICENSE
+ * file. If you do not find these files, copies can be found by writing to
+ * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
+ * 94704.  Attention:  Intel License Inquiry.
+ */
+
+module TestBasicMacM {
+  uses {
+    interface Boot;
+    interface SplitControl as MacSplitControl;
+    interface Alarm<TMilli, uint32_t> as SendTimer;
+    interface Leds;
+    interface Random;
+    interface Send;
+    interface Receive;
+  }
+}
+
+implementation {
+  
+  #define TIMER_RATE    500
+  #define NUM_BYTES     TOSH_DATA_LENGTH
+  
+  message_t sendMsg;
+  
+  event void Boot.booted() {
+    uint8_t i;
+    for(i=0; i<NUM_BYTES; i++)
+      sendMsg.data[i] = 0xF0;//call Random.rand16() / 2;
+    call MacSplitControl.start();
+  }
+  
+  event void MacSplitControl.startDone(error_t error) {
+    call Send.send(&sendMsg, NUM_BYTES);  
+  }
+  
+  event void MacSplitControl.stopDone(error_t error) {
+    call SendTimer.stop();
+  }  
+  
+  async event void SendTimer.fired() {
+    call Send.send(&sendMsg, NUM_BYTES);
+  }
+  
+  event void Send.sendDone(message_t* msg, error_t error) {
+    if(error == SUCCESS)
+                 call Leds.led0Toggle();
+         else call Leds.led2Toggle();
+    call SendTimer.start(call Random.rand16() % TIMER_RATE);
+  }
+  
+  event message_t* Receive.receive(message_t* msg, void* payload, uint8_t len) {
+    call Leds.led1Toggle();
+    return msg;
+  }
+}
+
+
diff --git a/apps/tests/eyesIFX/Radio/TestHAL/TestTDA5250Control/Makefile b/apps/tests/eyesIFX/Radio/TestHAL/TestTDA5250Control/Makefile
new file mode 100644 (file)
index 0000000..8fff11f
--- /dev/null
@@ -0,0 +1,4 @@
+COMPONENT=TestTDA5250ControlC
+CFLAGS += -I%T/oski/services -I%T/oski/interfaces -I%T/oski/types -I%T/oski/impls
+include $(MAKERULES)
+
diff --git a/apps/tests/eyesIFX/Radio/TestHAL/TestTDA5250Control/TestTDA5250ControlC.nc b/apps/tests/eyesIFX/Radio/TestHAL/TestTDA5250Control/TestTDA5250ControlC.nc
new file mode 100644 (file)
index 0000000..69fc084
--- /dev/null
@@ -0,0 +1,57 @@
+/*                                  tab:4
+ * "Copyright (c) 2000-2003 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."
+ *
+ * Copyright (c) 2002-2003 Intel Corporation
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached INTEL-LICENSE
+ * file. If you do not find these files, copies can be found by writing to
+ * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
+ * 94704.  Attention:  Intel License Inquiry.
+ */
+/**
+ *
+ **/
+
+includes Timer;
+configuration TestTDA5250ControlC {
+}
+implementation {
+  components Main, TestTDA5250ControlM
+           , new AlarmMilliC() as ModeTimer
+           , LedsC
+           , TDA5250RadioC
+           , RandomLfsrC
+           ;
+
+  Main.SoftwareInit -> TDA5250RadioC.Init;
+  Main.SoftwareInit -> RandomLfsrC.Init;
+  Main.SoftwareInit -> LedsC.Init;
+  TestTDA5250ControlM -> Main.Boot;
+
+  TestTDA5250ControlM.Random -> RandomLfsrC.Random;
+  TestTDA5250ControlM.ModeTimer -> ModeTimer;
+  TestTDA5250ControlM.Leds  -> LedsC;
+  TestTDA5250ControlM.TDA5250Control -> TDA5250RadioC.TDA5250Control;
+  TestTDA5250ControlM.RadioSplitControl -> TDA5250RadioC.SplitControl;
+}
+
+
+
diff --git a/apps/tests/eyesIFX/Radio/TestHAL/TestTDA5250Control/TestTDA5250ControlM.nc b/apps/tests/eyesIFX/Radio/TestHAL/TestTDA5250Control/TestTDA5250ControlM.nc
new file mode 100644 (file)
index 0000000..67193a5
--- /dev/null
@@ -0,0 +1,140 @@
+// $Id$
+
+/*                                  tab:4
+ * "Copyright (c) 2000-2003 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."
+ *
+ * Copyright (c) 2002-2003 Intel Corporation
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached INTEL-LICENSE
+ * file. If you do not find these files, copies can be found by writing to
+ * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
+ * 94704.  Attention:  Intel License Inquiry.
+ */
+
+module TestTDA5250ControlM {
+  uses {
+    interface Boot;
+    interface Alarm<TMilli, uint32_t> as ModeTimer;
+    interface Leds;
+    interface TDA5250Control;
+    interface Random;
+    interface SplitControl as RadioSplitControl;
+  }
+}
+
+implementation {
+  
+  #define MODE_TIMER_RATE 500
+  
+  uint8_t mode;
+  
+  event void Boot.booted() {
+    atomic mode = 0;
+    call RadioSplitControl.start();
+  }
+  
+  event void RadioSplitControl.startDone(error_t error) {
+    call ModeTimer.start(MODE_TIMER_RATE);
+  }
+  
+  event void RadioSplitControl.stopDone(error_t error) {
+    call ModeTimer.stop();
+  }  
+
+  /***********************************************************************
+   * Commands and events
+   ***********************************************************************/   
+
+  async event void ModeTimer.fired() {
+    switch(mode) {
+      case 0:
+        call TDA5250Control.TimerMode(call Random.rand16() % MODE_TIMER_RATE/20, 
+                                      call Random.rand16() % MODE_TIMER_RATE/20);
+        break;
+      case 1:
+        call TDA5250Control.SelfPollingMode(call Random.rand16() % MODE_TIMER_RATE/20, 
+                                            call Random.rand16() % MODE_TIMER_RATE/20);        
+        break;
+      case 2:
+        call TDA5250Control.RxMode();
+        break;
+      case 3:
+        call TDA5250Control.TxMode();
+        break;
+      case 4:
+        call TDA5250Control.SleepMode();
+        break;
+      case 5:
+        call TDA5250Control.CCAMode();
+        break;
+    }
+  }
+  
+  async event void TDA5250Control.PWDDDInterrupt() {
+    //call TDA5250Control.RxMode();
+  }
+  
+  async event void TDA5250Control.TimerModeDone(){
+    atomic mode = call Random.rand16() % 6;
+    call Leds.led0On();
+    call Leds.led1On();
+    call Leds.led2On();   
+    call ModeTimer.start(call Random.rand16() % MODE_TIMER_RATE);     
+  }
+  async event void TDA5250Control.SelfPollingModeDone(){
+    atomic mode = call Random.rand16() % 6;
+    call Leds.led0On();
+    call Leds.led1On();
+    call Leds.led2Off();   
+    call ModeTimer.start(call Random.rand16() % MODE_TIMER_RATE);           
+  }  
+  async event void TDA5250Control.RxModeDone(){
+    atomic mode = call Random.rand16() % 6;
+    call Leds.led0On();
+    call Leds.led1Off();
+    call Leds.led2On();  
+    call ModeTimer.start(call Random.rand16() % MODE_TIMER_RATE);      
+  }
+  async event void TDA5250Control.TxModeDone(){
+    atomic mode = call Random.rand16() % 6;
+    call Leds.led0Off();
+    call Leds.led1On();
+    call Leds.led2On();  
+    call ModeTimer.start(call Random.rand16() % MODE_TIMER_RATE);  
+  }    
+  async event void TDA5250Control.SleepModeDone(){
+    atomic mode = call Random.rand16() % 6;
+    call Leds.led0Off();
+    call Leds.led1Off();
+    call Leds.led2On();  
+    call ModeTimer.start(call Random.rand16() % MODE_TIMER_RATE);          
+  }
+  async event void TDA5250Control.CCAModeDone(){
+    atomic mode = call Random.rand16() % 6;
+    call Leds.led0On();
+    call Leds.led1Off();
+    call Leds.led2Off();
+    call ModeTimer.start(call Random.rand16() % MODE_TIMER_RATE);    
+  }  
+  
+}
+
+
diff --git a/apps/tests/eyesIFX/Radio/TestHPL/Makefile b/apps/tests/eyesIFX/Radio/TestHPL/Makefile
new file mode 100644 (file)
index 0000000..1fb5dde
--- /dev/null
@@ -0,0 +1,4 @@
+COMPONENT=TestHPLTDA5250C
+CFLAGS += -I%T/oski/services -I%T/oski/interfaces -I%T/oski/types -I%T/oski/impls
+include $(MAKERULES)
+
diff --git a/apps/tests/eyesIFX/Radio/TestHPL/TestHPLTDA5250C.nc b/apps/tests/eyesIFX/Radio/TestHPL/TestHPLTDA5250C.nc
new file mode 100644 (file)
index 0000000..7aa95ce
--- /dev/null
@@ -0,0 +1,58 @@
+// $Id$
+
+/*                                  tab:4
+ * "Copyright (c) 2000-2003 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."
+ *
+ * Copyright (c) 2002-2003 Intel Corporation
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached INTEL-LICENSE
+ * file. If you do not find these files, copies can be found by writing to
+ * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
+ * 94704.  Attention:  Intel License Inquiry.
+ */
+/**
+ *
+ **/
+
+includes Timer;
+configuration TestHPLTDA5250C {
+}
+implementation {
+  components Main
+           , TestHPLTDA5250M
+           , new AlarmMilliC() as ModeTimer
+           , LedsC
+           , TDA5250ConfigC
+           ;
+
+  TestHPLTDA5250M -> Main.Boot;
+  
+  Main.SoftwareInit -> LedsC;
+  Main.SoftwareInit -> TDA5250ConfigC;
+
+  TestHPLTDA5250M.Resource -> TDA5250ConfigC.Resource;
+  TestHPLTDA5250M.ModeTimer -> ModeTimer;
+  TestHPLTDA5250M.Leds  -> LedsC;
+  TestHPLTDA5250M.TDA5250Config -> TDA5250ConfigC;
+}
+
+
+
diff --git a/apps/tests/eyesIFX/Radio/TestHPL/TestHPLTDA5250M.nc b/apps/tests/eyesIFX/Radio/TestHPL/TestHPLTDA5250M.nc
new file mode 100644 (file)
index 0000000..676de52
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2004, Technische Universitat Berlin
+ * 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 Technische Universitat Berlin 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 COPYRIGHT
+ * OWNER OR 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.
+ * - Revision -------------------------------------------------------------
+ * $Revision$
+ * $Date$ 
+ * ======================================================================== 
+ */
+ /**
+ * TestTDA5250M Application
+ * Test Application for the HPL layer of the TDA5250 radio
+ *
+ * @author Kevin Klues (klues@tkn.tu-berlin.de)
+ */
+
+module TestHPLTDA5250M {
+  uses {
+    interface Boot;
+    interface Leds;
+    interface Alarm<TMilli, uint32_t> as ModeTimer;
+    interface TDA5250Config;
+    interface Resource;
+  }  
+}
+
+implementation {
+  
+  uint8_t mode;
+   
+  event void Boot.booted() {
+    mode = 0;
+    call Resource.request();
+  }
+  
+  event void Resource.granted() {
+         call TDA5250Config.reset();
+    call ModeTimer.start(50);
+  }
+  
+  event void Resource.requested() {
+    call ModeTimer.stop();
+    call Resource.release();
+    call Resource.request();
+  }  
+
+  /***********************************************************************
+   * Commands and events
+   ***********************************************************************/
+  async event void ModeTimer.fired() {
+    if(mode == 0) {
+      call TDA5250Config.SetRxMode();
+      mode = 1;
+      call Leds.led0Off();
+      call Leds.led1Off();
+      call Leds.led2Off();     
+    }
+    else if(mode == 1) {
+      call TDA5250Config.SetTxMode();
+      mode = 2;
+      call Leds.led0Off();
+      call Leds.led1Off();
+      call Leds.led2On();       
+    }     
+    else if(mode == 2) {
+      call TDA5250Config.SetTimerMode(5, 5);
+      mode = 3;
+      call Leds.led0Off();
+      call Leds.led1On();
+      call Leds.led2Off();    
+    }
+    else if(mode == 3) {
+      call TDA5250Config.SetSelfPollingMode(5, 5);
+      mode = 4;
+      call Leds.led0Off();
+      call Leds.led1On();
+      call Leds.led2On(); 
+    }    
+    else {
+      call TDA5250Config.SetSlaveMode();
+      call TDA5250Config.SetSleepMode();
+      mode = 0;
+      call Leds.led0On();
+      call Leds.led1Off();
+      call Leds.led2Off();
+    }   
+    call ModeTimer.start(50);
+  }
+  
+  async event void TDA5250Config.PWDDDInterrupt() {
+    TOSH_TOGGLE_LED3_PIN();
+  } 
+}
+
+
diff --git a/apps/tests/eyesIFX/Radio/TestPacketSerializer/Makefile b/apps/tests/eyesIFX/Radio/TestPacketSerializer/Makefile
new file mode 100644 (file)
index 0000000..89a0995
--- /dev/null
@@ -0,0 +1,4 @@
+COMPONENT=TestPacketSerializerC
+CFLAGS += -I%T/oski/services -I%T/oski/interfaces -I%T/oski/types -I%T/oski/impls
+include $(MAKERULES)
+
diff --git a/apps/tests/eyesIFX/Radio/TestPacketSerializer/TestPacketSerializerC.nc b/apps/tests/eyesIFX/Radio/TestPacketSerializer/TestPacketSerializerC.nc
new file mode 100644 (file)
index 0000000..d56341a
--- /dev/null
@@ -0,0 +1,80 @@
+/*                                  tab:4
+ * "Copyright (c) 2000-2003 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."
+ *
+ * Copyright (c) 2002-2003 Intel Corporation
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached INTEL-LICENSE
+ * file. If you do not find these files, copies can be found by writing to
+ * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
+ * 94704.  Attention:  Intel License Inquiry.
+ */
+/**
+ *
+ **/
+
+includes Timer;
+includes TOSMsg;
+configuration TestPacketSerializerC {
+}
+implementation {
+  components Main, TestPacketSerializerM
+           , new AlarmMilliC() as TxTimer
+           , new AlarmMilliC() as RxTimer
+           , new AlarmMilliC() as CCATimer
+//            , new AlarmMilliC() as TimerTimer
+           , new AlarmMilliC() as SelfPollingTimer
+//            , new AlarmMilliC() as SleepTimer
+           , LedsC
+           , TDA5250RadioC
+           , RandomLfsrC
+           , UARTPhyM
+           , PacketSerializerM
+           ;
+
+  Main.SoftwareInit -> TDA5250RadioC.Init;
+  Main.SoftwareInit -> RandomLfsrC.Init;
+  Main.SoftwareInit -> LedsC.Init;
+  Main.SoftwareInit -> UARTPhyM.Init;
+       Main.SoftwareInit -> PacketSerializerM.Init;
+  TestPacketSerializerM -> Main.Boot;
+
+  TestPacketSerializerM.Random -> RandomLfsrC.Random;
+  TestPacketSerializerM.TxTimer -> TxTimer;
+  TestPacketSerializerM.RxTimer -> RxTimer;
+  TestPacketSerializerM.CCATimer -> CCATimer;
+//   TestPacketSerializerM.TimerTimer -> TimerTimer;
+  TestPacketSerializerM.SelfPollingTimer -> SelfPollingTimer;
+//   TestPacketSerializerM.SleepTimer -> SleepTimer;
+  TestPacketSerializerM.Leds  -> LedsC;
+  TestPacketSerializerM.TDA5250Control -> TDA5250RadioC.TDA5250Control;
+  TestPacketSerializerM.RadioSplitControl -> TDA5250RadioC.SplitControl; 
+  TestPacketSerializerM.Send -> PacketSerializerM.Send; 
+  TestPacketSerializerM.Receive -> PacketSerializerM.Receive; 
+
+  UARTPhyM.RadioByteComm -> TDA5250RadioC.RadioByteComm;    
+   
+  PacketSerializerM.RadioByteComm -> UARTPhyM.SerializerRadioByteComm;
+  PacketSerializerM.PhyPacketTx -> UARTPhyM.PhyPacketTx;
+  PacketSerializerM.PhyPacketRx -> UARTPhyM.PhyPacketRx;  
+}
+
+
+
diff --git a/apps/tests/eyesIFX/Radio/TestPacketSerializer/TestPacketSerializerM.nc b/apps/tests/eyesIFX/Radio/TestPacketSerializer/TestPacketSerializerM.nc
new file mode 100644 (file)
index 0000000..3354e4c
--- /dev/null
@@ -0,0 +1,186 @@
+// $Id$
+
+/*                                  tab:4
+ * "Copyright (c) 2000-2003 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."
+ *
+ * Copyright (c) 2002-2003 Intel Corporation
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached INTEL-LICENSE
+ * file. If you do not find these files, copies can be found by writing to
+ * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
+ * 94704.  Attention:  Intel License Inquiry.
+ */
+
+module TestPacketSerializerM {
+  uses {
+    interface Boot;
+    interface Alarm<TMilli, uint32_t> as TxTimer;
+    interface Alarm<TMilli, uint32_t> as RxTimer;
+//     interface Alarm<TMilli, uint32_t> as TimerTimer;
+    interface Alarm<TMilli, uint32_t> as CCATimer;
+    interface Alarm<TMilli, uint32_t> as SelfPollingTimer;    
+//     interface Alarm<TMilli, uint32_t> as SleepTimer;
+    interface Leds;
+    interface TDA5250Control;
+    interface Random;
+    interface SplitControl as RadioSplitControl;
+    interface Send;
+    interface Receive;
+  }
+}
+
+implementation {
+  
+  #define TIMER_RATE    500
+  #define NUM_BYTES     TOSH_DATA_LENGTH
+  
+  uint8_t bytes_sent;
+  bool sending;
+  message_t sendMsg;
+  
+  event void Boot.booted() {
+    uint8_t i;
+    bytes_sent = 0;
+    sending = FALSE;
+    for(i=0; i<NUM_BYTES; i++)
+      sendMsg.data[i] = 0x00;//call Random.rand16() / 2;
+    call RadioSplitControl.start();
+  }
+  
+  event void RadioSplitControl.startDone(error_t error) {
+    call TxTimer.start(call Random.rand16() % TIMER_RATE);
+//     call TimerTimer.start(call Random.rand16() % TIMER_RATE); 
+               call SelfPollingTimer.start(call Random.rand16() % TIMER_RATE); 
+    call RxTimer.start(call Random.rand16() % TIMER_RATE); 
+    call CCATimer.start(call Random.rand16() % TIMER_RATE); 
+  }
+  
+  event void RadioSplitControl.stopDone(error_t error) {
+    call TxTimer.stop();
+  }  
+
+  /***********************************************************************
+   * Commands and events
+   ***********************************************************************/   
+
+  async event void TxTimer.fired() {
+    atomic {
+      if(call TDA5250Control.TxMode() != FAIL) {
+        bytes_sent = 0;
+        sending = TRUE;
+        call Leds.led0On();
+        call Leds.led1On();
+        call Leds.led2On();
+        return;
+      }
+    }
+    call TxTimer.start(call Random.rand16() % TIMER_RATE); 
+  }
+  
+  async event void RxTimer.fired() {
+    if(sending == FALSE)
+      if(call TDA5250Control.RxMode() != FAIL)
+        return;
+    call RxTimer.start(call Random.rand16() % TIMER_RATE); 
+  }
+  
+  async event void CCATimer.fired() {
+    if(sending == FALSE)  
+      if(call TDA5250Control.CCAMode() != FAIL)
+        return;
+    call CCATimer.start(call Random.rand16() % TIMER_RATE); 
+  }
+  
+//   async event void TimerTimer.fired() {
+//     if(sending == FALSE)  
+//       if(call TDA5250Control.TimerMode(call Random.rand16() % TIMER_RATE/20, 
+//                                        call Random.rand16() % TIMER_RATE/20) != FAIL)                        
+//         return;
+//     call TimerTimer.start(call Random.rand16() % TIMER_RATE);                   
+//   }
+  
+  async event void SelfPollingTimer.fired() {
+    if(sending == FALSE)
+      if(call TDA5250Control.SelfPollingMode(call Random.rand16() % TIMER_RATE/20, 
+                                             call Random.rand16() % TIMER_RATE/20) != FAIL)
+        return;
+    call SelfPollingTimer.start(call Random.rand16() % TIMER_RATE); 
+  }
+  
+//   async event void SleepTimer.fired() {
+//     if(sending == FALSE)  
+//       if(call TDA5250Control.SleepMode() != FAIL)
+//          return;
+//     call SleepTimer.start(call Random.rand16() % TIMER_RATE); 
+//   }  
+          
+    
+  async event void TDA5250Control.TxModeDone(){
+    call Send.send(&sendMsg, NUM_BYTES);
+  }
+  
+  event void Send.sendDone(message_t* msg, error_t error) {
+    call TDA5250Control.SleepMode();
+    sending = FALSE;    
+    call TxTimer.start(call Random.rand16() % TIMER_RATE);  
+  }
+  
+  event message_t* Receive.receive(message_t* msg, void* payload, uint8_t len) {
+    TOSH_TOGGLE_LED3_PIN();
+    return msg;
+  }
+  
+  async event void TDA5250Control.TimerModeDone(){ 
+//     call TimerTimer.start(call Random.rand16() % TIMER_RATE); 
+//     call Leds.led0On();
+//     call Leds.led1On();
+//     call Leds.led2Off();    
+  }
+  async event void TDA5250Control.SelfPollingModeDone(){ 
+    call SelfPollingTimer.start(call Random.rand16() % TIMER_RATE);   
+    call Leds.led0On();
+    call Leds.led1Off();
+    call Leds.led2On();        
+  }  
+  async event void TDA5250Control.RxModeDone(){ 
+    call RxTimer.start(call Random.rand16() % TIMER_RATE);   
+    call Leds.led0Off();
+    call Leds.led1On();
+    call Leds.led2On();  
+  }
+  async event void TDA5250Control.SleepModeDone(){ 
+//     call SleepTimer.start(call Random.rand16() % TIMER_RATE);   
+    call Leds.led0Off();
+    call Leds.led1Off();
+    call Leds.led2On();
+  }
+  async event void TDA5250Control.CCAModeDone(){ 
+    call CCATimer.start(call Random.rand16() % TIMER_RATE);   
+    call Leds.led0On();
+    call Leds.led1Off();
+    call Leds.led2Off();  
+  }    
+  
+  async event void TDA5250Control.PWDDDInterrupt() {
+  }  
+}
+
+
diff --git a/apps/tests/eyesIFX/Radio/TestUARTPhy/Makefile b/apps/tests/eyesIFX/Radio/TestUARTPhy/Makefile
new file mode 100644 (file)
index 0000000..a74e012
--- /dev/null
@@ -0,0 +1,4 @@
+COMPONENT=TestUARTPhyC
+CFLAGS += -I%T/oski/services -I%T/oski/interfaces -I%T/oski/types -I%T/oski/impls
+include $(MAKERULES)
+
diff --git a/apps/tests/eyesIFX/Radio/TestUARTPhy/TestUARTPhyC.nc b/apps/tests/eyesIFX/Radio/TestUARTPhy/TestUARTPhyC.nc
new file mode 100644 (file)
index 0000000..fbf73c9
--- /dev/null
@@ -0,0 +1,64 @@
+/*                                  tab:4
+ * "Copyright (c) 2000-2003 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."
+ *
+ * Copyright (c) 2002-2003 Intel Corporation
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached INTEL-LICENSE
+ * file. If you do not find these files, copies can be found by writing to
+ * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
+ * 94704.  Attention:  Intel License Inquiry.
+ */
+/**
+ *
+ **/
+
+includes Timer;
+configuration TestUARTPhyC {
+}
+implementation {
+  components Main, TestUARTPhyM
+           , new AlarmMilliC() as TxTimer
+           , LedsC
+           , TDA5250RadioC
+           , RandomLfsrC
+           , UARTPhyM
+           ;
+
+  Main.SoftwareInit -> TDA5250RadioC.Init;
+  Main.SoftwareInit -> RandomLfsrC.Init;
+  Main.SoftwareInit -> LedsC.Init;
+  Main.SoftwareInit -> UARTPhyM.Init;
+  TestUARTPhyM -> Main.Boot;
+
+  TestUARTPhyM.Random -> RandomLfsrC.Random;
+  TestUARTPhyM.TxTimer -> TxTimer;
+  TestUARTPhyM.Leds  -> LedsC;
+  TestUARTPhyM.TDA5250Control -> TDA5250RadioC.TDA5250Control;
+  TestUARTPhyM.RadioSplitControl -> TDA5250RadioC.SplitControl;  
+  TestUARTPhyM.RadioByteComm -> UARTPhyM.SerializerRadioByteComm;
+  TestUARTPhyM.PhyPacketTx -> UARTPhyM.PhyPacketTx;
+  TestUARTPhyM.PhyPacketRx -> UARTPhyM.PhyPacketRx;
+  
+  UARTPhyM.RadioByteComm -> TDA5250RadioC.RadioByteComm;
+}
+
+
+
diff --git a/apps/tests/eyesIFX/Radio/TestUARTPhy/TestUARTPhyM.nc b/apps/tests/eyesIFX/Radio/TestUARTPhy/TestUARTPhyM.nc
new file mode 100644 (file)
index 0000000..a40459c
--- /dev/null
@@ -0,0 +1,116 @@
+// $Id$
+
+/*                                  tab:4
+ * "Copyright (c) 2000-2003 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."
+ *
+ * Copyright (c) 2002-2003 Intel Corporation
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached INTEL-LICENSE
+ * file. If you do not find these files, copies can be found by writing to
+ * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
+ * 94704.  Attention:  Intel License Inquiry.
+ */
+
+module TestUARTPhyM {
+  uses {
+    interface Boot;
+    interface Alarm<TMilli, uint32_t> as TxTimer;
+    interface Leds;
+    interface TDA5250Control;
+    interface Random;
+    interface SplitControl as RadioSplitControl;
+    interface PhyPacketTx;
+    interface PhyPacketRx;
+    interface RadioByteComm;
+  }
+}
+
+implementation {
+  
+  #define TX_TIMER_RATE 500
+  #define NUM_BYTES     36
+  
+  uint8_t bytes_sent;
+  
+  event void Boot.booted() {
+    bytes_sent = 0;
+    call RadioSplitControl.start();
+  }
+  
+  event void RadioSplitControl.startDone(error_t error) {
+    call TDA5250Control.TxMode();
+  }
+  
+  event void RadioSplitControl.stopDone(error_t error) {
+    call TxTimer.stop();
+  }  
+
+  /***********************************************************************
+   * Commands and events
+   ***********************************************************************/   
+
+  async event void TxTimer.fired() {
+    call TDA5250Control.TxMode();
+  }
+    
+  async event void TDA5250Control.TxModeDone(){
+     call PhyPacketTx.sendHeader(NUM_BYTES);
+  }
+  
+  async event void PhyPacketTx.sendHeaderDone(error_t error) {
+    call RadioByteComm.txByte(call Random.rand16() / 2);
+  }
+  
+  async event void RadioByteComm.txByteReady(error_t error) {
+    if(++bytes_sent < NUM_BYTES)
+      call RadioByteComm.txByte(call Random.rand16() / 2);
+    else {
+      bytes_sent = 0;  
+      call PhyPacketTx.sendFooter();    
+    }
+  } 
+  
+  async event void PhyPacketTx.sendFooterDone(error_t error) {
+    call TDA5250Control.SleepMode();
+    call TxTimer.start(call Random.rand16() % TX_TIMER_RATE);   
+    call Leds.led0Toggle();
+  }  
+
+  async event void PhyPacketRx.recvHeaderDone(uint8_t length_value) {}    
+  async event void PhyPacketRx.recvFooterDone(bool error) {}  
+  async event void RadioByteComm.rxByteReady(uint8_t data) {}  
+  
+  async event void TDA5250Control.PWDDDInterrupt() {
+  }
+  async event void TDA5250Control.TimerModeDone(){ 
+  }
+  async event void TDA5250Control.SelfPollingModeDone(){       
+  }  
+  async event void TDA5250Control.RxModeDone(){ 
+  }
+  async event void TDA5250Control.SleepModeDone(){  
+  }
+  async event void TDA5250Control.CCAModeDone(){ 
+  }  
+  
+}
+
+
diff --git a/apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/Makefile b/apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/Makefile
new file mode 100644 (file)
index 0000000..a74e012
--- /dev/null
@@ -0,0 +1,4 @@
+COMPONENT=TestUARTPhyC
+CFLAGS += -I%T/oski/services -I%T/oski/interfaces -I%T/oski/types -I%T/oski/impls
+include $(MAKERULES)
+
diff --git a/apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/TestUARTPhyC.nc b/apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/TestUARTPhyC.nc
new file mode 100644 (file)
index 0000000..0685b53
--- /dev/null
@@ -0,0 +1,74 @@
+/*                                  tab:4
+ * "Copyright (c) 2000-2003 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."
+ *
+ * Copyright (c) 2002-2003 Intel Corporation
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached INTEL-LICENSE
+ * file. If you do not find these files, copies can be found by writing to
+ * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
+ * 94704.  Attention:  Intel License Inquiry.
+ */
+/**
+ *
+ **/
+
+includes Timer;
+configuration TestUARTPhyC {
+}
+implementation {
+  components Main, TestUARTPhyM
+           , new AlarmMilliC() as TxTimer
+           , new AlarmMilliC() as RxTimer
+           , new AlarmMilliC() as CCATimer
+           , new AlarmMilliC() as TimerTimer
+//            , new AlarmMilliC() as SelfPollingTimer
+//            , new AlarmMilliC() as SleepTimer
+           , LedsC
+           , TDA5250RadioC
+           , RandomLfsrC
+           , UARTPhyM
+           ;
+
+  Main.SoftwareInit -> TDA5250RadioC.Init;
+  Main.SoftwareInit -> RandomLfsrC.Init;
+  Main.SoftwareInit -> LedsC.Init;
+  Main.SoftwareInit -> UARTPhyM.Init;
+  TestUARTPhyM -> Main.Boot;
+
+  TestUARTPhyM.Random -> RandomLfsrC.Random;
+  TestUARTPhyM.TxTimer -> TxTimer;
+  TestUARTPhyM.RxTimer -> RxTimer;
+  TestUARTPhyM.CCATimer -> CCATimer;
+  TestUARTPhyM.TimerTimer -> TimerTimer;
+//   TestUARTPhyM.SelfPollingTimer -> SelfPollingTimer;
+//   TestUARTPhyM.SleepTimer -> SleepTimer;
+  TestUARTPhyM.Leds  -> LedsC;
+  TestUARTPhyM.TDA5250Control -> TDA5250RadioC.TDA5250Control;
+  TestUARTPhyM.RadioSplitControl -> TDA5250RadioC.SplitControl;  
+  TestUARTPhyM.RadioByteComm -> UARTPhyM.SerializerRadioByteComm;
+  TestUARTPhyM.PhyPacketTx -> UARTPhyM.PhyPacketTx;
+  TestUARTPhyM.PhyPacketRx -> UARTPhyM.PhyPacketRx;
+  
+  UARTPhyM.RadioByteComm -> TDA5250RadioC.RadioByteComm;
+}
+
+
+
diff --git a/apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/TestUARTPhyM.nc b/apps/tests/eyesIFX/Radio/TestUARTPhyWithModes/TestUARTPhyM.nc
new file mode 100644 (file)
index 0000000..12f17e1
--- /dev/null
@@ -0,0 +1,194 @@
+// $Id$
+
+/*                                  tab:4
+ * "Copyright (c) 2000-2003 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."
+ *
+ * Copyright (c) 2002-2003 Intel Corporation
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached INTEL-LICENSE
+ * file. If you do not find these files, copies can be found by writing to
+ * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
+ * 94704.  Attention:  Intel License Inquiry.
+ */
+
+module TestUARTPhyM {
+  uses {
+    interface Boot;
+    interface Alarm<TMilli, uint32_t> as TxTimer;
+    interface Alarm<TMilli, uint32_t> as RxTimer;
+    interface Alarm<TMilli, uint32_t> as TimerTimer;
+    interface Alarm<TMilli, uint32_t> as CCATimer;
+//     interface Alarm<TMilli, uint32_t> as SelfPollingTimer;    
+//     interface Alarm<TMilli, uint32_t> as SleepTimer;
+    interface Leds;
+    interface TDA5250Control;
+    interface Random;
+    interface SplitControl as RadioSplitControl;
+    interface PhyPacketTx;
+    interface PhyPacketRx;
+    interface RadioByteComm;
+  }
+}
+
+implementation {
+  
+  #define TIMER_RATE 500
+  #define NUM_BYTES     36
+  
+  uint8_t bytes_sent;
+  bool sending;
+  
+  event void Boot.booted() {
+    bytes_sent = 0;
+    sending = FALSE;
+    call RadioSplitControl.start();
+  }
+  
+  event void RadioSplitControl.startDone(error_t error) {
+    call TxTimer.start(call Random.rand16() % TIMER_RATE);
+    call TimerTimer.start(call Random.rand16() % TIMER_RATE); 
+    call RxTimer.start(call Random.rand16() % TIMER_RATE); 
+    call CCATimer.start(call Random.rand16() % TIMER_RATE); 
+  }
+  
+  event void RadioSplitControl.stopDone(error_t error) {
+    call TxTimer.stop();
+  }  
+
+  /***********************************************************************
+   * Commands and events
+   ***********************************************************************/   
+
+  async event void TxTimer.fired() {
+    atomic {
+      if(call TDA5250Control.TxMode() != FAIL) {
+        bytes_sent = 0;
+        sending = TRUE;
+        call Leds.led0On();
+        call Leds.led1On();
+        call Leds.led2On();
+        return;
+      }
+    }
+    call TxTimer.start(call Random.rand16() % TIMER_RATE); 
+  }
+  
+  async event void RxTimer.fired() {
+    if(sending == FALSE)
+      if(call TDA5250Control.RxMode() != FAIL)
+        return;
+    call RxTimer.start(call Random.rand16() % TIMER_RATE); 
+  }
+  
+  async event void CCATimer.fired() {
+    if(sending == FALSE)  
+      if(call TDA5250Control.CCAMode() != FAIL)
+        return;
+    call CCATimer.start(call Random.rand16() % TIMER_RATE); 
+  }
+  
+  async event void TimerTimer.fired() {
+    if(sending == FALSE)  
+      if(call TDA5250Control.TimerMode(call Random.rand16() % TIMER_RATE/20, 
+                                       call Random.rand16() % TIMER_RATE/20) != FAIL)                        
+        return;
+    call TimerTimer.start(call Random.rand16() % TIMER_RATE);                   
+  }
+  
+//   async event void SelfPollingTimer.fired() {
+//     if(sending == FALSE)
+//       if(call TDA5250Control.SelfPollingMode(call Random.rand16() % TIMER_RATE/20, 
+//                                              call Random.rand16() % TIMER_RATE/20) != FAIL)
+//         return;
+//     call SelfPollingTimer.start(call Random.rand16() % TIMER_RATE); 
+//   }
+  
+//   async event void SleepTimer.fired() {
+//     if(sending == FALSE)  
+//       if(call TDA5250Control.SleepMode() != FAIL)
+//          return;
+//     call SleepTimer.start(call Random.rand16() % TIMER_RATE); 
+//   }  
+          
+    
+  async event void TDA5250Control.TxModeDone(){
+    call PhyPacketTx.sendHeader(NUM_BYTES);
+  }
+  
+  async event void PhyPacketTx.sendHeaderDone(error_t error) {
+    call RadioByteComm.txByte(call Random.rand16() / 2);
+  }
+  
+  async event void RadioByteComm.txByteReady(error_t error) {
+    if(++bytes_sent < NUM_BYTES)
+      call RadioByteComm.txByte(call Random.rand16() / 2);
+    else {
+      bytes_sent = 0;  
+      call PhyPacketTx.sendFooter();    
+    }
+  } 
+  
+  async event void PhyPacketTx.sendFooterDone(error_t error) {
+    call TDA5250Control.SleepMode();
+    sending = FALSE;    
+    call TxTimer.start(call Random.rand16() % TIMER_RATE);
+  }  
+  
+  async event void TDA5250Control.TimerModeDone(){ 
+    call TimerTimer.start(call Random.rand16() % TIMER_RATE); 
+    call Leds.led0On();
+    call Leds.led1On();
+    call Leds.led2Off();    
+  }
+  async event void TDA5250Control.SelfPollingModeDone(){ 
+//     call SelfPollingTimer.start(call Random.rand16() % TIMER_RATE);   
+//     call Leds.led0On();
+//     call Leds.led1Off();
+//     call Leds.led2On();        
+  }  
+  async event void TDA5250Control.RxModeDone(){ 
+    call RxTimer.start(call Random.rand16() % TIMER_RATE);   
+    call Leds.led0Off();
+    call Leds.led1On();
+    call Leds.led2On();  
+  }
+  async event void TDA5250Control.SleepModeDone(){ 
+//     call SleepTimer.start(call Random.rand16() % TIMER_RATE);   
+    call Leds.led0Off();
+    call Leds.led1Off();
+    call Leds.led2On();
+  }
+  async event void TDA5250Control.CCAModeDone(){ 
+    call CCATimer.start(call Random.rand16() % TIMER_RATE);   
+    call Leds.led0On();
+    call Leds.led1Off();
+    call Leds.led2Off();  
+  }    
+  
+  async event void TDA5250Control.PWDDDInterrupt() {
+  }
+  async event void PhyPacketRx.recvHeaderDone(uint8_t length_value) {}    
+  async event void PhyPacketRx.recvFooterDone(bool error) {}  
+  async event void RadioByteComm.rxByteReady(uint8_t data) {}
+  
+}
+
+
diff --git a/apps/tests/eyesIFX/Timer/Makefile b/apps/tests/eyesIFX/Timer/Makefile
new file mode 100644 (file)
index 0000000..53544a0
--- /dev/null
@@ -0,0 +1,4 @@
+COMPONENT=TestTimerC
+CFLAGS += -I%T/oski/services -I%T/oski/interfaces -I%T/oski/types -I%T/oski/impls
+include $(MAKERULES)
+
diff --git a/apps/tests/eyesIFX/Timer/TestTimerC.nc b/apps/tests/eyesIFX/Timer/TestTimerC.nc
new file mode 100644 (file)
index 0000000..2678d24
--- /dev/null
@@ -0,0 +1,63 @@
+/*                                  tab:4
+ * "Copyright (c) 2000-2003 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."
+ *
+ * Copyright (c) 2002-2003 Intel Corporation
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached INTEL-LICENSE
+ * file. If you do not find these files, copies can be found by writing to
+ * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
+ * 94704.  Attention:  Intel License Inquiry.
+ */
+/**
+ *
+ **/
+
+includes Timer;
+configuration TestTimerC {
+}
+implementation {
+  components Main, TestTimerM
+           , new AlarmMilliC() as Timer0
+           , new AlarmMilliC() as Timer1
+           , new AlarmMilliC() as Timer2
+           , new AlarmMilliC() as Timer3
+                                        , new AlarmMilliC() as Timer4                                                                                                                                                           
+                                        , new AlarmMilliC() as Timer5  
+                                        , new AlarmMilliC() as Timer6  
+                                        , new AlarmMilliC() as Timer7  
+                                        , new AlarmMilliC() as Timer8  
+           ;
+
+  TestTimerM -> Main.Boot;
+
+  TestTimerM.Timer0 -> Timer0;
+       TestTimerM.Timer1 -> Timer1;
+       TestTimerM.Timer2 -> Timer2;
+       TestTimerM.Timer3 -> Timer3;
+       TestTimerM.Timer4 -> Timer4;
+       TestTimerM.Timer5 -> Timer5;
+       TestTimerM.Timer6 -> Timer6;
+       TestTimerM.Timer7 -> Timer7;
+       TestTimerM.Timer8 -> Timer8;
+}
+
+
+
diff --git a/apps/tests/eyesIFX/Timer/TestTimerM.nc b/apps/tests/eyesIFX/Timer/TestTimerM.nc
new file mode 100644 (file)
index 0000000..b205375
--- /dev/null
@@ -0,0 +1,89 @@
+// $Id$
+
+/*                                  tab:4
+ * "Copyright (c) 2000-2003 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."
+ *
+ * Copyright (c) 2002-2003 Intel Corporation
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached INTEL-LICENSE
+ * file. If you do not find these files, copies can be found by writing to
+ * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,
+ * 94704.  Attention:  Intel License Inquiry.
+ */
+
+module TestTimerM {
+  uses {
+    interface Boot;
+    interface Alarm<TMilli, uint32_t> as Timer0;
+               interface Alarm<TMilli, uint32_t> as Timer1;
+               interface Alarm<TMilli, uint32_t> as Timer2;
+               interface Alarm<TMilli, uint32_t> as Timer3;
+               interface Alarm<TMilli, uint32_t> as Timer4;
+               interface Alarm<TMilli, uint32_t> as Timer5;
+               interface Alarm<TMilli, uint32_t> as Timer6;
+               interface Alarm<TMilli, uint32_t> as Timer7;
+               interface Alarm<TMilli, uint32_t> as Timer8;
+  }
+}
+
+implementation {
+
+  #define DELAY  20
+  
+  event void Boot.booted() {
+         call Timer0.start(DELAY);
+  }
+
+  /***********************************************************************
+   * Commands and events
+   ***********************************************************************/   
+
+  async event void Timer0.fired() {
+               call Timer1.start(DELAY);
+  }
+  async event void Timer1.fired() {
+               call Timer2.start(DELAY);       
+  }
+  async event void Timer2.fired() {
+               call Timer3.start(DELAY);
+  }
+  async event void Timer3.fired() {
+               call Timer4.start(DELAY);       
+  }
+  async event void Timer4.fired() {
+               call Timer5.start(DELAY);               
+  }    
+  async event void Timer5.fired() {
+               call Timer6.start(DELAY);
+  }
+  async event void Timer6.fired() {
+               call Timer7.start(DELAY);
+  }    
+  async event void Timer7.fired() {
+               call Timer8.start(DELAY);                       
+  }    
+  async event void Timer8.fired() {
+               call Timer0.start(DELAY);               
+  }                                    
+  
+}
+
+