]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Updated all READMEs with an extra section that describes how a successful test is...
authorjanhauer <janhauer>
Thu, 29 Oct 2009 17:42:55 +0000 (17:42 +0000)
committerjanhauer <janhauer>
Thu, 29 Oct 2009 17:42:55 +0000 (17:42 +0000)
Moved the TestPromiscuous application (it now uses the nonbeacon-enabled mode).

15 files changed:
apps/tests/tkn154/beacon-enabled/TestAssociate/README.txt
apps/tests/tkn154/beacon-enabled/TestData/README.txt
apps/tests/tkn154/beacon-enabled/TestIndirect/README.txt
apps/tests/tkn154/beacon-enabled/TestPromiscuous/Makefile [deleted file]
apps/tests/tkn154/beacon-enabled/TestPromiscuous/README.txt [deleted file]
apps/tests/tkn154/beacon-enabled/TestPromiscuous/TestPromiscuousAppC.nc [deleted file]
apps/tests/tkn154/beacon-enabled/TestPromiscuous/TestPromiscuousC.nc [deleted file]
apps/tests/tkn154/beacon-enabled/TestStartSync/README.txt
apps/tests/tkn154/nonbeacon-enabled/TestActiveScan/README.txt
apps/tests/tkn154/nonbeacon-enabled/TestAssociate/README.txt
apps/tests/tkn154/nonbeacon-enabled/TestIndirectData/README.txt
apps/tests/tkn154/nonbeacon-enabled/TestPromiscuous/Makefile [new file with mode: 0644]
apps/tests/tkn154/nonbeacon-enabled/TestPromiscuous/README.txt [new file with mode: 0644]
apps/tests/tkn154/nonbeacon-enabled/TestPromiscuous/TestPromiscuousAppC.nc [new file with mode: 0644]
apps/tests/tkn154/nonbeacon-enabled/TestPromiscuous/TestPromiscuousC.nc [new file with mode: 0644]

index 94ad58ab4a4c1c68638af946ba5bb335b09fd4c6..83cb0e6839ee8f7c471126b4e185fcb45db44d83 100644 (file)
@@ -4,25 +4,21 @@ Author/Contact: tinyos-help@millennium.berkeley.edu
 Description:
 
 In this application one node takes the role of a PAN coordinator in a
-beacon-enabled 802.15.4 PAN; it transmits periodic beacons and waits for
+beacon-enabled 802.15.4 PAN, it transmits periodic beacons and waits for
 devices to request association to its PAN. Whenever a device tries to
-associate, the PAN coordinator allows association and assigns to the device a
-unique short address (starting from zero, incremented for every device
-requesting association). 
-
-A second node acts as a device; it first scans the pre-defined channel for
-beacons from the coordinator and once it finds a beacon it tries to associate
-to the PAN and synchronize to and track all future beacons. A short time after
-association the device then disassociates from the PAN. 
-
-The third LED (Telos: blue) is toggled whenever the coordinator has transmitted
-a beacon or whenever a device has received a beacon. On the coordinator the
-second LED (Telos: green) is switched on whenever an association request was
-successful and it is switched off, whenever a disassociation request was
-received. On a device the second LED is switched on while the device is
-associated to the PAN, i.e. it is switched off after disassociation. The first
-LED (Telos: red) is used for debugging, it denotes an error in the protocol
-stack and should never be on.
+associate, the PAN coordinator accepts the association and assigns to the
+device a unique short address (starting from zero, incremented for every device
+new association). A second node acts as a device, it first scans the
+pre-defined channel for beacons from the coordinator and once it finds a beacon
+it tries to associate to the PAN and synchronize to and track all future
+beacons. A short time after association the device then disassociates from the
+PAN. 
+
+Criteria for a successful test:
+
+Assuming one coordinator and one device has been installed, both should
+simultaneously toggle (only) the second LED, about once every 5 seconds.
+
 
 Tools: NONE
 
index b767541b9a8030512240fa05b629080e783d291d..50818c82ff7b27d3e47ba892f5a0254c783bb4e8 100644 (file)
@@ -4,19 +4,19 @@ Author/Contact: tinyos-help@millennium.berkeley.edu
 Description:
 
 In this application one node takes the role of a PAN coordinator in a
