]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Updated documentation on all of the applications as well as modified the TestJoin...
authorklueska <klueska>
Wed, 23 Dec 2009 18:08:46 +0000 (18:08 +0000)
committerklueska <klueska>
Wed, 23 Dec 2009 18:08:46 +0000 (18:08 +0000)
44 files changed:
apps/tosthreads/apps/BaseStation/BaseSendReceiveP.nc
apps/tosthreads/apps/BaseStation/BaseStationAppC.nc
apps/tosthreads/apps/BaseStation/BaseStationC.nc
apps/tosthreads/apps/Blink/BlinkAppC.nc
apps/tosthreads/apps/Blink/BlinkC.nc
apps/tosthreads/apps/Blink_DynamicThreads/BlinkAppC.nc
apps/tosthreads/apps/Blink_DynamicThreads/BlinkC.nc
apps/tosthreads/apps/TestBasicsbSensors/TestBasicsbSensorsAppC.nc
apps/tosthreads/apps/TestBlockStorage/TestBlockStorageAppC.nc
apps/tosthreads/apps/TestBlockStorage/TestBlockStorageP.nc
apps/tosthreads/apps/TestCollection/TestCollectionAppC.nc
apps/tosthreads/apps/TestCollection/TestCollectionC.nc
apps/tosthreads/apps/TestJoin/README [new file with mode: 0644]
apps/tosthreads/apps/TestJoin/TestJoinAppC.nc
apps/tosthreads/apps/TestJoin/TestJoinC.nc
apps/tosthreads/apps/TestPrintf/TestPrintfAppC.nc
apps/tosthreads/apps/TestPrintf/TestPrintfC.nc
apps/tosthreads/apps/TestSineSensor/TestSineSensorAppC.nc
apps/tosthreads/apps/TestSineSensor/TestSineSensorC.nc
apps/tosthreads/capps/BaseStation/BaseStation.c
apps/tosthreads/capps/Blink/Blink.c
apps/tosthreads/capps/Bounce/Bounce.c
apps/tosthreads/capps/Null/Null.c
apps/tosthreads/capps/SenseAndSend/SenseAndSend.c
apps/tosthreads/capps/SenseStoreAndForward/SenseStoreAndForward.c
apps/tosthreads/capps/TestCollection/README
apps/tosthreads/capps/TestCollection/TestCollection.c
apps/tosthreads/capps/TestJoin/README [new file with mode: 0644]
apps/tosthreads/capps/TestJoin/TestJoin.c
apps/tosthreads/capps/TestLogStorage/TestLogStorage.c
apps/tosthreads/capps/TestPrintf/TestPrintf.c
apps/tosthreads/capps/TestSineSensor/TestSineSensor.c
apps/tosthreads/capps/ThreadStress/ThreadStress.c
apps/tosthreads/tinyld/LoadFromRAM/LoadFromRAMAppC.nc
apps/tosthreads/tinyld/LoadFromRAM/LoadFromRAMP.nc
apps/tosthreads/tinyld/LoadFromRAM/README
apps/tosthreads/tinyld/Makefile [new file with mode: 0644]
apps/tosthreads/tinyld/SerialLoader/README
apps/tosthreads/tinyld/SerialLoader/SerialLoaderAppC.nc
apps/tosthreads/tinyld/SerialLoader/SerialLoaderP.nc
apps/tosthreads/tinyld/SerialLoaderFlash/FlashVolumeManagerC.nc
apps/tosthreads/tinyld/SerialLoaderFlash/FlashVolumeManagerP.nc
apps/tosthreads/tinyld/SerialLoaderFlash/README
apps/tosthreads/tinyld/SerialLoaderFlash/SerialLoaderFlashAppC.nc

index 063fa3a0ad521736d07f262fb7a75714cfbe62c5..5497f40bcfeb964b241fae31d212ec3ec5e123df 100644 (file)
  */
 
 /**
+ * BaseStation is a reimplementation of the standard BaseStation application using
+ * the TOSThreads thread library.  It transparently forwards any AM messages it
+ * receives from its radio interface to its serial interface and vice versa.
+ *
+ * <p>On the serial link, BaseStation sends and receives simple active
+ * messages (not particular radio packets): on the radio link, it
+ * sends radio active messages, whose format depends on the network
+ * stack being used. BaseStation will copy its compiled-in group ID to
+ * messages moving from the serial link to the radio, and will filter
+ * out incoming radio messages that do not contain that group ID.</p>
+ *
+ * <p>BaseStation includes queues in both directions, with a guarantee
+ * that once a message enters a queue, it will eventually leave on the
+ * other interface. The queues allow the BaseStation to handle load
+ * spikes.</p>
+ *
+ * <p>BaseStation acknowledges a message arriving over the serial link
+ * only if that message was successfully enqueued for delivery to the
+ * radio link.</p>
+ *
+ * <p>The LEDS are programmed to toggle as follows:</p>
+ * <ul>
+ * <li><b>LED0:</b> Message bridged from serial to radio</li>
+ * <li><b>LED1:</b> Message bridged from radio to serial</li>
+ * <li><b>LED2:</b> Dropped message due to queue overflow in either direction</li>
+ * </ul>
+ *
  * @author Kevin Klues <klueska@cs.stanford.edu>
  * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
  */
index a6d8832a58d4e894a14978b310f23d7b3c93913c..09ca717efcb67ab987e89e2091ecb0852d0ac2f0 100644 (file)
  */
 
 /**
+ * BaseStation is a reimplementation of the standard BaseStation application using
+ * the TOSThreads thread library.  It transparently forwards any AM messages it
+ * receives from its radio interface to its serial interface and vice versa. 
+ *
+ * <p>On the serial link, BaseStation sends and receives simple active
+ * messages (not particular radio packets): on the radio link, it
+ * sends radio active messages, whose format depends on the network
+ * stack being used. BaseStation will copy its compiled-in group ID to
+ * messages moving from the serial link to the radio, and will filter
+ * out incoming radio messages that do not contain that group ID.</p>
+ *
+ * <p>BaseStation includes queues in both directions, with a guarantee
+ * that once a message enters a queue, it will eventually leave on the
+ * other interface. The queues allow the BaseStation to handle load
+ * spikes.</p>
+ *
+ * <p>BaseStation acknowledges a message arriving over the serial link
+ * only if that message was successfully enqueued for delivery to the
+ * radio link.</p>
+ *
+ * <p>The LEDS are programmed to toggle as follows:</p>
+ * <ul>
+ * <li><b>LED0:</b> Message bridged from serial to radio</li>
+ * <li><b>LED1:</b> Message bridged from radio to serial</li>
+ * <li><b>LED2:</b> Dropped message due to queue overflow in either direction</li>
+ * </ul>
+ *
  * @author Kevin Klues <klueska@cs.stanford.edu>
  * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
  */
index 268978d6ea90fcacc2db81419b41186bfbddec38..987aa6bc6ffc088d875cae0adcf83fc4951d8890 100644 (file)
  */
 
 /**
+ * BaseStation is a reimplementation of the standard BaseStation application using
+ * the TOSThreads thread library.  It transparently forwards any AM messages it
+ * receives from its radio interface to its serial interface and vice versa.
+ *
+ * <p>On the serial link, BaseStation sends and receives simple active
+ * messages (not particular radio packets): on the radio link, it
+ * sends radio active messages, whose format depends on the network
+ * stack being used. BaseStation will copy its compiled-in group ID to
+ * messages moving from the serial link to the radio, and will filter
+ * out incoming radio messages that do not contain that group ID.</p>
+ *
+ * <p>BaseStation includes queues in both directions, with a guarantee
+ * that once a message enters a queue, it will eventually leave on the
+ * other interface. The queues allow the BaseStation to handle load
+ * spikes.</p>
+ *
+ * <p>BaseStation acknowledges a message arriving over the serial link
+ * only if that message was successfully enqueued for delivery to the
+ * radio link.</p>
+ *
+ * <p>The LEDS are programmed to toggle as follows:</p>
+ * <ul>
+ * <li><b>LED0:</b> Message bridged from serial to radio</li>
+ * <li><b>LED1:</b> Message bridged from radio to serial</li>
+ * <li><b>LED2:</b> Dropped message due to queue overflow in either direction</li>
+ * </ul>
+ *
  * @author Kevin Klues <klueska@cs.stanford.edu>
  */
 
index d95f71926d22d518532cb13c99769f16db086aeb..850583121233b16ef5b74cc56dd9afbe7d7b4f0b 100644 (file)
  */
  
 /**
+ * Blink is a simple application used to test the basic functionality of
+ * TOSThreads.
+ *
+ * Upon a successful burn, you should see LED0 flashing with a period of every
+ * 200ms, and LED1 and LED2 flashing in unison with a period of 1000ms.
+ *
  * @author Kevin Klues (klueska@cs.stanford.edu)
  */
 
index e4027006baa98a6274623ad953fe94cc349ff335..ed6fcb7d2fbefe2815e5211d45c0210ee8b63ddd 100644 (file)
  */
  
 /**
+ * Blink is a simple application used to test the basic functionality of
+ * TOSThreads.
+ *
+ * Upon a successful burn, you should see LED0 flashing with a period of every
+ * 200ms, and LED1 and LED2 flashing in unison with a period of 1000ms.
+ *
  * @author Kevin Klues (klueska@cs.stanford.edu)
  */
 
index 1add9280e3c887c7f26b82b9ebe1b1428c156f61..7b2dc31348de0afa22b59a4f2474706338a46ffd 100644 (file)
 */
 
 /**
- * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
+ * Blink is a simple application used to test the basic functionality of
+ * TOSThreads using dynamic threads rather than static threads.
+ *
+ * Upon a successful burn, you should see LED0 flashing with a period of every
+ * 200ms, and LED1 and LED2 flashing in unison with a period of 1000ms.
  *
- * This is the dynamic thread implementation of Blink.
+ * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
  */
 
 configuration BlinkAppC {}