-beacon-enabled 802.15.4 PAN; it transmits periodic beacons and waits for
-incoming DATA frames. A second node acts as a device; it first scans the
+beacon-enabled 802.15.4 PAN, it transmits periodic beacons and waits for
+incoming DATA frames. A second node acts as a device, it first scans the
 pre-defined channel for beacons from the coordinator and once it finds a beacon
 it tries to synchronize to and track all future beacons. It then starts to
 transmit DATA frames to the coordinator as fast as possible (direct
 transmission in the contention access period, CAP).
 
-The third LED (Telos: blue) is toggled whenever the coordinator has transmitted
-a beacon or whenever a device has received a beacon. On the coordinator the
-second LED (Telos: green) is toggled for every 20 received DATA frames. On a
-device the second LED is toggled for every 20 transmitted (and acknowledged)
-DATA frames. The first LED (Telos: red) is used for debugging, it denotes an
-error in the protocol stack and should never be on.
+Criteria for a successful test:
+
+Assuming a clear channel and one coordinator and one device has been installed,
+both should toggle (only) the second LED fast, about 5 times per second. They
+don't have to toggle the LED simultaneously.
+
 
 Tools: NONE
 
index e25ab91753dc9013ce744139a8ff312773b544a9..68122e6b1c95feb72dd9a24a577f8b642dafe08f 100644 (file)
@@ -4,7 +4,7 @@ Author/Contact: tinyos-help@millennium.berkeley.edu
 Description:
 
 In this application one node takes the role of a PAN coordinator in a
-beacon-enabled 802.15.4 PAN; it transmits periodic beacons and additionally in
+beacon-enabled 802.15.4 PAN, it transmits periodic beacons and additionally in
 every beacon interval it tries to transmit one DATA frame to a device using
 indirect tranmission. A second node that takes the role of a device first scans
 the pre-defined channel for beacons from the coordinator and once it finds a
@@ -12,12 +12,11 @@ beacon it tries to synchronize to and track all future beacons. Whenever the
 coordinator has data to send (indicated in the beacon), the device extracts the
 DATA frame from the coordinator.
 
-The third LED (Telos: blue) is toggled whenever the coordinator has transmitted
-a beacon, it is not used on the device. On the coordinator the second LED
-(Telos: green) is toggled for every transmitted DATA frames. On a device the
-second LED is toggled for every received DATA frame. The first LED (Telos: red)
-is used for debugging, it denotes an error in the protocol stack and should
-never be on.
+Criteria for a successful test:
+
+Both nodes should simultaneously toggle (only) the second LED, about once every
+half second.
+
 
 Tools: NONE
 