index 291d6cbf18e7e0b2cf6ab02ccfe97c9c8190a8f3..49b274ec6be5bc0293052626130c8a2e7dad03ad 100644 (file)
 */
 
 /**
- * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
+ * Blink is a simple application used to test the basic functionality of
+ * TOSThreads using dynamic threads rather than static threads.
+ *
+ * Upon a successful burn, you should see LED0 flashing with a period of every
+ * 200ms, and LED1 and LED2 flashing in unison with a period of 1000ms.
  *
- * This is the dynamic thread implementation of Blink.
+ * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
  */
 
 module BlinkC {
index d1e3aca7aeab246b3e9dbf1bcac1edcd845b00db..cb3b898e216e9e77b044f35a7d7f96ccc3291d27 100644 (file)
  */
  
 /**
+ * This application is used to test the threaded version of the API for accessing
+ * sensors on the basicsb sensor board.
+ * 
+ * This application simply takes sensor readings in an infinite loop from the
+ * Photo and Temperature sensors on the basicsb sensor board and forwards them
+ * over the serial interface.  Upon successful transmission, LED0 is toggled.
+ * 
+ * A successful test will result in the TestBasicsbSensors mote constantly
+ * flickering LED0. Additionally, messages containing the sensor readings should
+ * be forwarded over the serial interface as verified by running the following
+ * for the platform of interest:
+ *   java net.tinyos.tools.Listen -comm serial@/dev/ttyUSBXXX:<baud_rate>
+ * 
+ * Once this java application is running, you should see output containing the
+ * sensor readings being streamed to your terminal.
+ *
  * @author Kevin Klues (klueska@cs.stanford.edu)
  */
 
index b29338571c377214155bc94ee37455b7d2fa5f22..3d43d2a2194c6bc713bba420fc60614ecc88523f 100644 (file)
 */
 
 /**
+ * This application is used to test the threaded version of the API for performing
+ * block storage.
+ * 
+ * This application first checks the size of the block storage volume, and
+ * erases it. Then, it randomly writes records, followed by a verification
+ * with read.
+ * 
+ * Successful running of this application results in LED0 being ON
+ * throughout the duration of the erase, write, and read sequence. Finally,
+ * if all tests pass, LED1 is turned ON. Otherwise, all three LEDs are
+ * turned ON to indicate problems.
+ *
  * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
  */
 
index 316cbece9354112837c1a8083fa938e4c2298d30..81b191b0cc4aec65e5b1532e5f03649fe3c027a5 100644 (file)
 */
 
 /**
+ * This application is used to test the threaded version of the API for performing
+ * block storage.
+ * 
+ * This application first checks the size of the block storage volume, and
+ * erases it. Then, it randomly writes records, followed by a verification
+ * with read.
+ * 
+ * Successful running of this application results in LED0 being ON
+ * throughout the duration of the erase, write, and read sequence. Finally,
+ * if all tests pass, LED1 is turned ON. Otherwise, all three LEDs are
+ * turned ON to indicate problems.
+ *
  * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
  */
 
index 4db9f298a37df58e0f12fef129879cdc980f1b9f..f248d97084be500577a3a9f968c628aea1a870c8 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-/*
+/**
+ * TestCollection is a reimplementation of the Multihop Oscilloscope application
+ * using TOSThreads. It periodically samples a universal software-based SineSensor
+ * and broadcasts a message every few readings. These readings can be displayed by
+ * the Java "Oscilloscope" application found in the the TestCollection/java
+ * subdirectory. The sampling rate starts at 4Hz, but can be changed from the Java
+ * application.
+ * 
+ * At least two motes must be used by this application, with one of them installed
+ * as a base station.  Base station motes can be created by installing them with
+ * NODE_ID % 500 == 0.
+ *   i.e. make <platform> threads install.0
+ *        make <platform> threads install.500
+ *        make <platform> threads install.1000
+ * 
+ * All other nodes can be installed with arbitrary NODE_IDs.
+ *   make <platform> threads install.123
+ * 
+ * Successful running of this application is verified by all NON-base station motes
+ * periodically flashing LED1 upon sending a message, and the base station mote,
+ * flashing LED2 upon successful reception of a message.  Additionally, correct
+ * operation should be verified by running the java tool described in the following
+ * section.
+ *
  * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
  */
 
index 46ed34e632091de830729145984a6b64dd068e2e..51c9bdb03cb8fcb35f795824b83ed1d068177ef6 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-/*
+/**
+ * TestCollection is a reimplementation of the Multihop Oscilloscope application
+ * using TOSThreads. It periodically samples a universal software-based SineSensor
+ * and broadcasts a message every few readings. These readings can be displayed by
+ * the Java "Oscilloscope" application found in the the TestCollection/java
+ * subdirectory. The sampling rate starts at 4Hz, but can be changed from the Java
+ * application.
+ * 
+ * At least two motes must be used by this application, with one of them installed
+ * as a base station.  Base station motes can be created by installing them with
+ * NODE_ID % 500 == 0.
+ *   i.e. make <platform> threads install.0
+ *        make <platform> threads install.500
+ *        make <platform> threads install.1000
+ * 
+ * All other nodes can be installed with arbitrary NODE_IDs.
+ *   make <platform> threads install.123
+ * 
+ * Successful running of this application is verified by all NON-base station motes
+ * periodically flashing LED1 upon sending a message, and the base station mote,
+ * flashing LED2 upon successful reception of a message.  Additionally, correct
+ * operation should be verified by running the java tool described in the following
+ * section.
+ *
  * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
  */
 
diff --git a/apps/tosthreads/apps/TestJoin/README b/apps/tosthreads/apps/TestJoin/README
new file mode 100644 (file)
index 0000000..a22b29c
--- /dev/null
@@ -0,0 +1,24 @@
+README for TOSThreads TestJoin
+Author/Contact: tinyos-help@millennium.berkeley.edu
+Author: Kevin Klues <klueska@cs.stanford.edu>
+
+Description:
+
+TestJoin is a simple application used to test the basic functionality of
+the join() system call for waiting on a set of threads in a TOSThreads 
+based application.
+
+You can install TestJoin on a mote via the following command:
+  make <platform> threads install
+  
+Valid platforms are currently: tmote, telosb, iris, mica2, and micaz 
+
+Upon a successful burn, you should first see LED0 flash twice with a period of
+1s and LED1 flash 4 times with a period of 1s. After these are done,
+LED2 should come on and stay on.
+
+Tools:
+  None.
+
+Known bugs/limitations:
+  None.
index 4a8e08623e3a023612fb5e0096c8f01f634d269d..4676b021d344d1d73ba372f9c5cb3821ebf5da2e 100644 (file)
  */
  
 /**
+ * TestJoin is a simple application used to test the basic functionality of
+ * the join() system call for waiting on a set of threads in a TOSThreads 
+ * based application.
+ * 
+ * Upon a successful burn, you should first see LED0 flash twice with a period of
+ * 1s and LED1 flash 4 times with a period of 1s. After these are done,
+ * LED2 should come on and stay on.
+ *
  * @author Kevin Klues (klueska@cs.stanford.edu)
  */
 
@@ -40,13 +48,11 @@ implementation {
   components new ThreadC(100) as NullThread;
   components new ThreadC(100) as TinyThread0;
   components new ThreadC(100) as TinyThread1;
-  components new ThreadC(100) as TinyThread2;
 
   MainC.Boot <- TestJoinC;
   TestJoinC.NullThread -> NullThread;
   TestJoinC.TinyThread0 -> TinyThread0;
   TestJoinC.TinyThread1 -> TinyThread1; 
-  TestJoinC.TinyThread2 -> TinyThread2;
 
   TestJoinC.Leds -> LedsC;
 }
index fa8c9753fbf29973e650a965c2f776fa4f76a606..13a2c2a5bb274a86cdabdbf1b3918aeeca16037b 100644 (file)
  */
  
 /**
+ * TestJoin is a simple application used to test the basic functionality of
+ * the join() system call for waiting on a set of threads in a TOSThreads 
+ * based application.
+ * 
+ * Upon a successful burn, you should first see LED0 flash twice with a period of
+ * 1s and LED1 flash 4 times with a period of 1s. After these are done,
+ * LED2 should come on and stay on.
+ *
  * @author Kevin Klues (klueska@cs.stanford.edu)
  */
 
@@ -39,7 +47,6 @@ module TestJoinC {
     interface Thread as NullThread;
     interface Thread as TinyThread0;
     interface Thread as TinyThread1;
-    interface Thread as TinyThread2;
     interface Leds;
   }
 }
@@ -53,10 +60,9 @@ implementation {
     for(;;){
       call TinyThread0.start(NULL);
       call TinyThread1.start(NULL);
-      call TinyThread2.start(NULL);
-      call TinyThread1.join();
       call TinyThread0.join();
-      call TinyThread2.join();
+      call TinyThread1.join();
+      call Leds.led2Toggle();
     }
   }  
   event void TinyThread0.run(void* arg) {
@@ -73,11 +79,4 @@ implementation {
       call TinyThread1.sleep(1000);
     }
   }
-  event void TinyThread2.run(void* arg) {
-    int i;
-    for(i=0; i<6; i++){
-      call Leds.led2Toggle();
-      call TinyThread2.sleep(1000);
-    }
-  }
 }
index e9d8d1ac1d60ba096fd3bc2f79d3541adf9f26dc..eeb6d7d71fcf47f07a265ed7aa4aa5d7c5508017 100644 (file)
  */
  
 /**
+ * This application tests the operation of the Printf client in TOSThreads.  It
+ * continuously prints the value of a counter starting at 0, increasing as it
+ * prints.
+ * 
  * @author Kevin Klues (klueska@cs.stanford.edu)
  */
 
index 904a3919ad5c845ed29c00ad4915d4f14b692644..3f308a664bdd0b9d24b166342db747bdee1f6c80 100644 (file)
  */
  
 /**
+ * This application tests the operation of the Printf client in TOSThreads.  It
+ * continuously prints the value of a counter starting at 0, increasing as it
+ * prints.
+ * 
  * @author Kevin Klues (klueska@cs.stanford.edu)
  */
 
index d601e09ea40baaf61506437613746bc4d1d44575..926a68090718db89ba4f5e7d95603d845941d5c6 100644 (file)
  */
  
 /**
+ * This application is used to test the threaded version of the API for accessing
+ * the software based SineSensor usable by any platform for demonstration purposes.
+ * 
+ * This application simply takes sensor readings in an infinite loop from the
+ * SineSensor and forwards them over the serial interface.  Upon successful
+ * transmission, LED0 is toggled.
+ *
  * @author Kevin Klues (klueska@cs.stanford.edu)
  */
 
index f3a277739157fb06432a87a676946159b4aa01fe..cb97ecf893d63135640886e1967d66e7a8f1eb2e 100644 (file)
  */
  
 /**
+ * This application is used to test the threaded version of the API for accessing
+ * the software based SineSensor usable by any platform for demonstration purposes.
+ * 
+ * This application simply takes sensor readings in an infinite loop from the
+ * SineSensor and forwards them over the serial interface.  Upon successful
+ * transmission, LED0 is toggled.
+ *
  * @author Kevin Klues (klueska@cs.stanford.edu)
  */
 
index 6aa49538bff9c5c4dc1661835f007b4f2f46d7ba..5d421a3fee429e184188ab9bfa30f0966c330a1f 100644 (file)
  */
 
 /**
- * Base station implementation using tosthreads
+ * BaseStation is a reimplementation of the standard BaseStation application using
+ * the TOSThreads thread library.  It transparently forwards any AM messages it
+ * receives from its radio interface to its serial interface and vice versa.
+ *
+ * <p>On the serial link, BaseStation sends and receives simple active
+ * messages (not particular radio packets): on the radio link, it
+ * sends radio active messages, whose format depends on the network
+ * stack being used. BaseStation will copy its compiled-in group ID to
+ * messages moving from the serial link to the radio, and will filter
+ * out incoming radio messages that do not contain that group ID.</p>
+ *
+ * <p>BaseStation includes queues in both directions, with a guarantee
+ * that once a message enters a queue, it will eventually leave on the
+ * other interface. The queues allow the BaseStation to handle load
+ * spikes.</p>
+ *
+ * <p>BaseStation acknowledges a message arriving over the serial link
+ * only if that message was successfully enqueued for delivery to the
+ * radio link.</p>
+ *
+ * <p>The LEDS are programmed to toggle as follows:</p>
+ * <ul>
+ * <li><b>LED0:</b> Message bridged from serial to radio</li>
+ * <li><b>LED1:</b> Message bridged from radio to serial</li>
+ * <li><b>LED2:</b> Dropped message due to queue overflow in either direction</li>
+ * </ul>
  *
  * @author Kevin Klues <klueska@cs.stanford.edu>
  */