diff --git a/apps/tests/tkn154/beacon-enabled/TestPromiscuous/Makefile b/apps/tests/tkn154/beacon-enabled/TestPromiscuous/Makefile
deleted file mode 100644 (file)
index 4feced1..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-COMPONENT=TestPromiscuousAppC
-PFLAGS += -DPRINTF_BUFFER_SIZE=1000
-CFLAGS += -I$(TOSDIR)/lib/printf
-CFLAGS += -DIEEE154_SCAN_DISABLED -DIEEE154_BEACON_SYNC_DISABLED -DIEEE154_BEACON_TX_DISABLED -DIEEE154_RXENABLE_DISABLED -DIEEE154_ASSOCIATION_DISABLED -DIEEE154_DISASSOCIATION_DISABLED -DIEEE154_COORD_REALIGNMENT_DISABLED -DIEEE154_COORD_BROADCAST_DISABLED
-include ../../Makefile.include
diff --git a/apps/tests/tkn154/beacon-enabled/TestPromiscuous/README.txt b/apps/tests/tkn154/beacon-enabled/TestPromiscuous/README.txt
deleted file mode 100644 (file)
index 777d18e..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-README for TestPromiscuous
-Author/Contact: tinyos-help@millennium.berkeley.edu
-
-Description:
-
-In this application the node enables promiscuous mode, i.e. its radio is
-switched to receive mode and all incoming frames that pass the CRC check are
-signalled to the upper layer. The application uses the TinyOS printf library
-(tos/lib/printf) to output information on the MAC header fields and payload for
-every received frame over the serial port. The second (TelosB: green) LED is
-toggled whenever a frame is received.
-
-Tools: The printf java client in $TOSDIR/../apps/tests/TestPrintf
-
-Usage: 
-
-Install the application on a node
-
-    $ make <platform> install
-
-Start the printf client, e.g. 
-
-    $ java net.tinyos.tools.PrintfClient -comm serial@/dev/ttyUSBXXX:<platform>
-
-(http://docs.tinyos.net/ has a section on how to use the TinyOS printf library)
-
-Known bugs/limitations:
-
-- The timestamps for ACKs are incorrect
-
-$Id$
-
diff --git a/apps/tests/tkn154/beacon-enabled/TestPromiscuous/TestPromiscuousAppC.nc b/apps/tests/tkn154/beacon-enabled/TestPromiscuous/TestPromiscuousAppC.nc
deleted file mode 100644 (file)
index c771d29..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/* 
- * Copyright (c) 2008, Technische Universitaet 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 Universitaet 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$
- * @author: Jan Hauer <hauer@tkn.tu-berlin.de>
- * ========================================================================
- */
-
-configuration TestPromiscuousAppC
-{
-} implementation {
- components MainC, TestPromiscuousC as App, LedsC, 
-            Ieee802154BeaconEnabledC as MAC;
-
-  MainC.Boot <- App;
-  App.Leds -> LedsC;
-
-  App.MLME_RESET -> MAC;
-  App.MLME_SET -> MAC;
-  App.MLME_GET -> MAC;
-  App.MCPS_DATA -> MAC;
-  App.Frame -> MAC;
-  App.BeaconFrame -> MAC;
-  App.PromiscuousMode -> MAC;
-}
diff --git a/apps/tests/tkn154/beacon-enabled/TestPromiscuous/TestPromiscuousC.nc b/apps/tests/tkn154/beacon-enabled/TestPromiscuous/TestPromiscuousC.nc
deleted file mode 100644 (file)
index 8ffaa75..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/* 
- * Copyright (c) 2008, Technische Universitaet 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 Universitaet 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$
- * @author: Jan Hauer <hauer@tkn.tu-berlin.de>
- * ========================================================================
- */
-#include "TKN154.h"
-module TestPromiscuousC
-{
-  uses {
-    interface Boot;
-    interface MLME_RESET;
-    interface MLME_SET;
-    interface MLME_GET;
-    interface MCPS_DATA;
-    interface Leds;
-    interface IEEE154Frame as Frame;
-    interface IEEE154BeaconFrame as BeaconFrame;
-    interface SplitControl as PromiscuousMode;
-  }
-} implementation {
-
-  const char *m_frametype[] = {"Beacon", "Data","Acknowledgement","MAC command", "Unknown"};
-  const char *m_cmdframetype[] = {"unknown command", "Association request","Association response",
-    "Disassociation notification","Data request","PAN ID conflict notification",
-    "Orphan notification", "Beacon request", "Coordinator realignment", "GTS request"};
-
-  enum {
-    RADIO_CHANNEL = 26,
-  };
-
-  event void Boot.booted() {
-    call MLME_RESET.request(TRUE);
-  }
-
-  event void MLME_RESET.confirm(ieee154_status_t status)
-  {
-    call MLME_SET.phyCurrentChannel(RADIO_CHANNEL);
-    call PromiscuousMode.start();
-  }
-
-  event message_t* MCPS_DATA.indication (message_t* frame)
-  {
-    uint8_t i;
-    uint8_t *payload = call Frame.getPayload(frame);
-    uint8_t payloadLen = call Frame.getPayloadLength(frame);
-    uint8_t *header = call Frame.getHeader(frame);
-    uint8_t headerLen = call Frame.getHeaderLength(frame);
-    uint8_t SrcAddrMode, DstAddrMode;
-    uint8_t frameType, cmdFrameType;
-    ieee154_address_t SrcAddress, DstAddress;
-    uint16_t SrcPANId=0, DstPANId=0;
-
-    if (call Frame.hasStandardCompliantHeader(frame)){
-      frameType = call Frame.getFrameType(frame);
-      if (frameType > FRAMETYPE_CMD)
-        frameType = 4;
-      call Frame.getSrcPANId(frame, &SrcPANId);
-      call Frame.getDstPANId(frame, &DstPANId);
-      call Frame.getSrcAddr(frame, &SrcAddress);
-      call Frame.getDstAddr(frame, &DstAddress);
-      SrcAddrMode = call Frame.getSrcAddrMode(frame);
-      DstAddrMode = call Frame.getDstAddrMode(frame);
-
-      printf("\n");
-      printf("Frametype: %s", m_frametype[frameType]);
-      if (frameType == FRAMETYPE_CMD){
-        cmdFrameType = payload[0];
-        if (cmdFrameType > 9)
-          cmdFrameType = 0;
-        printf(" (%s)", m_cmdframetype[cmdFrameType]);
-      }
-      printf("\n");
-      printf("SrcAddrMode: %d\n", SrcAddrMode);
-      printf("SrcAddr: ");
-      if (SrcAddrMode == ADDR_MODE_SHORT_ADDRESS){
-        printf("0x%02X\n", SrcAddress.shortAddress);
-        printf("SrcPANId: 0x%02X\n", SrcPANId);
-      } else if (SrcAddrMode == ADDR_MODE_EXTENDED_ADDRESS){
-        for (i=0; i<8; i++)
-          printf("0x%02X ", ((uint8_t*) &(SrcAddress.extendedAddress))[i]);
-        printf("\n");
-        printf("SrcPANId: 0x%02X\n", SrcPANId);
-      } else printf("\n");
-      printf("DstAddrMode: %d\n", DstAddrMode);
-      printf("DstAddr: ");
-      if ( DstAddrMode == ADDR_MODE_SHORT_ADDRESS){
-        printf("0x%02X\n", DstAddress.shortAddress);
-        printf("DestPANId: 0x%02X\n", DstPANId);
-      } else if  ( DstAddrMode == ADDR_MODE_EXTENDED_ADDRESS) {
-        for (i=0; i<8; i++)
-          printf("0x%02X ", ((uint8_t*) &(DstAddress.extendedAddress))[i]);
-        printf("\n");    
-        printf("DestPANId: 0x%02X\n", DstPANId);
-      } else printf("\n");
-
-      printf("DSN: %d\n", call Frame.getDSN(frame));
-      printf("MHRLen: %d\n", headerLen);
-      printf("MHR: ");
-      for (i=0; i<headerLen; i++){
-        printf("0x%02X ", header[i]);
-      }
-      printf("\n");      
-      printf("PayloadLen: %d\n", payloadLen);
-      printf("Payload: ");
-      for (i=0; i<payloadLen; i++){
-        printf("0x%02X ", payload[i]);
-      }
-      printf("\n");
-      printf("MpduLinkQuality: %d\n", call Frame.getLinkQuality(frame));
-
-      printf("Timestamp: ");
-      if (call Frame.isTimestampValid(frame))
-        printf("%ld\n", call Frame.getTimestamp(frame));
-      else
-        printf("INVALID\n");
-      printfflush(); 
-    }
-    call Leds.led1Toggle();
-    return frame;
-  }
-
-  event void MCPS_DATA.confirm( message_t *msg, uint8_t msduHandle, ieee154_status_t status, uint32_t Timestamp){}
-  event void PromiscuousMode.startDone(error_t error) 
-  {
-    printf("\n*** Radio is now in promiscuous mode, listening on channel %d ***\n", RADIO_CHANNEL);
-    printfflush(); 
-  }
-  event void PromiscuousMode.stopDone(error_t error) {}
-}
index 859c549b1299e34e56788f835a0911876ccd5248..3706469c3445a3790ee7c66bc69cff085a59ea95 100644 (file)
@@ -4,18 +4,15 @@ Author/Contact: tinyos-help@millennium.berkeley.edu
 Description:
 
 In this application one node takes the role of a PAN coordinator in a
-beacon-enabled 802.15.4 PAN; it transmits periodic beacons with a frequency
-defined in the app_profile.h file. A second node acts as a device; it first
+beacon-enabled 802.15.4 PAN, it transmits periodic beacons with a frequency
+defined in the app_profile.h file. A second node acts as a device, it first
 scans all available channels for beacons from the coordinator and once it finds
 a beacon it tries to synchronize to and track all future beacons. 
 
-The third LED (Telos: blue) is toggled whenever the coordinator has transmitted
-a beacon or whenever a device has received a beacon. On the coordinator the
-second LED (Telos: green) is switched on after it has started transmitting
-beacons. On a device the second LED is switched on whenever the device is
-synchronized to the coordinator's beacons. The first LED (Telos: red) is used
-for debugging, it denotes an error in the protocol stack and should never be
-on.
+Criteria for a successful test:
+
+After a few seconds all nodes should have (only) their second LED turned on.
+
 
 Tools: NONE
 
index 588b609c0606578e598bb2645661678f7d839ce0..5990eae2c236db5bdedd972db35261c9b4a97890 100644 (file)
@@ -4,24 +4,18 @@ Author/Contact: tinyos-help@millennium.berkeley.edu
 Description:
 
 In this application one node takes the role of a PAN coordinator in a
-nonbeacon-enabled 802.15.4 PAN; it switches its radio to receive mode.
+nonbeacon-enabled 802.15.4 PAN, it switches its radio to receive mode.  A
+second node acts as a device, it switches to the pre-defined channel and
+periodically performs active-scans (i.e. sends out beacon request frames) on
+the predefined channel and expects beacon frames in return. 
 
-A second node acts as a device; it switches to the pre-defined channel and
-performs active-scans on the predefined channel. 
+Criteria for a successful test:
 
-A few basic parameters of this example can be adjusted through the
-'app_profile.h' file.
+On the coordinator node (only) the second LED should toggle once every 2 
+seconds. On the device the second and third LED should toggle once every 2 
+seconds, but with a small offset of half a second. On the device the first
+LED may toggle, but this should happen very rarely.
 
-Leds Coordinator: The first led (Telos: red) is used for debugging purposes
-only and when switched on indicating an error in the protocol-stack.  The
-second led (Telos: green) flashes when an active scan, more exactly a
-beacon-request, is received by the coordinator.
-
-Leds Device: The third led (Telos: blue) is activated for a second whenever an
-active-scan is performed.  Shortly after that the second or the first led
-flashes.  The second led (Telos: green), indicating that the coordinator
-defined in the 'app_profile.h' where found in that scan.  The first led if
-either no devices or only no matching devices where found within the scan.
 
 Tools: NONE
 
index 5a715ced62d579c4c4f26b6cbfb3793bbc8385d9..211fcf7547106e740b75b3ecbb5a1e3d8ae06c2e 100644 (file)
@@ -4,22 +4,20 @@ Author/Contact: tinyos-help@millennium.berkeley.edu
 Description:
 
 In this application one node takes the role of a PAN coordinator in a
-nonbeacon-enabled 802.15.4 PAN; it switches its radio to receive mode and waits
+nonbeacon-enabled 802.15.4 PAN, it switches its radio to receive mode and waits
 for devices to request association to its PAN. Whenever a device tries to
 associate, the PAN coordinator allows association and assigns to the device a
 unique short address (starting from zero, incremented for every device
-requesting association). 
-
-A second node acts as a device; it switches to the pre-defined channel and
-tries to associate to the PAN. A short time after association the device then
-disassociates from the PAN. 
-
-On the coordinator the second LED (Telos: green) is switched on whenever an
-association request was successful and it is switched off, whenever a
-disassociation request was received. On a device the second LED is switched on
-while the device is associated to the PAN, and it is switched off after
-disassociation. The first LED (Telos: red) is used for debugging, it denotes an
-error in the protocol stack and should never be on.
+requesting association).  A second node acts as a device, it switches to the
+pre-defined channel and tries to associate to the PAN. A short time after
+association the device then disassociates from the PAN. 
+
+Criteria for a successful test:
+
+Assuming one coordinator and one device has been installed, both should
+simultaneously switch on (only) the second LED. About 5 seconds later
+both should switch off the second LED. 
+
 
 Tools: NONE
 