index bcbeee06dd975d41c48ad96d4b7758015ceba701..c9e733be06d5f8ac194770a7d71099f2e7d3f78e 100644 (file)
  */
  
 /**
+ * Blink is a simple application used to test the basic functionality of
+ * TOSThreads.
+ *
+ * Upon a successful burn, you should see LED0 flashing with a period of every
+ * 200ms, and LED1 and LED2 flashing in unison with a period of 1000ms.
+ *
  * @author Kevin Klues (klueska@cs.stanford.edu)
  */
 
index 2d2b34eb5806655814ba386092b233e554125933..f048403580ebc26bae3d13473fb3b9424dbfe0fd 100644 (file)
 */
 
 /**
+ * This application is derived from a similar application in the TinyThread 
+ * implementation by William P. McCartney from Cleveland State University (2006)
+ * 
+ * This application stresses the operation of the thread based AM commands for
+ * packet transmission and reception.  To run this application you will need to
+ * burn it on one mote with NODE_ID 0, and a second mote with NODE_ID 1. 
+ * 
+ * Three different threads run that each contain an infinite loop that first sends
+ * a message and then waits to receive a message before returning to the top of the
+ * loop. After each message reception, one of the onboard LEDs is toggled to
+ * indicate that it was received. Thread 0 blinks LED0, thread 1 blinks LED1, and
+ * thread 2 blinks LED2. The three threads run independently, and three different
+ * messages are bounced back and forth between the two motes in an unsynchronized
+ * fashion.  In contrast to the more complicated Bounce application found in the
+ * normal nesC threads version of this application, once a thread receives a
+ * message it will immediately flip on its LED instead of waiting on a Barrier and
+ * synchronizing the LEDs to come on only once messages have been received from all
+ * threads.  In this way, messages are bounced back and forth between the two motes
+ * in an asynchronous fashion, and LEDS are toggled immediately upon message
+ * reception..  
+ * 
+ * Successful running of this application results in each LED bouncing back and
+ * forth between each mote independent of one another.  This will continue in an
+ * finite loop forever.
+ *  
  * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
  */
 
index 889ffabe149ed56aed77afb9a45ac70eb6ff0fc4..87bbde51ca4b98205bdf1f45ad83ff271e0f2bcc 100644 (file)
 */
 
 /**
+ * Null is an empty skeleton application for testing the basic compilation and
+ * runtime of a c-based tosthreads application.  It is useful to test that the build
+ * environment is functional in its most minimal sense, i.e., you can correctly
+ * compile an application. It is also useful to test the minimum power consumption
+ * of a node when it has absolutely no interrupts or resources active.
+ *
  * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
  */
 
index 242d6503f3ce7a0db6c89738ce401928b5ecc605..c49a761e62955ca4c0dbbd62ee6d18c2531639eb 100644 (file)
  */
 
 /**
+ * SenseAndSend is a threaded implementation of an application that takes various
+ * sensor readings in parallel (by dedicating one thread to each reading), and
+ * assembling them into a packet to be sent out over the radio.  It is written
+ * specifically for use with the tmote onboard sensor package, and will not compile
+ * for any other platforms.
+ * 
+ * Readings are taken from each of the 4 oboard sensors and sent out over the radio
+ * interface in an infinite loop.  Upon successful transmission, LED0 is toggled,
+ * and the process starts over again.
+ * 
+ * A successful test will result in LED0 toggling periodically at a rate of
+ * approximately 220ms (the time it takes to take a humidity + temperature sensor
+ * reading since they share the same hardware and cannot be taken in parallel). 
+ * 
+ * Additionally, a base station application should be run to verify the reception
+ * of packets sent from a SenseAndSend mote, with reasonable looking sensor data.
+ *
  * @author Kevin Klues <klueska@cs.stanford.edu>
  */
 
index 5b9e5bb2c3bbb1371aac57989f46283b8650d690..93a75a4043c90ed64bbbe8d51dc465705a8fb9b5 100644 (file)
  */
 
 /**
+ * SenseStoreAndForward is a threaded implementation of an application that takes
+ * various sensor readings in parallel (by dedicating one thread to each reading),
+ * logs them to flash, and then sends them out over the radio at some later time. 
+ * In the current implementation, sensor readings are taken as quickly as possible,
+ * and records containing a set of readings from each iteration are batched out
+ * over the radio every 10000ms.  This application is written specifically for use
+ * with the tmote onboard sensor package, and will not compile for any other
+ * platforms.
+ *
+ * Readings are taken from each of the 4 oboard sensors and logged to flash as one
+ * record in an infinite loop. Records are then read out of flash and and sent out
+ * over the radio interface in separate infinite loop. Before the application
+ * starts running, the entire contents of the flash drive are erased.
+ * 
+ * A successful test will result in LED0 remaining solid for approximately 6s while
+ * the flash is being erased.  After that LED0 will toggle with each successful set
+ * of sensor readings logged to flash, at a rate of approximately 220ms (the time
+ * it takes to take a humidity + temperature sensor reading since they share the
+ * same hardware and cannot be taken in parallel).  Also, LED1 will begin toggling
+ * in rapid succession once every 10000ms as records are successfully read from
+ * flash and sent out over the radio.  Once all of the records currently recorded
+ * to flash since the last batch of sends have been sent out, LED2 Toggles to
+ * indicate completion.  This process continues in an infinite loop forever.
+ * 
+ * Additionally, a base station application should be run to verify the reception
+ * of packets sent from a SenseStoreAndForward mote, with reasonable looking sensor 
+ * data.
+ *
  * @author Kevin Klues <klueska@cs.stanford.edu>
  */
 