index ab726cb3f8557bd72df73c985a5f59ac76ef4b6e..b91a58085c32cbac29eaa96543fb0502fc9c4f94 100644 (file)
@@ -4,25 +4,17 @@ Author/Contact: tinyos-help@millennium.berkeley.edu
 Description:
 
 In this application one node takes the role of a PAN coordinator in a
-nonbeacon-enabled 802.15.4 PAN; it switches its radio to receive mode and
-creates a packet which is addressed to the predefined address of the device.
-This packet is marked as indirect transmissions, therefore queued and sent only
-after explicit poll of the device.  After a successful transmission another
-packet is created after a definite time.
-
-A second node acts as the device; it switches to the pre-defined channel and
-polls the coordinator in predefined intervals for outstanding indirect
+nonbeacon-enabled 802.15.4 PAN, every 3 seconds it sends a packet to a device
+using indirect transmission (i.e. the packet is buffered until it is polled by
+the device). A second node acts as the device, it switches to the pre-defined
+channel and polls the coordinator every 1 second for outstanding indirect
 transmissions.
 
-A few basic parameters of this example can be adjusted through the
-'app_profile.h' file.
+Criteria for a successful test:
 
-Leds: On the coordinator the second LED (Telos: green) flashes whenever a
-packet for an indirect transmission is created and queued.  When this packet
-has not been polled by the device within the transaction time, the packet is
-discarded which is displayed by the first led (Telos: red). On the device the
-third LED (Telos: blue) flashes when after a poll of the coordinator an
-indirect transmission arrives.
+Assuming one coordinator and one device has been installed, the coordinator
+should briefly flash the second LED every 3 seconds. The device should briefly
+flash its third LED every 1 second. 
 
 
 Tools: NONE