index a3d90ee012725ab63259007181af386e50fb4ce3..bed5de605c3b5514b7c0293e3d168b8ff94ba588 100644 (file)
@@ -65,9 +65,4 @@ Notes:
   set it to 57600.
 
 Known bugs/limitations:
-  Warnings are issued about fan out on the 'Snoop.receive' and 'Receive.receive'
-  events.  These warnings are harmless and are the result of providing a C based
-  API in which all events for receiving and snooping must be handled even if not
-  used by a particular application.  The warnings occur because the underlying
-  CTP or MultihopLQI stacks wire up to particular AM ids, which are also wired
-  into the C API for handling message reception.
+  None
index aaf811db233e0e9ead4a0f785261cd08135f8f98..508c093af966f24155f84f6dc932e099f7d938f0 100644 (file)
  */
 
 /**
+ * TestCollection is a reimplementation of the Multihop Oscilloscope application
+ * using TOSThreads. It periodically samples a universal software-based SineSensor
+ * and broadcasts a message every few readings. These readings can be displayed by
+ * the Java "Oscilloscope" application found in the the TestCollection/java
+ * subdirectory. The sampling rate starts at 4Hz, but can be changed from the Java
+ * application.
+ * 
+ * At least two motes must be used by this application, with one of them installed
+ * as a base station.  Base station motes can be created by installing them with
+ * NODE_ID % 500 == 0.
+ *   i.e. make <platform> threads install.0
+ *        make <platform> threads install.500
+ *        make <platform> threads install.1000
+ * 
+ * All other nodes can be installed with arbitrary NODE_IDs.
+ *   make <platform> threads install.123
+ * 
+ * Successful running of this application is verified by all NON-base station motes
+ * periodically flashing LED1 upon sending a message, and the base station mote,
+ * flashing LED2 upon successful reception of a message.  Additionally, correct
+ * operation should be verified by running the java tool described in the following
+ * section.
+ *
  * @author Kevin Klues <klueska@cs.stanford.edu>
  */
 
diff --git a/apps/tosthreads/capps/TestJoin/README b/apps/tosthreads/capps/TestJoin/README
new file mode 100644 (file)
index 0000000..a22b29c
--- /dev/null
@@ -0,0 +1,24 @@
+README for TOSThreads TestJoin
+Author/Contact: tinyos-help@millennium.berkeley.edu
+Author: Kevin Klues <klueska@cs.stanford.edu>
+
+Description:
+
+TestJoin is a simple application used to test the basic functionality of
+the join() system call for waiting on a set of threads in a TOSThreads 
+based application.
+
+You can install TestJoin on a mote via the following command:
+  make <platform> threads install
+  
+Valid platforms are currently: tmote, telosb, iris, mica2, and micaz 
+
+Upon a successful burn, you should first see LED0 flash twice with a period of
+1s and LED1 flash 4 times with a period of 1s. After these are done,
+LED2 should come on and stay on.
+
+Tools:
+  None.
+
+Known bugs/limitations:
+  None.
index 0470c414252c9656182cb1903bbc240849d5c0da..5952d39709648b516ebadece8b94238ca6d07bf6 100644 (file)
  */
  
 /**
+ * TestJoin is a simple application used to test the basic functionality of
+ * the join() system call for waiting on a set of threads in a TOSThreads 
+ * based application.
+ * 
+ * Upon a successful burn, you should first see LED0 flash twice with a period of
+ * 1s and LED1 flash 4 times with a period of 1s. After these are done,
+ * LED2 should come on and stay on.
+ *
  * @author Kevin Klues (klueska@cs.stanford.edu)
  */
 
 tosthread_t init;
 tosthread_t blink0;
 tosthread_t blink1;
-tosthread_t blink2;
 
 void init_thread(void* arg);
 void blink0_thread(void* arg);
 void blink1_thread(void* arg);
-void blink2_thread(void* arg);
 
 void tosthread_main(void* arg) {
   //Use stack estimator to calculate maximum stack size
@@ -58,10 +64,9 @@ void init_thread(void* arg) {
   for(;;) {
     tosthread_create(&blink0, blink0_thread, NULL, BLINK0_STACK_SIZE);
     tosthread_create(&blink1, blink1_thread, NULL, BLINK1_STACK_SIZE);
-    tosthread_create(&blink2, blink2_thread, NULL, BLINK2_STACK_SIZE);
-    tosthread_join(&blink2);
     tosthread_join(&blink0);
     tosthread_join(&blink1);
+    led2Toggle();
   }
 }
 
@@ -81,10 +86,3 @@ void blink1_thread(void* arg) {
   }
 }
 
-void blink2_thread(void* arg) {
-  int i;
-  for(i=0; i<6; i++) {
-    led2Toggle();
-    tosthread_sleep(1000);
-  }
-}
index b157228a01ca24c024c299bb59674b36aab0dfb8..6e48a21778e0ca362c44ae08bb4cc61fca5f61be 100644 (file)
  */
 
 /**
+ * TestLogStorage is a threaded implementation of an application that takes a dummy
+ * sensor readings of a counter, logs it flash, and then sends it out over the
+ * serial port at some later time. In the current implementation, each sensor reading is
+ * taken once every 3000ms, and records containing a set of readings from each
+ * iteration are batched out over the radio every 10000ms.  This application is
+ * very similar to the SenseStoreAndForward application contained in this same
+ * directory, except that it is written using a dummy sensor value instead of
+ * sensors specific to the tmote onboard suite. In this way, the LogStorage
+ * functionality can be tested in conjunction with the sending facility in a
+ * platform independent way.
+ * 
+ * Readings are taken from the dummy sensor and logged to flash as one record in an
+ * infinite loop. Records are then read out of flash and and sent out over the
+ * serial interface in separate infinite loop.  Before the application starts
+ * running, the entire contents of the flash drive are erased.
+ * 
+ * A successful test will result in LED0 remaining solid for approximately 6s while
+ * the flash is being erased.  After that LED0 will toggle with each successful
+ * sensor readings logged to flash, at a rate of 3000ms.  Also, LED1 will begin
+ * toggling in rapid succession once every 10000ms as records are successfully read
+ * from flash and sent out over the serial port.  Once all of the records currently
+ * recorded to flash since the last batch of sends have been sent out, LED2 Toggles
+ * to indicate completion.  This process continues in an infinite loop forever.
+ *
  * @author Kevin Klues <klueska@cs.stanford.edu>
  */
 
index 28badaf7c4861e17eb6f3fe13191baa9c0c74fac..e06c3308bf9e95ade7350111c488dc05ae0d9f26 100644 (file)
  */
  
 /**
+ * This application tests the operation of the Printf client in TOSThreads.  It
+ * continuously prints the value of a counter starting at 0, increasing as it
+ * prints.
+ * 
  * @author Kevin Klues (klueska@cs.stanford.edu)
  */
 
index bf2f7d61da4644a9595588226234bd1cb98bbf07..c6483ea65ffb05d863f81699d5eb4f30f44f474b 100644 (file)
  */
 
 /**
+ * This application is used to test the threaded version of the API for accessing
+ * the software based SineSensor usable by any platform for demonstration purposes.
+ *
+ * This application simply takes sensor readings in an infinite loop from the
+ * SineSensor and forwards them over the serial interface.  Upon successful
+ * transmission, LED0 is toggled.
+ *
  * @author Kevin Klues <klueska@cs.stanford.edu>
  */
 
index 8949738243d18f4974dc8e080dc5228e0398b731..8d26bbe3d51f4e6f34f40f5d26c4ff20d3101b68 100644 (file)
  */
  
 /**
+ * This application stresses the creation and destruction of dynamic threads by
+ * spawning lots and lots of threads over and over again and letting them run to
+ * completion.  Three different thread start functions are used, each toggling one
+ * of LED0, LED1, and LED2 every 256 spawnings. The time at which each LED is
+ * toggled is offset so that the three LEDS do not come on in unison.
+ * 
+ * Successful running of this application will result in all three leds flashing at
+ * a rate determined by how long it takes to spawn a thread on a given platform. 
+ * All three LEDs should flash at this rate in an infinite loop forever.  Given the
+ * dynamics on the mote the rate may vary over time, but the important thing is
+ * that all three LEDs continue to toggle at a reasonably visible rate.  
+ *
  * @author Kevin Klues (klueska@cs.stanford.edu)
  */
 
index 9664737045b2f22834e30c110ff1c48bc1d83242..804dd46a7cdc324de15cbcde1d05e63b60b652ef 100644 (file)
 */
 
 /**
+ * LoadFromRAM is a simple program that dynamically loads two loadable
+ * programs hardcoded in the byte arrays; One program is Blink, and the
+ * other one is Basestation.
+ *
  * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
  */
 
index 34723457dba2fd5a513df4dbc2d70c581cff91aa..7b7e96e607eb511784ef8e1b8c2f068a78f85113 100644 (file)
 */
 
 /**
+ * LoadFromRAM is a simple program that dynamically loads two loadable
+ * programs hardcoded in the byte arrays; One program is Blink, and the
+ * other one is Basestation.
+ *
  * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
  */
 
index b0adfb58361746813ca51a0ab53282b9e733bdb4..95a32cc58cfb689b0491b242202f160864dd4b95 100644 (file)
@@ -7,5 +7,16 @@ LoadFromRAM is a simple program that dynamically loads two loadable
 programs hardcoded in the byte arrays; One program is Blink, and the
 other one is Basestation.
 
-If you would like to generate your own loadable program:
-    tosthreads-gen-dynamic-app ../../capps/Blink/Blink.c
+You can install LoadFromRAM on a mote via the following command:
+  make <platform> install
+
+If you would like to generate your own loadable program run, for example:
+  cd ../../capps/Blink
+  make telosb dynthreads
+  (the output file needed is ../../capps/Blink/build/telosb/dynthreads/main.tos)       
+  
+Tools:
+  None.
+
+Known bugs/limitations:
+  None.
diff --git a/apps/tosthreads/tinyld/Makefile b/apps/tosthreads/tinyld/Makefile
new file mode 100644 (file)
index 0000000..90989c7
--- /dev/null
@@ -0,0 +1,57 @@
+#-*-makefile-*-
+######################################################################
+# 
+# Makes the entire suite of TinyOS applications for a given platform.
+#
+# Author:      Martin Turon
+# Date:                August 18, 2005
+#
+######################################################################
+# $Id$
+
+# MAKECMDGOALS is the way to get the arguments passed into a Makefile ...
+TARGET=$(MAKECMDGOALS)
+NESDOC_TARGET=$(filter-out nesdoc,$(TARGET))
+
+# Here is a way to get the list of subdirectories in a Makefile ...
+ROOT=.
+SUBDIRS := $(shell find * -type d)
+
+# Okay, match any target, and recurse the subdirectories
+%: 
+       @for i in $(SUBDIRS); do \
+         HERE=$$PWD; \
+         if [ -f $$i/Makefile ]; then \
+             echo Building ... $(PWD)/$$i; \
+             echo make $(TARGET); \
+             cd $$i; \
+             $(MAKE) $(TARGET); \
+             cd $$HERE; \
+         fi; \
+       done
+
+threads:
+       @:
+cthreads:
+       @:
+dynthreads:
+       @:
+
+BASEDIR = $(shell pwd | sed 's@\(.*\)/apps.*$$@\1@' )
+# The output directory for generated documentation
+DOCDIR = $(BASEDIR)/doc/nesdoc
+
+nesdoc:
+       @echo This target rebuilds documentation for all known platforms.
+       @echo It DOES NOT overwrite any existing documentation, thus, it 
+       @echo is best run after deleting all old documentation.
+       @echo
+       @echo To delete all old documentation, delete the contents of the
+       @echo $(DOCDIR) directory.
+       @echo
+       @echo Press Enter to continue, or ^C to abort.
+       @read
+       for platform in `ncc -print-platforms`; do \
+         $(MAKE) $$platform docs.nohtml.preserve; \
+         nesdoc -o $(DOCDIR) -html -target=$$platform; \
+       done
index ab7ee1da09cab6c762f261e7e1baaa7fc32c2d44..7cd3c047b5bba5e67ff3fe59cd1bd3d4299a1409 100644 (file)
@@ -11,14 +11,23 @@ Here are the steps:
 1.) Load SerialLoader:
     make telosb install bsl,<device_port>
     