diff --git a/apps/tests/tkn154/nonbeacon-enabled/TestPromiscuous/Makefile b/apps/tests/tkn154/nonbeacon-enabled/TestPromiscuous/Makefile
new file mode 100644 (file)
index 0000000..4feced1
--- /dev/null
@@ -0,0 +1,5 @@
+COMPONENT=TestPromiscuousAppC
+PFLAGS += -DPRINTF_BUFFER_SIZE=1000
+CFLAGS += -I$(TOSDIR)/lib/printf
+CFLAGS += -DIEEE154_SCAN_DISABLED -DIEEE154_BEACON_SYNC_DISABLED -DIEEE154_BEACON_TX_DISABLED -DIEEE154_RXENABLE_DISABLED -DIEEE154_ASSOCIATION_DISABLED -DIEEE154_DISASSOCIATION_DISABLED -DIEEE154_COORD_REALIGNMENT_DISABLED -DIEEE154_COORD_BROADCAST_DISABLED
+include ../../Makefile.include
diff --git a/apps/tests/tkn154/nonbeacon-enabled/TestPromiscuous/README.txt b/apps/tests/tkn154/nonbeacon-enabled/TestPromiscuous/README.txt
new file mode 100644 (file)
index 0000000..9377938
--- /dev/null
@@ -0,0 +1,43 @@
+README for TestPromiscuous
+Author/Contact: tinyos-help@millennium.berkeley.edu
+
+Description:
+
+In this application the node enables promiscuous mode, i.e. its radio is
+switched to receive mode and all incoming frames that pass the CRC check are
+signalled to the upper layer. The application uses the TinyOS printf library
+(tos/lib/printf) to output information on the MAC header fields and payload for
+every received frame over the serial port. The second (TelosB: green) LED is
+toggled whenever a frame is received.
+
+Criteria for a successful test:
+
+A successful test means that for every received frame the second LED is toggled
+and the java application outputs some text. To see this effect you need a
+second node sending a packet. The TestPromiscuous application does not send
+packets, but you can, for example, use the
+../../beacon-enabled/TestStartSync/coordinator application to send periodic
+beacon packets. In this case you should see some new text and the second LED
+should toggle every half second.
+
+
+Tools: The printf java client in $TOSDIR/../apps/tests/TestPrintf
+
+Usage: 
+
+Install the application on a node
+
+    $ make <platform> install
+
+Start the printf client, e.g. 
+
+    $ java net.tinyos.tools.PrintfClient -comm serial@/dev/ttyUSBXXX:<platform>
+
+(http://docs.tinyos.net/ has a section on how to use the TinyOS printf library)
+
+Known bugs/limitations:
+
+- The timestamps for ACKs are incorrect
+
+$Id$
+
diff --git a/apps/tests/tkn154/nonbeacon-enabled/TestPromiscuous/TestPromiscuousAppC.nc b/apps/tests/tkn154/nonbeacon-enabled/TestPromiscuous/TestPromiscuousAppC.nc
new file mode 100644 (file)
index 0000000..fd752f0
--- /dev/null
@@ -0,0 +1,52 @@
+/* 
+ * Copyright (c) 2008, Technische Universitaet 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 Universitaet 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$
+ * @author: Jan Hauer <hauer@tkn.tu-berlin.de>
+ * ========================================================================
+ */
+
+configuration TestPromiscuousAppC
+{
+} implementation {
+ components MainC, TestPromiscuousC as App, LedsC, 
+            Ieee802154NonBeaconEnabledC as MAC;
+
+  MainC.Boot <- App;
+  App.Leds -> LedsC;
+
+  App.MLME_RESET -> MAC;
+  App.MLME_SET -> MAC;
+  App.MLME_GET -> MAC;
+  App.MCPS_DATA -> MAC;
+  App.Frame -> MAC;
+  App.BeaconFrame -> MAC;
+  App.PromiscuousMode -> MAC;
+}
diff --git a/apps/tests/tkn154/nonbeacon-enabled/TestPromiscuous/TestPromiscuousC.nc b/apps/tests/tkn154/nonbeacon-enabled/TestPromiscuous/TestPromiscuousC.nc
new file mode 100644 (file)
index 0000000..8ffaa75
--- /dev/null
@@ -0,0 +1,158 @@
+/* 
+ * Copyright (c) 2008, Technische Universitaet 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 Universitaet 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$
+ * @author: Jan Hauer <hauer@tkn.tu-berlin.de>
+ * ========================================================================
+ */
+#include "TKN154.h"
+module TestPromiscuousC
+{
+  uses {
+    interface Boot;
+    interface MLME_RESET;
+    interface MLME_SET;
+    interface MLME_GET;
+    interface MCPS_DATA;
+    interface Leds;
+    interface IEEE154Frame as Frame;
+    interface IEEE154BeaconFrame as BeaconFrame;
+    interface SplitControl as PromiscuousMode;
+  }
+} implementation {
+
+  const char *m_frametype[] = {"Beacon", "Data","Acknowledgement","MAC command", "Unknown"};
+  const char *m_cmdframetype[] = {"unknown command", "Association request","Association response",
+    "Disassociation notification","Data request","PAN ID conflict notification",
+    "Orphan notification", "Beacon request", "Coordinator realignment", "GTS request"};
+
+  enum {
+    RADIO_CHANNEL = 26,
+  };
+
+  event void Boot.booted() {
+    call MLME_RESET.request(TRUE);
+  }
+
+  event void MLME_RESET.confirm(ieee154_status_t status)
+  {
+    call MLME_SET.phyCurrentChannel(RADIO_CHANNEL);
+    call PromiscuousMode.start();
+  }
+
+  event message_t* MCPS_DATA.indication (message_t* frame)
+  {
+    uint8_t i;
+    uint8_t *payload = call Frame.getPayload(frame);
+    uint8_t payloadLen = call Frame.getPayloadLength(frame);
+    uint8_t *header = call Frame.getHeader(frame);
+    uint8_t headerLen = call Frame.getHeaderLength(frame);
+    uint8_t SrcAddrMode, DstAddrMode;
+    uint8_t frameType, cmdFrameType;
+    ieee154_address_t SrcAddress, DstAddress;
+    uint16_t SrcPANId=0, DstPANId=0;
+
+    if (call Frame.hasStandardCompliantHeader(frame)){
+      frameType = call Frame.getFrameType(frame);
+      if (frameType > FRAMETYPE_CMD)
+        frameType = 4;
+      call Frame.getSrcPANId(frame, &SrcPANId);
+      call Frame.getDstPANId(frame, &DstPANId);
+      call Frame.getSrcAddr(frame, &SrcAddress);
+      call Frame.getDstAddr(frame, &DstAddress);
+      SrcAddrMode = call Frame.getSrcAddrMode(frame);
+      DstAddrMode = call Frame.getDstAddrMode(frame);
+
+      printf("\n");
+      printf("Frametype: %s", m_frametype[frameType]);
+      if (frameType == FRAMETYPE_CMD){
+        cmdFrameType = payload[0];
+        if (cmdFrameType > 9)
+          cmdFrameType = 0;
+        printf(" (%s)", m_cmdframetype[cmdFrameType]);
+      }
+      printf("\n");
+      printf("SrcAddrMode: %d\n", SrcAddrMode);
+      printf("SrcAddr: ");
+      if (SrcAddrMode == ADDR_MODE_SHORT_ADDRESS){
+        printf("0x%02X\n", SrcAddress.shortAddress);
+        printf("SrcPANId: 0x%02X\n", SrcPANId);
+      } else if (SrcAddrMode == ADDR_MODE_EXTENDED_ADDRESS){
+        for (i=0; i<8; i++)
+          printf("0x%02X ", ((uint8_t*) &(SrcAddress.extendedAddress))[i]);
+        printf("\n");
+        printf("SrcPANId: 0x%02X\n", SrcPANId);
+      } else printf("\n");
+      printf("DstAddrMode: %d\n", DstAddrMode);
+      printf("DstAddr: ");
+      if ( DstAddrMode == ADDR_MODE_SHORT_ADDRESS){
+        printf("0x%02X\n", DstAddress.shortAddress);
+        printf("DestPANId: 0x%02X\n", DstPANId);
+      } else if  ( DstAddrMode == ADDR_MODE_EXTENDED_ADDRESS) {
+        for (i=0; i<8; i++)
+          printf("0x%02X ", ((uint8_t*) &(DstAddress.extendedAddress))[i]);
+        printf("\n");    
+        printf("DestPANId: 0x%02X\n", DstPANId);
+      } else printf("\n");
+
+      printf("DSN: %d\n", call Frame.getDSN(frame));
+      printf("MHRLen: %d\n", headerLen);
+      printf("MHR: ");
+      for (i=0; i<headerLen; i++){
+        printf("0x%02X ", header[i]);
+      }
+      printf("\n");      
+      printf("PayloadLen: %d\n", payloadLen);
+      printf("Payload: ");
+      for (i=0; i<payloadLen; i++){
+        printf("0x%02X ", payload[i]);
+      }
+      printf("\n");
+      printf("MpduLinkQuality: %d\n", call Frame.getLinkQuality(frame));
+
+      printf("Timestamp: ");
+      if (call Frame.isTimestampValid(frame))
+        printf("%ld\n", call Frame.getTimestamp(frame));
+      else
+        printf("INVALID\n");
+      printfflush(); 
+    }
+    call Leds.led1Toggle();
+    return frame;
+  }
+
+  event void MCPS_DATA.confirm( message_t *msg, uint8_t msduHandle, ieee154_status_t status, uint32_t Timestamp){}
+  event void PromiscuousMode.startDone(error_t error) 
+  {
+    printf("\n*** Radio is now in promiscuous mode, listening on channel %d ***\n", RADIO_CHANNEL);
+    printfflush(); 
+  }
+  event void PromiscuousMode.stopDone(error_t error) {}
+}