-2.) Create the loadable code, Blink.tos:
-    tosthreads-gen-dynamic-app ../../capps/Blink/Blink.c
+2.) Create the loadable code, main.tos:
+       cd ../../capps/Blink
+       make telosb dynthreads
+       (the output file needed is ../../capps/Blink/build/telosb/dynthreads/main.tos)  
 
 3.) Clear the byte array in the mote RAM buffer:
     ./serialloader.py <device_port> 0
 
 4.) Upload the binary:
-    ./serialloader.py <device_port> 1 Blink.tos
+    ./serialloader.py <device_port> 1 main.tos
     
 5.) Run the binary:
     ./serialloader.py <device_port> 7
+
+Tools:
+  None.
+
+Known bugs/limitations:
+  None.
+
index c2103e21b2e7b7d7e613e6e33662acab954f87e2..d9e49465b241764e68c28e71ff5dca1f3834f2fc 100755 (executable)
 */
 
 /**
+ * SerialLoader receives loadable programs from the serial port and stores
+ * it in a byte array. Then, when it receives the command to load the code,
+ * it makes the call to the dynamic loader.
+ * 
  * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
  * @author Jeongyeup Paek <jpaek@enl.usc.edu>
  */
index 15b17c48e9eccdcc54ec2e6ef973eb1e39c57b7e..b66e2ef0961bcfddb3c5b6ee593828a45340aa04 100755 (executable)
 */
 
 /**
+ * SerialLoader receives loadable programs from the serial port and stores
+ * it in a byte array. Then, when it receives the command to load the code,
+ * it makes the call to the dynamic loader.
+ * 
  * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
  * @author Jeongyeup Paek <jpaek@enl.usc.edu>
  **/
index 88b8f007830a5bd4cf0c6008ee1f2cb7be326bea..bb9440f80412ddd7cf45878044953fada840000d 100755 (executable)
 */
 
 /**
+ * SerialLoaderFlash is similar to SerialLoader in that it receives
+ * loadable programs from the serial port. However, SerialLoaderFlash
+ * stores them on the external flash. Then, when it receives the command to
+ * load the code, it makes the call to the dynamic loader.
+ * 
  * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
  */
 
index a99842047636b925c5b74b88d9883550b9a0a2b5..b28855dabb07751e98381aac2734b42ba6e25872 100755 (executable)
 */
 
 /**
+ * SerialLoaderFlash is similar to SerialLoader in that it receives
+ * loadable programs from the serial port. However, SerialLoaderFlash
+ * stores them on the external flash. Then, when it receives the command to
+ * load the code, it makes the call to the dynamic loader.
+ * 
  * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
  */
 
index 3a891a00039dc9898ec4a2d21eb18c879e98f9fd..cbeaf477e8e4c125973d3ce16fbc2fdab73e0c48 100755 (executable)
@@ -12,14 +12,23 @@ Here are the steps:
 1.) Load SerialLoader:
     make telosb install bsl,<device_port>
     
-2.) Create the loadable code, Blink.tos:
-    tosthreads-gen-dynamic-app ../../capps/Blink/Blink.c
+2.) Create the loadable code, main.tos:
+       cd ../../capps/Blink
+       make telosb dynthreads
+       (the output file needed is ../../capps/Blink/build/telosb/dynthreads/main.tos)  
 
 3.) Erase the external flash:
     ./serialloader.py <device_port> 0
 
 4.) Upload the binary:
-    ./serialloader.py <device_port> 1 Blink.tos
+    ./serialloader.py <device_port> 1 main.tos
     
 5.) Run the binary:
     ./serialloader.py <device_port> 7
+
+Tools:
+  None.
+
+Known bugs/limitations:
+  None.
+
index eef04affe1dfb6fb7728233c3365f046ae8b0435..e650d1f0974b67af982b11f170d2e9394acb2dc8 100755 (executable)
  */
  
 /**
+ * SerialLoaderFlash is similar to SerialLoader in that it receives
+ * loadable programs from the serial port. However, SerialLoaderFlash
+ * stores them on the external flash. Then, when it receives the command to
+ * load the code, it makes the call to the dynamic loader.
+ * 
  * @author Kevin Klues (klueska@cs.stanford.edu)
  * @author Chieh-Jan Mike Liang <cliang4@cs.jhu.edu>
  */