From 60b4ac66dec192a79c1a01da195c49c6055a6582 Mon Sep 17 00:00:00 2001 From: janhauer Date: Mon, 18 May 2009 16:20:12 +0000 Subject: [PATCH] Restructured the test apps: now there is a distinction between (a separate subdir for) apps using beacon-enabled and nonbeacon-enabled mode. --- apps/tests/tkn154/README.txt | 8 +- apps/tests/tkn154/TestAssociate/README.txt | 48 ---- apps/tests/tkn154/TestAssociate/app_profile.h | 47 ---- .../tkn154/TestAssociate/coordinator/Makefile | 3 - .../coordinator/TestAssociateAppC.nc | 54 ---- .../TestAssociate/coordinator/TestCoordC.nc | 150 ----------- .../tkn154/TestAssociate/device/Makefile | 3 - .../TestAssociate/device/TestAssociateAppC.nc | 58 ----- .../TestAssociate/device/TestDeviceC.nc | 242 ------------------ apps/tests/tkn154/TestData/README.txt | 45 ---- apps/tests/tkn154/TestData/app_profile.h | 48 ---- .../tkn154/TestData/coordinator/Makefile | 3 - .../coordinator/TestCoordReceiverC.nc | 112 -------- .../TestData/coordinator/TestDataAppC.nc | 52 ---- apps/tests/tkn154/TestData/device/Makefile | 4 - .../tkn154/TestData/device/TestDataAppC.nc | 56 ---- .../TestData/device/TestDeviceSenderC.nc | 216 ---------------- apps/tests/tkn154/TestIndirect/README.txt | 43 ---- apps/tests/tkn154/TestIndirect/app_profile.h | 48 ---- .../tkn154/TestIndirect/coordinator/Makefile | 4 - .../coordinator/TestCoordSenderC.nc | 149 ----------- .../coordinator/TestIndirectAppC.nc | 52 ---- .../tests/tkn154/TestIndirect/device/Makefile | 4 - .../device/TestDeviceReceiverC.nc | 169 ------------ .../TestIndirect/device/TestIndirectAppC.nc | 53 ---- apps/tests/tkn154/TestPromiscuous/Makefile | 5 - apps/tests/tkn154/TestPromiscuous/README.txt | 33 --- .../TestPromiscuous/TestPromiscuousAppC.nc | 52 ---- .../TestPromiscuous/TestPromiscuousC.nc | 158 ------------ apps/tests/tkn154/TestStartSync/README.txt | 41 --- apps/tests/tkn154/TestStartSync/app_profile.h | 47 ---- .../tkn154/TestStartSync/coordinator/Makefile | 4 - .../TestStartSync/coordinator/TestCoordC.nc | 100 -------- .../coordinator/TestStartSyncAppC.nc | 50 ---- .../tkn154/TestStartSync/device/Makefile | 4 - .../TestStartSync/device/TestDeviceC.nc | 160 ------------ .../TestStartSync/device/TestStartSyncAppC.nc | 60 ----- apps/tests/tkn154/makeall.sh | 26 ++ 38 files changed, 31 insertions(+), 2380 deletions(-) delete mode 100644 apps/tests/tkn154/TestAssociate/README.txt delete mode 100644 apps/tests/tkn154/TestAssociate/app_profile.h delete mode 100644 apps/tests/tkn154/TestAssociate/coordinator/Makefile delete mode 100644 apps/tests/tkn154/TestAssociate/coordinator/TestAssociateAppC.nc delete mode 100644 apps/tests/tkn154/TestAssociate/coordinator/TestCoordC.nc delete mode 100644 apps/tests/tkn154/TestAssociate/device/Makefile delete mode 100644 apps/tests/tkn154/TestAssociate/device/TestAssociateAppC.nc delete mode 100644 apps/tests/tkn154/TestAssociate/device/TestDeviceC.nc delete mode 100644 apps/tests/tkn154/TestData/README.txt delete mode 100644 apps/tests/tkn154/TestData/app_profile.h delete mode 100644 apps/tests/tkn154/TestData/coordinator/Makefile delete mode 100644 apps/tests/tkn154/TestData/coordinator/TestCoordReceiverC.nc delete mode 100644 apps/tests/tkn154/TestData/coordinator/TestDataAppC.nc delete mode 100644 apps/tests/tkn154/TestData/device/Makefile delete mode 100644 apps/tests/tkn154/TestData/device/TestDataAppC.nc delete mode 100644 apps/tests/tkn154/TestData/device/TestDeviceSenderC.nc delete mode 100644 apps/tests/tkn154/TestIndirect/README.txt delete mode 100644 apps/tests/tkn154/TestIndirect/app_profile.h delete mode 100644 apps/tests/tkn154/TestIndirect/coordinator/Makefile delete mode 100644 apps/tests/tkn154/TestIndirect/coordinator/TestCoordSenderC.nc delete mode 100644 apps/tests/tkn154/TestIndirect/coordinator/TestIndirectAppC.nc delete mode 100644 apps/tests/tkn154/TestIndirect/device/Makefile delete mode 100644 apps/tests/tkn154/TestIndirect/device/TestDeviceReceiverC.nc delete mode 100644 apps/tests/tkn154/TestIndirect/device/TestIndirectAppC.nc delete mode 100644 apps/tests/tkn154/TestPromiscuous/Makefile delete mode 100644 apps/tests/tkn154/TestPromiscuous/README.txt delete mode 100644 apps/tests/tkn154/TestPromiscuous/TestPromiscuousAppC.nc delete mode 100644 apps/tests/tkn154/TestPromiscuous/TestPromiscuousC.nc delete mode 100644 apps/tests/tkn154/TestStartSync/README.txt delete mode 100644 apps/tests/tkn154/TestStartSync/app_profile.h delete mode 100644 apps/tests/tkn154/TestStartSync/coordinator/Makefile delete mode 100644 apps/tests/tkn154/TestStartSync/coordinator/TestCoordC.nc delete mode 100644 apps/tests/tkn154/TestStartSync/coordinator/TestStartSyncAppC.nc delete mode 100644 apps/tests/tkn154/TestStartSync/device/Makefile delete mode 100644 apps/tests/tkn154/TestStartSync/device/TestDeviceC.nc delete mode 100644 apps/tests/tkn154/TestStartSync/device/TestStartSyncAppC.nc create mode 100755 apps/tests/tkn154/makeall.sh diff --git a/apps/tests/tkn154/README.txt b/apps/tests/tkn154/README.txt index eb945797..d2940a05 100644 --- a/apps/tests/tkn154/README.txt +++ b/apps/tests/tkn154/README.txt @@ -4,9 +4,11 @@ Author/Contact: tinyos-help@millennium.berkeley.edu Description: This folder contains test applications for "TKN15.4", a platform-independent -IEEE 802.15.4-2006 MAC implementation. Every test application resides in a -separate subdirectory which includes a README.txt describing what it does and -how it can be installed, respectively. +IEEE 802.15.4-2006 MAC implementation. Applications that use the beacon-enabled +mode are located in the "beacon-enabled" folder, applications that use the +nonbeacon-enabled mode are in the "nonbeacon-enabled" folder. Every test +application resides in a separate subdirectory which includes a README.txt +describing what it does and how it can be installed, respectively. The TKN15.4 implementation can be found in tinyos-2.x/tos/lib/mac/tkn154. Note: TEP3 recommends that interface names "should be mixed case, starting diff --git a/apps/tests/tkn154/TestAssociate/README.txt b/apps/tests/tkn154/TestAssociate/README.txt deleted file mode 100644 index eefdf410..00000000 --- a/apps/tests/tkn154/TestAssociate/README.txt +++ /dev/null @@ -1,48 +0,0 @@ -README for TestAssociate -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 -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. - -Tools: NONE - -Usage: - -1. Install the coordinator: - - $ cd coordinator; make telosb install - -2. Install one (or more) devices: - - $ cd device; make telosb install - -You can change some of the configuration parameters in app_profile.h - -Known bugs/limitations: - -- Currently this application only works on TelosB nodes -- The MAC timing is not standard compliant, because TelosB lacks a - clock with sufficient precision/accuracy - -$Id$o - diff --git a/apps/tests/tkn154/TestAssociate/app_profile.h b/apps/tests/tkn154/TestAssociate/app_profile.h deleted file mode 100644 index 21641f66..00000000 --- a/apps/tests/tkn154/TestAssociate/app_profile.h +++ /dev/null @@ -1,47 +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 - * ======================================================================== - */ - -#ifndef __APP_PROFILE_H -#define __APP_PROFILE_H - -enum { - RADIO_CHANNEL = 26, - PAN_ID = 0x1238, - COORDINATOR_ADDRESS = 0x9182, - BEACON_ORDER = 6, - SUPERFRAME_ORDER = 6, -}; - -#endif diff --git a/apps/tests/tkn154/TestAssociate/coordinator/Makefile b/apps/tests/tkn154/TestAssociate/coordinator/Makefile deleted file mode 100644 index 7fe71344..00000000 --- a/apps/tests/tkn154/TestAssociate/coordinator/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -COMPONENT=TestAssociateAppC -CFLAGS += -I$(shell pwd)/.. -include ../../Makefile.include diff --git a/apps/tests/tkn154/TestAssociate/coordinator/TestAssociateAppC.nc b/apps/tests/tkn154/TestAssociate/coordinator/TestAssociateAppC.nc deleted file mode 100644 index 7a4ca06e..00000000 --- a/apps/tests/tkn154/TestAssociate/coordinator/TestAssociateAppC.nc +++ /dev/null @@ -1,54 +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 - * ======================================================================== - */ - -configuration TestAssociateAppC -{ -} implementation { - components MainC, LedsC, Ieee802154BeaconEnabledC as MAC; - components TestCoordC as App; - - MainC.Boot <- App; - App.Leds -> LedsC; - App.MLME_RESET -> MAC; - App.MLME_SET -> MAC; - App.MLME_GET -> MAC; - - App.MLME_START -> MAC; - App.MLME_ASSOCIATE -> MAC; - App.MLME_DISASSOCIATE -> MAC; - App.MLME_COMM_STATUS -> MAC; - App.Frame -> MAC; - App.IEEE154TxBeaconPayload -> MAC; -} diff --git a/apps/tests/tkn154/TestAssociate/coordinator/TestCoordC.nc b/apps/tests/tkn154/TestAssociate/coordinator/TestCoordC.nc deleted file mode 100644 index b0d8ca9a..00000000 --- a/apps/tests/tkn154/TestAssociate/coordinator/TestCoordC.nc +++ /dev/null @@ -1,150 +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 - * ======================================================================== - */ - -#include "TKN154.h" -#include "app_profile.h" -module TestCoordC -{ - uses { - interface Boot; - interface MLME_RESET; - interface MLME_START; - interface MLME_ASSOCIATE; - interface MLME_DISASSOCIATE; - interface MLME_COMM_STATUS; - interface MLME_SET; - interface MLME_GET; - interface IEEE154Frame as Frame; - interface IEEE154TxBeaconPayload; - interface Leds; - } -} implementation { - - ieee154_address_t m_lastDevice; - uint16_t m_shortAddress; - - event void Boot.booted() { - call MLME_RESET.request(TRUE); - } - - event void MLME_RESET.confirm(ieee154_status_t status) - { - if (status != IEEE154_SUCCESS) - return; - call MLME_SET.macShortAddress(COORDINATOR_ADDRESS); - call MLME_SET.macAssociationPermit(TRUE); - call MLME_START.request( - PAN_ID, // PANId - RADIO_CHANNEL, // LogicalChannel - 0, // ChannelPage, - 0, // StartTime, - BEACON_ORDER, // BeaconOrder - SUPERFRAME_ORDER, // SuperframeOrder - TRUE, // PANCoordinator - FALSE, // BatteryLifeExtension - FALSE, // CoordRealignment - 0, // no realignment security - 0 // no beacon security - ); - } - - event void MLME_START.confirm(ieee154_status_t status) { } - - event void MLME_ASSOCIATE.indication ( - uint64_t DeviceAddress, - ieee154_CapabilityInformation_t CapabilityInformation, - ieee154_security_t *security - ) - { - call MLME_ASSOCIATE.response(DeviceAddress, m_shortAddress++, IEEE154_ASSOCIATION_SUCCESSFUL, 0); - } - - event void MLME_DISASSOCIATE.indication ( - uint64_t DeviceAddress, - ieee154_disassociation_reason_t DisassociateReason, - ieee154_security_t *security - ) - { - call Leds.led1Off(); - } - - - event void MLME_COMM_STATUS.indication ( - uint16_t PANId, - uint8_t SrcAddrMode, - ieee154_address_t SrcAddr, - uint8_t DstAddrMode, - ieee154_address_t DstAddr, - ieee154_status_t status, - ieee154_security_t *security - ) - { - if (status == IEEE154_SUCCESS){ - // association was successful - call Leds.led1On(); - m_lastDevice.extendedAddress = DstAddr.extendedAddress; - } else { - call Leds.led1Off(); - } - } - - event void MLME_DISASSOCIATE.confirm ( - ieee154_status_t status, - uint8_t DeviceAddrMode, - uint16_t DevicePANID, - ieee154_address_t DeviceAddress - ){} - - event void MLME_ASSOCIATE.confirm ( - uint16_t AssocShortAddress, - uint8_t status, - ieee154_security_t *security - ){} - - event void IEEE154TxBeaconPayload.aboutToTransmit() { } - - event void IEEE154TxBeaconPayload.setBeaconPayloadDone(void *beaconPayload, uint8_t length) { } - - event void IEEE154TxBeaconPayload.modifyBeaconPayloadDone(uint8_t offset, void *buffer, uint8_t bufferLength) { } - - event void IEEE154TxBeaconPayload.beaconTransmitted() - { - ieee154_macBSN_t beaconSequenceNumber = call MLME_GET.macBSN(); - if (beaconSequenceNumber & 1) - call Leds.led2On(); - else - call Leds.led2Off(); - } -} diff --git a/apps/tests/tkn154/TestAssociate/device/Makefile b/apps/tests/tkn154/TestAssociate/device/Makefile deleted file mode 100644 index 7fe71344..00000000 --- a/apps/tests/tkn154/TestAssociate/device/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -COMPONENT=TestAssociateAppC -CFLAGS += -I$(shell pwd)/.. -include ../../Makefile.include diff --git a/apps/tests/tkn154/TestAssociate/device/TestAssociateAppC.nc b/apps/tests/tkn154/TestAssociate/device/TestAssociateAppC.nc deleted file mode 100644 index 992d3dcb..00000000 --- a/apps/tests/tkn154/TestAssociate/device/TestAssociateAppC.nc +++ /dev/null @@ -1,58 +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 - * ======================================================================== - */ - -configuration TestAssociateAppC -{ -} implementation { - components MainC, LedsC, Ieee802154BeaconEnabledC as MAC, - new Timer62500C() as Timer; - components TestDeviceC as App; - - MainC.Boot <- App; - App.Leds -> LedsC; - App.MLME_RESET -> MAC; - App.MLME_SET -> MAC; - App.MLME_GET -> MAC; - App.DisassociateTimer -> Timer; - App.MLME_SCAN -> MAC; - App.MLME_SYNC -> MAC; - App.MLME_BEACON_NOTIFY -> MAC; - App.MLME_SYNC_LOSS -> MAC; - App.MLME_ASSOCIATE -> MAC; - App.MLME_DISASSOCIATE -> MAC; - App.MLME_COMM_STATUS -> MAC; - App.BeaconFrame -> MAC; - -} diff --git a/apps/tests/tkn154/TestAssociate/device/TestDeviceC.nc b/apps/tests/tkn154/TestAssociate/device/TestDeviceC.nc deleted file mode 100644 index 55a07084..00000000 --- a/apps/tests/tkn154/TestAssociate/device/TestDeviceC.nc +++ /dev/null @@ -1,242 +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 - * ======================================================================== - */ -#include "TKN154.h" -#include "app_profile.h" -module TestDeviceC -{ - uses { - interface Boot; - interface MLME_RESET; - interface MLME_SET; - interface MLME_GET; - interface MLME_SCAN; - interface MLME_SYNC; - interface MLME_ASSOCIATE; - interface MLME_DISASSOCIATE; - interface MLME_COMM_STATUS; - interface MLME_BEACON_NOTIFY; - interface MLME_SYNC_LOSS; - interface Leds; - interface IEEE154BeaconFrame as BeaconFrame; - interface Timer as DisassociateTimer; - } -} implementation { - - ieee154_CapabilityInformation_t m_capabilityInformation; - ieee154_PANDescriptor_t m_PANDescriptor; - bool m_isPANDescriptorValid; - void startApp(); - - event void Boot.booted() { - m_capabilityInformation.AlternatePANCoordinator = 0; - m_capabilityInformation.DeviceType = 0; - m_capabilityInformation.PowerSource = 0; - m_capabilityInformation.ReceiverOnWhenIdle = 0; - m_capabilityInformation.Reserved = 0; - m_capabilityInformation.SecurityCapability = 0; - m_capabilityInformation.AllocateAddress = 1; - call MLME_RESET.request(TRUE); - } - - event void MLME_RESET.confirm(ieee154_status_t status) - { - if (status == IEEE154_SUCCESS) - startApp(); - } - - void startApp() - { - ieee154_phyChannelsSupported_t channel; - uint8_t scanDuration = BEACON_ORDER; - - m_isPANDescriptorValid = FALSE; - - // scan only one channel - channel = ((uint32_t) 1) << RADIO_CHANNEL; - - // we want all received beacons to be signalled - // through the MLME_BEACON_NOTIFY interface, i.e. - // we set the macAutoRequest attribute to FALSE - call MLME_SET.macAutoRequest(FALSE); - m_isPANDescriptorValid = FALSE; - call MLME_SCAN.request ( - PASSIVE_SCAN, // ScanType - channel, // ScanChannels - scanDuration, // ScanDuration - 0x00, // ChannelPage - 0, // EnergyDetectListNumEntries - NULL, // EnergyDetectList - 0, // PANDescriptorListNumEntries - NULL, // PANDescriptorList - NULL // security - ); - } - - event message_t* MLME_BEACON_NOTIFY.indication (message_t* frame) - { - // received a beacon frame - ieee154_phyCurrentPage_t page = call MLME_GET.phyCurrentPage(); - ieee154_macBSN_t beaconSequenceNumber = call BeaconFrame.getBSN(frame); - - if (beaconSequenceNumber & 1) - call Leds.led2On(); - else - call Leds.led2Off(); - if (!m_isPANDescriptorValid && call BeaconFrame.parsePANDescriptor( - frame, RADIO_CHANNEL, page, &m_PANDescriptor) == SUCCESS){ - // let's see if the beacon is from the coordinator we expect... - if (m_PANDescriptor.CoordAddrMode == ADDR_MODE_SHORT_ADDRESS && - m_PANDescriptor.CoordPANId == PAN_ID && - m_PANDescriptor.CoordAddress.shortAddress == COORDINATOR_ADDRESS){ - // yes - wait until SCAN is finished, then syncronize to beacons - m_isPANDescriptorValid = TRUE; - } - } - return frame; - } - - event void MLME_SCAN.confirm ( - ieee154_status_t status, - uint8_t ScanType, - uint8_t ChannelPage, - uint32_t UnscannedChannels, - uint8_t EnergyDetectListNumEntries, - int8_t* EnergyDetectList, - uint8_t PANDescriptorListNumEntries, - ieee154_PANDescriptor_t* PANDescriptorList - ) - { - if (m_isPANDescriptorValid){ - call MLME_SET.macPANId(m_PANDescriptor.CoordPANId); - call MLME_SET.macCoordShortAddress(m_PANDescriptor.CoordAddress.shortAddress); - call MLME_SYNC.request(m_PANDescriptor.LogicalChannel, m_PANDescriptor.ChannelPage, TRUE); - call MLME_ASSOCIATE.request( - m_PANDescriptor.LogicalChannel, - m_PANDescriptor.ChannelPage, - m_PANDescriptor.CoordAddrMode, - m_PANDescriptor.CoordPANId, - m_PANDescriptor.CoordAddress, - m_capabilityInformation, - NULL // security - ); - } else - startApp(); - } - - event void MLME_ASSOCIATE.confirm ( - uint16_t AssocShortAddress, - uint8_t status, - ieee154_security_t *security - ) - { - if ( status == IEEE154_SUCCESS ){ - // we are now associated - set a timer for disassociation - call Leds.led1On(); - call DisassociateTimer.startOneShot(312500U); - } else { - call MLME_ASSOCIATE.request( - m_PANDescriptor.LogicalChannel, - m_PANDescriptor.ChannelPage, - m_PANDescriptor.CoordAddrMode, - m_PANDescriptor.CoordPANId, - m_PANDescriptor.CoordAddress, - m_capabilityInformation, - NULL // security - ); - } - } - - event void DisassociateTimer.fired() - { - if (call MLME_DISASSOCIATE.request ( - m_PANDescriptor.CoordAddrMode, - m_PANDescriptor.CoordPANId, - m_PANDescriptor.CoordAddress, - IEEE154_DEVICE_WISHES_TO_LEAVE, - FALSE, - NULL - ) != IEEE154_SUCCESS) - call DisassociateTimer.startOneShot(312500U); - } - - event void MLME_DISASSOCIATE.confirm ( - ieee154_status_t status, - uint8_t DeviceAddrMode, - uint16_t DevicePANID, - ieee154_address_t DeviceAddress - ) - { - if (status == IEEE154_SUCCESS){ - call Leds.led1Off(); - } else { - call DisassociateTimer.startOneShot(312500U); - } - } - - event void MLME_ASSOCIATE.indication ( - uint64_t DeviceAddress, - ieee154_CapabilityInformation_t CapabilityInformation, - ieee154_security_t *security - ){} - - event void MLME_SYNC_LOSS.indication( - ieee154_status_t lossReason, - uint16_t PANId, - uint8_t LogicalChannel, - uint8_t ChannelPage, - ieee154_security_t *security) - { - startApp(); - } - - event void MLME_DISASSOCIATE.indication ( - uint64_t DeviceAddress, - ieee154_disassociation_reason_t DisassociateReason, - ieee154_security_t *security - ){} - - - event void MLME_COMM_STATUS.indication ( - uint16_t PANId, - uint8_t SrcAddrMode, - ieee154_address_t SrcAddr, - uint8_t DstAddrMode, - ieee154_address_t DstAddr, - ieee154_status_t status, - ieee154_security_t *security - ) - { - } -} diff --git a/apps/tests/tkn154/TestData/README.txt b/apps/tests/tkn154/TestData/README.txt deleted file mode 100644 index 08d0939e..00000000 --- a/apps/tests/tkn154/TestData/README.txt +++ /dev/null @@ -1,45 +0,0 @@ -README for TestData -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 -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. - -Tools: NONE - -Usage: - -1. Install the coordinator: - - $ cd coordinator; make telosb install - -2. Install one or more devices - - $ cd device; make telosb install,X - - where X is a pre-assigned short address and should be different - for every device. - -You can change some of the configuration parameters in app_profile.h - -Known bugs/limitations: - -- Currently this application only works on TelosB nodes -- The MAC timing is not standard compliant, because TelosB lacks a - clock with sufficient precision/accuracy - -$Id$o - diff --git a/apps/tests/tkn154/TestData/app_profile.h b/apps/tests/tkn154/TestData/app_profile.h deleted file mode 100644 index 5a331de9..00000000 --- a/apps/tests/tkn154/TestData/app_profile.h +++ /dev/null @@ -1,48 +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 - * ======================================================================== - */ - -#ifndef __APP_PROFILE_H -#define __APP_PROFILE_H - -enum { - RADIO_CHANNEL = 26, - PAN_ID = 0x8172, - COORDINATOR_ADDRESS = 0x4331, - BEACON_ORDER = 5, - SUPERFRAME_ORDER = 5, -}; -//#define IEEE154_DEFAULT_TRANSMITPOWER_dBm -25 - -#endif diff --git a/apps/tests/tkn154/TestData/coordinator/Makefile b/apps/tests/tkn154/TestData/coordinator/Makefile deleted file mode 100644 index 42f11300..00000000 --- a/apps/tests/tkn154/TestData/coordinator/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -COMPONENT=TestDataAppC -CFLAGS += -I$(shell pwd)/.. -include ../../Makefile.include diff --git a/apps/tests/tkn154/TestData/coordinator/TestCoordReceiverC.nc b/apps/tests/tkn154/TestData/coordinator/TestCoordReceiverC.nc deleted file mode 100644 index 8ae7d636..00000000 --- a/apps/tests/tkn154/TestData/coordinator/TestCoordReceiverC.nc +++ /dev/null @@ -1,112 +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 - * ======================================================================== - */ - -#include "TKN154.h" -#include "app_profile.h" -module TestCoordReceiverC -{ - uses { - interface Boot; - interface MCPS_DATA; - interface MLME_RESET; - interface MLME_START; - interface MLME_SET; - interface MLME_GET; - interface IEEE154Frame as Frame; - interface IEEE154TxBeaconPayload; - interface Leds; - } -} implementation { - - bool m_ledCount; - - event void Boot.booted() { - call MLME_RESET.request(TRUE); - } - - event void MLME_RESET.confirm(ieee154_status_t status) - { - if (status != IEEE154_SUCCESS) - return; - call MLME_SET.macShortAddress(COORDINATOR_ADDRESS); - call MLME_SET.macAssociationPermit(FALSE); - call MLME_START.request( - PAN_ID, // PANId - RADIO_CHANNEL, // LogicalChannel - 0, // ChannelPage, - 0, // StartTime, - BEACON_ORDER, // BeaconOrder - SUPERFRAME_ORDER, // SuperframeOrder - TRUE, // PANCoordinator - FALSE, // BatteryLifeExtension - FALSE, // CoordRealignment - 0, // CoordRealignSecurity, - 0 // BeaconSecurity - ); - } - - event message_t* MCPS_DATA.indication ( message_t* frame ) - { - if (m_ledCount++ == 20){ - m_ledCount = 0; - call Leds.led1Toggle(); - } - return frame; - } - - event void MLME_START.confirm(ieee154_status_t status) {} - - event void MCPS_DATA.confirm( - message_t *msg, - uint8_t msduHandle, - ieee154_status_t status, - uint32_t Timestamp - ){} - - event void IEEE154TxBeaconPayload.aboutToTransmit() { } - - event void IEEE154TxBeaconPayload.setBeaconPayloadDone(void *beaconPayload, uint8_t length) { } - - event void IEEE154TxBeaconPayload.modifyBeaconPayloadDone(uint8_t offset, void *buffer, uint8_t bufferLength) { } - - event void IEEE154TxBeaconPayload.beaconTransmitted() - { - ieee154_macBSN_t beaconSequenceNumber = call MLME_GET.macBSN(); - if (beaconSequenceNumber & 1) - call Leds.led2On(); - else - call Leds.led2Off(); - } -} diff --git a/apps/tests/tkn154/TestData/coordinator/TestDataAppC.nc b/apps/tests/tkn154/TestData/coordinator/TestDataAppC.nc deleted file mode 100644 index 4c485161..00000000 --- a/apps/tests/tkn154/TestData/coordinator/TestDataAppC.nc +++ /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 - * ======================================================================== - */ -#include "app_profile.h" -configuration TestDataAppC -{ -} implementation { - components MainC, LedsC, Ieee802154BeaconEnabledC as MAC; - - components TestCoordReceiverC as App; - App.MLME_START -> MAC; - App.MCPS_DATA -> MAC; - App.Frame -> MAC; - - MainC.Boot <- App; - App.Leds -> LedsC; - App.MLME_RESET -> MAC; - App.MLME_SET -> MAC; - App.MLME_GET -> MAC; - App.IEEE154TxBeaconPayload -> MAC; -} diff --git a/apps/tests/tkn154/TestData/device/Makefile b/apps/tests/tkn154/TestData/device/Makefile deleted file mode 100644 index d6b49165..00000000 --- a/apps/tests/tkn154/TestData/device/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -COMPONENT=TestDataAppC -PFLAGS += -DIEEE154_BEACON_TX_DISABLED -CFLAGS += -I$(shell pwd)/.. -include ../../Makefile.include diff --git a/apps/tests/tkn154/TestData/device/TestDataAppC.nc b/apps/tests/tkn154/TestData/device/TestDataAppC.nc deleted file mode 100644 index 147f4834..00000000 --- a/apps/tests/tkn154/TestData/device/TestDataAppC.nc +++ /dev/null @@ -1,56 +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 - * ======================================================================== - */ -#include "app_profile.h" -configuration TestDataAppC -{ -} implementation { - components MainC, LedsC, Ieee802154BeaconEnabledC as MAC; - - components TestDeviceSenderC as App; - App.MLME_SCAN -> MAC; - App.MLME_SYNC -> MAC; - App.MLME_BEACON_NOTIFY -> MAC; - App.MLME_SYNC_LOSS -> MAC; - App.MCPS_DATA -> MAC; - App.Frame -> MAC; - App.BeaconFrame -> MAC; - App.Packet -> MAC; - - MainC.Boot <- App; - App.Leds -> LedsC; - App.MLME_RESET -> MAC; - App.MLME_SET -> MAC; - App.MLME_GET -> MAC; -} diff --git a/apps/tests/tkn154/TestData/device/TestDeviceSenderC.nc b/apps/tests/tkn154/TestData/device/TestDeviceSenderC.nc deleted file mode 100644 index 279e43e2..00000000 --- a/apps/tests/tkn154/TestData/device/TestDeviceSenderC.nc +++ /dev/null @@ -1,216 +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 - * ======================================================================== - */ - -#include "TKN154.h" -#include "app_profile.h" -module TestDeviceSenderC -{ - uses { - interface Boot; - interface MCPS_DATA; - interface MLME_RESET; - interface MLME_SET; - interface MLME_GET; - interface MLME_SCAN; - interface MLME_SYNC; - interface MLME_BEACON_NOTIFY; - interface MLME_SYNC_LOSS; - interface IEEE154Frame as Frame; - interface IEEE154BeaconFrame as BeaconFrame; - interface Leds; - interface Packet; - } -} implementation { - - message_t m_frame; - uint8_t m_payloadLen; - ieee154_PANDescriptor_t m_PANDescriptor; - bool m_ledCount; - bool m_isPANDescriptorValid; - bool m_sending; - - void startApp(); - task void packetSendTask(); - - - event void Boot.booted() { - char payload[] = "Hello Coordinator!"; - uint8_t *payloadRegion; - - m_payloadLen = strlen(payload); - payloadRegion = call Packet.getPayload(&m_frame, m_payloadLen); - if (m_payloadLen <= call Packet.maxPayloadLength()){ - memcpy(payloadRegion, payload, m_payloadLen); - call MLME_RESET.request(TRUE); - } - } - - event void MLME_RESET.confirm(ieee154_status_t status) - { - if (status == IEEE154_SUCCESS) - startApp(); - } - - void startApp() - { - ieee154_phyChannelsSupported_t channelMask; - uint8_t scanDuration = BEACON_ORDER; - - m_isPANDescriptorValid = FALSE; - call MLME_SET.macShortAddress(TOS_NODE_ID); - - // scan only one channel - channelMask = ((uint32_t) 1) << RADIO_CHANNEL; - - // we want all received beacons to be signalled - // through the MLME_BEACON_NOTIFY interface, i.e. - // we set the macAutoRequest attribute to FALSE - call MLME_SET.macAutoRequest(FALSE); - call MLME_SCAN.request ( - PASSIVE_SCAN, // ScanType - channelMask, // ScanChannels - scanDuration, // ScanDuration - 0x00, // ChannelPage - 0, // EnergyDetectListNumEntries - NULL, // EnergyDetectList - 0, // PANDescriptorListNumEntries - NULL, // PANDescriptorList - 0 // security - ); - } - bool m_ready; - - event message_t* MLME_BEACON_NOTIFY.indication (message_t* frame) - { - // received a beacon frame - ieee154_phyCurrentPage_t page = call MLME_GET.phyCurrentPage(); - ieee154_macBSN_t beaconSequenceNumber = call BeaconFrame.getBSN(frame); - - if (m_ready) - post packetSendTask(); - if (beaconSequenceNumber & 1) - call Leds.led2On(); - else - call Leds.led2Off(); - if (!m_isPANDescriptorValid && call BeaconFrame.parsePANDescriptor( - frame, RADIO_CHANNEL, page, &m_PANDescriptor) == SUCCESS){ - // let's see if the beacon is from our coordinator... - if (m_PANDescriptor.CoordAddrMode == ADDR_MODE_SHORT_ADDRESS && - m_PANDescriptor.CoordPANId == PAN_ID && - m_PANDescriptor.CoordAddress.shortAddress == COORDINATOR_ADDRESS){ - // yes! wait until SCAN is finished, then syncronize to the beacons - m_isPANDescriptorValid = TRUE; - } - } - return frame; - } - - event void MLME_SCAN.confirm ( - ieee154_status_t status, - uint8_t ScanType, - uint8_t ChannelPage, - uint32_t UnscannedChannels, - uint8_t EnergyDetectListNumEntries, - int8_t* EnergyDetectList, - uint8_t PANDescriptorListNumEntries, - ieee154_PANDescriptor_t* PANDescriptorList - ) - { - if (m_isPANDescriptorValid){ - call MLME_SET.macCoordShortAddress(m_PANDescriptor.CoordAddress.shortAddress); - call MLME_SET.macPANId(m_PANDescriptor.CoordPANId); - call MLME_SYNC.request(m_PANDescriptor.LogicalChannel, m_PANDescriptor.ChannelPage, TRUE); - call Frame.setAddressingFields( - &m_frame, - ADDR_MODE_SHORT_ADDRESS, // SrcAddrMode, - ADDR_MODE_SHORT_ADDRESS, // DstAddrMode, - m_PANDescriptor.CoordPANId, // DstPANId, - &m_PANDescriptor.CoordAddress, // DstAddr, - NULL // security - ); - post packetSendTask(); - m_ready = TRUE; - } else - startApp(); - } - - task void packetSendTask() - { - if (!m_sending && m_isPANDescriptorValid && - call MCPS_DATA.request ( - &m_frame, // frame, - m_payloadLen, // payloadLength, - 0, // msduHandle, - TX_OPTIONS_ACK // TxOptions, - ) == IEEE154_SUCCESS) - m_sending = TRUE; - } - - uint8_t m_useLeds = TRUE; - event void MCPS_DATA.confirm ( - message_t *msg, - uint8_t msduHandle, - ieee154_status_t status, - uint32_t timestamp - ) - { - m_sending = FALSE; - if (status == IEEE154_SUCCESS && m_ledCount++ == 20){ - m_ledCount = 0; - if (m_useLeds) - call Leds.led1Toggle(); - } - post packetSendTask(); - } - - event void MLME_SYNC_LOSS.indication( - ieee154_status_t lossReason, - uint16_t PANId, - uint8_t LogicalChannel, - uint8_t ChannelPage, - ieee154_security_t *security) - { - m_useLeds = FALSE; - call Leds.led1Off(); - //startApp(); - } - - event message_t* MCPS_DATA.indication (message_t* frame) - { - // we don't expect data - return frame; - } - -} diff --git a/apps/tests/tkn154/TestIndirect/README.txt b/apps/tests/tkn154/TestIndirect/README.txt deleted file mode 100644 index c4525203..00000000 --- a/apps/tests/tkn154/TestIndirect/README.txt +++ /dev/null @@ -1,43 +0,0 @@ -README for TestIndirect -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 -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 -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. - -Tools: NONE - -Usage: - -1. Install the coordinator: - - $ cd coordinator; make telosb install - -2. Install one device - - $ cd device; make telosb install - -You can change some of the configuration parameters in app_profile.h - -Known bugs/limitations: - -- Currently this application only works on TelosB nodes -- The MAC timing is not standard compliant, because TelosB lacks a - clock with sufficient precision/accuracy - -$Id$ - diff --git a/apps/tests/tkn154/TestIndirect/app_profile.h b/apps/tests/tkn154/TestIndirect/app_profile.h deleted file mode 100644 index 185bbcdf..00000000 --- a/apps/tests/tkn154/TestIndirect/app_profile.h +++ /dev/null @@ -1,48 +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 - * ======================================================================== - */ - -#ifndef __APP_PROFILE_H -#define __APP_PROFILE_H - -enum { - RADIO_CHANNEL = 26, - PAN_ID = 0x1152, - DEVICE_ADDRESS = 0x4342, - COORDINATOR_ADDRESS = 0x5341, - BEACON_ORDER = 5, - SUPERFRAME_ORDER = 5, -}; - -#endif diff --git a/apps/tests/tkn154/TestIndirect/coordinator/Makefile b/apps/tests/tkn154/TestIndirect/coordinator/Makefile deleted file mode 100644 index acdecfdc..00000000 --- a/apps/tests/tkn154/TestIndirect/coordinator/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -COMPONENT=TestIndirectAppC -PFLAGS += -DIEEE154_BEACON_SYNC_DISABLED -DIEEE154_SCAN_DISABLED -CFLAGS += -I$(shell pwd)/.. -include ../../Makefile.include diff --git a/apps/tests/tkn154/TestIndirect/coordinator/TestCoordSenderC.nc b/apps/tests/tkn154/TestIndirect/coordinator/TestCoordSenderC.nc deleted file mode 100644 index 381aba9f..00000000 --- a/apps/tests/tkn154/TestIndirect/coordinator/TestCoordSenderC.nc +++ /dev/null @@ -1,149 +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 - * ======================================================================== - */ - -#include "TKN154.h" -#include "app_profile.h" -module TestCoordSenderC -{ - uses { - interface Boot; - interface MCPS_DATA; - interface MLME_RESET; - interface MLME_START; - interface MLME_SET; - interface MLME_GET; - interface Leds; - interface IEEE154Frame as Frame; - interface IEEE154TxBeaconPayload; - interface Packet; - } -} implementation { - - message_t m_frame; - uint8_t m_payloadLen; - - event void Boot.booted() { - char payload[] = "Hello Device!"; - uint8_t *payloadRegion; - ieee154_address_t deviceShortAddress; - - // construct the frame - m_payloadLen = strlen(payload); - payloadRegion = call Packet.getPayload(&m_frame, m_payloadLen); - deviceShortAddress.shortAddress = DEVICE_ADDRESS; // destination - if (m_payloadLen <= call Packet.maxPayloadLength()){ - memcpy(payloadRegion, payload, m_payloadLen); - call Frame.setAddressingFields( - &m_frame, - ADDR_MODE_SHORT_ADDRESS, // SrcAddrMode, - ADDR_MODE_SHORT_ADDRESS, // DstAddrMode, - PAN_ID, // DstPANId, - &deviceShortAddress, // DstAddr, - NULL // security - ); - call MLME_RESET.request(TRUE); - } - } - - event void MLME_RESET.confirm(ieee154_status_t status) - { - if (status != IEEE154_SUCCESS) - return; - call MLME_SET.macShortAddress(COORDINATOR_ADDRESS); - call MLME_SET.macAssociationPermit(FALSE); - call MLME_START.request( - PAN_ID, // PANId - RADIO_CHANNEL, // LogicalChannel - 0, // ChannelPage, - 0, // StartTime, - BEACON_ORDER, // BeaconOrder - SUPERFRAME_ORDER, // SuperframeOrder - TRUE, // PANCoordinator - FALSE, // BatteryLifeExtension - FALSE, // CoordRealignment - 0, // CoordRealignSecurity - 0 // BeaconSecurity - ); - } - - void dataRequest() - { - call MCPS_DATA.request ( - &m_frame, // msdu, - m_payloadLen, // payloadLength, - 0, // msduHandle, - TX_OPTIONS_ACK | TX_OPTIONS_INDIRECT // TxOptions, - ); - } - - event void MLME_START.confirm(ieee154_status_t status) - { - if (status == IEEE154_SUCCESS) - dataRequest(); - } - - event void MCPS_DATA.confirm( - message_t *msg, - uint8_t msduHandle, - ieee154_status_t status, - uint32_t Timestamp - ) - { - if (status == IEEE154_SUCCESS) - call Leds.led1Toggle(); - dataRequest(); - } - - event message_t* MCPS_DATA.indication ( message_t* frame) - { - return frame; - } - - event void IEEE154TxBeaconPayload.aboutToTransmit() { } - - event void IEEE154TxBeaconPayload.setBeaconPayloadDone(void *beaconPayload, uint8_t length) { } - - event void IEEE154TxBeaconPayload.modifyBeaconPayloadDone(uint8_t offset, void *buffer, uint8_t bufferLength) { } - - event void IEEE154TxBeaconPayload.beaconTransmitted() - { - ieee154_macBSN_t beaconSequenceNumber = call MLME_GET.macBSN(); - if (beaconSequenceNumber & 1) - call Leds.led2On(); - else - call Leds.led2Off(); - } - -} diff --git a/apps/tests/tkn154/TestIndirect/coordinator/TestIndirectAppC.nc b/apps/tests/tkn154/TestIndirect/coordinator/TestIndirectAppC.nc deleted file mode 100644 index 2ba70e27..00000000 --- a/apps/tests/tkn154/TestIndirect/coordinator/TestIndirectAppC.nc +++ /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 - * ======================================================================== - */ -configuration TestIndirectAppC -{ -} implementation { - components MainC, LedsC, Ieee802154BeaconEnabledC as MAC; - components TestCoordSenderC as App; - - MainC.Boot <- App; - App.Leds -> LedsC; - App.MLME_RESET -> MAC; - App.MLME_SET -> MAC; - App.MLME_GET -> MAC; - App.MLME_START -> MAC; - App.MCPS_DATA -> MAC; - App.Frame -> MAC; - App.IEEE154TxBeaconPayload -> MAC; - App.Packet -> MAC; - -} diff --git a/apps/tests/tkn154/TestIndirect/device/Makefile b/apps/tests/tkn154/TestIndirect/device/Makefile deleted file mode 100644 index 09b0d212..00000000 --- a/apps/tests/tkn154/TestIndirect/device/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -COMPONENT=TestIndirectAppC -PFLAGS += -DIEEE154_BEACON_TX_DISABLED -CFLAGS += -I$(shell pwd)/.. -include ../../Makefile.include diff --git a/apps/tests/tkn154/TestIndirect/device/TestDeviceReceiverC.nc b/apps/tests/tkn154/TestIndirect/device/TestDeviceReceiverC.nc deleted file mode 100644 index 197a0430..00000000 --- a/apps/tests/tkn154/TestIndirect/device/TestDeviceReceiverC.nc +++ /dev/null @@ -1,169 +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 - * ======================================================================== - */ -#include "TKN154.h" -#include "app_profile.h" -module TestDeviceReceiverC -{ - uses { - interface Boot; - interface MCPS_DATA; - interface MLME_RESET; - interface MLME_SET; - interface MLME_GET; - interface MLME_SCAN; - interface MLME_SYNC; - interface MLME_BEACON_NOTIFY; - interface MLME_SYNC_LOSS; - interface IEEE154BeaconFrame as BeaconFrame; - interface Leds; - } -} implementation { - - ieee154_address_t m_coordAddress; - uint8_t m_coordAddressMode; - ieee154_macPANId_t m_coordPANID; - ieee154_PANDescriptor_t m_PANDescriptor; - bool m_isPANDescriptorValid; - void startApp(); - - event void Boot.booted() { - call MLME_RESET.request(TRUE); - } - - event void MLME_RESET.confirm(ieee154_status_t status) - { - if (status == IEEE154_SUCCESS) - startApp(); - } - - void startApp() - { - ieee154_phyChannelsSupported_t channel; - uint8_t scanDuration = BEACON_ORDER; - - // in this application the coordinator assumes that - // the device has a certain short address - call MLME_SET.macShortAddress(DEVICE_ADDRESS); - channel = ((uint32_t) 1) << RADIO_CHANNEL; - - // we want all received beacons to be signalled - // through the MLME_BEACON_NOTIFY interface, i.e. - // we set the macAutoRequest attribute to FALSE - call MLME_SET.macAutoRequest(FALSE); - call MLME_SCAN.request ( - PASSIVE_SCAN, // ScanType - channel, // ScanChannels - scanDuration, // ScanDuration - 0x00, // ChannelPage - 0, // EnergyDetectListNumEntries - NULL, // EnergyDetectList - 0, // PANDescriptorListNumEntries - NULL, // PANDescriptorList - 0 // security - ); - } - - event message_t* MLME_BEACON_NOTIFY.indication (message_t* frame) - { - // received a beacon frame during SCAN - ieee154_phyCurrentPage_t page = call MLME_GET.phyCurrentPage(); - ieee154_macBSN_t beaconSequenceNumber = call BeaconFrame.getBSN(frame); - - if (beaconSequenceNumber & 1) - call Leds.led2On(); - else - call Leds.led2Off(); - - if (!m_isPANDescriptorValid && call BeaconFrame.parsePANDescriptor( - frame, RADIO_CHANNEL, page, &m_PANDescriptor) == SUCCESS){ - // let's see if the beacon is from our coordinator... - if (m_PANDescriptor.CoordAddrMode == ADDR_MODE_SHORT_ADDRESS && - m_PANDescriptor.CoordPANId == PAN_ID && - m_PANDescriptor.CoordAddress.shortAddress == COORDINATOR_ADDRESS){ - // wait until SCAN is finished, then syncronize to beacons - m_isPANDescriptorValid = TRUE; - } - } - return frame; - } - - event void MLME_SCAN.confirm ( - ieee154_status_t status, - uint8_t ScanType, - uint8_t ChannelPage, - uint32_t UnscannedChannels, - uint8_t EnergyDetectListNumEntries, - int8_t* EnergyDetectList, - uint8_t PANDescriptorListNumEntries, - ieee154_PANDescriptor_t* PANDescriptorList - ) - { - if (m_isPANDescriptorValid){ - // set the macAutoRequest attribute to TRUE, so indirect - // transmissions are automatically carried through - call MLME_SET.macAutoRequest(TRUE); - call MLME_SET.macCoordShortAddress(m_PANDescriptor.CoordAddress.shortAddress); - call MLME_SET.macPANId(m_PANDescriptor.CoordPANId); - call MLME_SYNC.request(m_PANDescriptor.LogicalChannel, m_PANDescriptor.ChannelPage, TRUE); - } else - startApp(); - } - - event void MCPS_DATA.confirm( - message_t *msg, - uint8_t msduHandle, - ieee154_status_t status, - uint32_t Timestamp - ) - { - } - - event void MLME_SYNC_LOSS.indication( - ieee154_status_t lossReason, - uint16_t PANId, - uint8_t LogicalChannel, - uint8_t ChannelPage, - ieee154_security_t *security) - { - call Leds.led1Off(); - startApp(); - } - - event message_t* MCPS_DATA.indication (message_t* frame) - { - call Leds.led1Toggle(); - return frame; - } -} diff --git a/apps/tests/tkn154/TestIndirect/device/TestIndirectAppC.nc b/apps/tests/tkn154/TestIndirect/device/TestIndirectAppC.nc deleted file mode 100644 index f077e5d0..00000000 --- a/apps/tests/tkn154/TestIndirect/device/TestIndirectAppC.nc +++ /dev/null @@ -1,53 +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 - * ======================================================================== - */ - -configuration TestIndirectAppC -{ -} implementation { - components MainC, LedsC, Ieee802154BeaconEnabledC as MAC; - components TestDeviceReceiverC as App; - - MainC.Boot <- App; - App.Leds -> LedsC; - App.MLME_RESET -> MAC; - App.MLME_SET -> MAC; - App.MLME_GET -> MAC; - App.MLME_SCAN -> MAC; - App.MLME_SYNC -> MAC; - App.MLME_BEACON_NOTIFY -> MAC; - App.MLME_SYNC_LOSS -> MAC; - App.MCPS_DATA -> MAC; - App.BeaconFrame -> MAC; -} diff --git a/apps/tests/tkn154/TestPromiscuous/Makefile b/apps/tests/tkn154/TestPromiscuous/Makefile deleted file mode 100644 index 780854a9..00000000 --- a/apps/tests/tkn154/TestPromiscuous/Makefile +++ /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/TestPromiscuous/README.txt b/apps/tests/tkn154/TestPromiscuous/README.txt deleted file mode 100644 index 8f1b1f5b..00000000 --- a/apps/tests/tkn154/TestPromiscuous/README.txt +++ /dev/null @@ -1,33 +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 telosb install - -Start the printf client on - - $ java net.tinyos.tools.PrintfClient -comm serial@/dev/ttyUSBXXX:telosb - -(http://docs.tinyos.net/ has a section on how to use the TinyOS printf library) - -Known bugs/limitations: - -- Currently this application only works on TelosB nodes -- The timestamps for ACKs are incorrect - -$Id$ - diff --git a/apps/tests/tkn154/TestPromiscuous/TestPromiscuousAppC.nc b/apps/tests/tkn154/TestPromiscuous/TestPromiscuousAppC.nc deleted file mode 100644 index c771d29d..00000000 --- a/apps/tests/tkn154/TestPromiscuous/TestPromiscuousAppC.nc +++ /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 - * ======================================================================== - */ - -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/TestPromiscuous/TestPromiscuousC.nc b/apps/tests/tkn154/TestPromiscuous/TestPromiscuousC.nc deleted file mode 100644 index 8ffaa751..00000000 --- a/apps/tests/tkn154/TestPromiscuous/TestPromiscuousC.nc +++ /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 - * ======================================================================== - */ -#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 - * ======================================================================== - */ - -#ifndef __APP_PROFILE_H -#define __APP_PROFILE_H - -enum { - RADIO_CHANNEL = 26, - PAN_ID = 0x7761, - COORDINATOR_ADDRESS = 0x1832, - BEACON_ORDER = 5, - SUPERFRAME_ORDER = 5, -}; - -#endif diff --git a/apps/tests/tkn154/TestStartSync/coordinator/Makefile b/apps/tests/tkn154/TestStartSync/coordinator/Makefile deleted file mode 100644 index af48d993..00000000 --- a/apps/tests/tkn154/TestStartSync/coordinator/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -COMPONENT=TestStartSyncAppC -CFLAGS += -I$(shell pwd)/.. -CFLAGS += -DIEEE154_SCAN_DISABLED -DIEEE154_BEACON_SYNC_DISABLED -include ../../Makefile.include diff --git a/apps/tests/tkn154/TestStartSync/coordinator/TestCoordC.nc b/apps/tests/tkn154/TestStartSync/coordinator/TestCoordC.nc deleted file mode 100644 index e401db6c..00000000 --- a/apps/tests/tkn154/TestStartSync/coordinator/TestCoordC.nc +++ /dev/null @@ -1,100 +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 - * ======================================================================== - */ - -#include "TKN154.h" -#include "app_profile.h" -module TestCoordC -{ - uses { - interface Boot; - interface MLME_RESET; - interface MLME_START; - interface MLME_SET; - interface MLME_GET; - interface Leds; - interface IEEE154TxBeaconPayload; - } -} implementation { - - uint8_t m_beaconPayload[] = {0x01, 0x02, 0x03, 0x04, 0x05}; - - event void Boot.booted() { - call MLME_RESET.request(TRUE); - } - - event void MLME_RESET.confirm(ieee154_status_t status) - { - if (status == IEEE154_SUCCESS){ - call MLME_SET.macShortAddress(COORDINATOR_ADDRESS); - call MLME_SET.macAssociationPermit(FALSE); - call MLME_START.request( - PAN_ID, // PANId - RADIO_CHANNEL, // LogicalChannel - 0, // ChannelPage, - 0, // StartTime, - BEACON_ORDER, // BeaconOrder - SUPERFRAME_ORDER, // SuperframeOrder - TRUE, // PANCoordinator - FALSE, // BatteryLifeExtension - FALSE, // CoordRealignment - 0, // no realignment security - 0 // no beacon security - ); - } - } - - event void MLME_START.confirm(ieee154_status_t status) - { - if (status == IEEE154_SUCCESS){ - call IEEE154TxBeaconPayload.setBeaconPayload(m_beaconPayload, sizeof(m_beaconPayload)); - call Leds.led1On(); - } - } - - event void IEEE154TxBeaconPayload.aboutToTransmit() { } - - event void IEEE154TxBeaconPayload.setBeaconPayloadDone(void *beaconPayload, uint8_t length) { } - - event void IEEE154TxBeaconPayload.modifyBeaconPayloadDone(uint8_t offset, void *buffer, uint8_t bufferLength) { } - - event void IEEE154TxBeaconPayload.beaconTransmitted() - { - ieee154_macBSN_t beaconSequenceNumber = call MLME_GET.macBSN(); - if (beaconSequenceNumber & 1) - call Leds.led2On(); - else - call Leds.led2Off(); - } -} diff --git a/apps/tests/tkn154/TestStartSync/coordinator/TestStartSyncAppC.nc b/apps/tests/tkn154/TestStartSync/coordinator/TestStartSyncAppC.nc deleted file mode 100644 index 6020c4b5..00000000 --- a/apps/tests/tkn154/TestStartSync/coordinator/TestStartSyncAppC.nc +++ /dev/null @@ -1,50 +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 - * ======================================================================== - */ - -configuration TestStartSyncAppC -{ -} implementation { - - components MainC, LedsC, Ieee802154BeaconEnabledC as MAC; - components TestCoordC as App; - - MainC.Boot <- App; - App.MLME_START -> MAC; - App.IEEE154TxBeaconPayload -> MAC; - App.Leds -> LedsC; - App.MLME_RESET -> MAC; - App.MLME_SET -> MAC; - App.MLME_GET -> MAC; -} diff --git a/apps/tests/tkn154/TestStartSync/device/Makefile b/apps/tests/tkn154/TestStartSync/device/Makefile deleted file mode 100644 index 1f9448f4..00000000 --- a/apps/tests/tkn154/TestStartSync/device/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -COMPONENT=TestStartSyncAppC -PFLAGS += -DIEEE154_BEACON_TX_DISABLED -CFLAGS += -I$(shell pwd)/.. -include ../../Makefile.include diff --git a/apps/tests/tkn154/TestStartSync/device/TestDeviceC.nc b/apps/tests/tkn154/TestStartSync/device/TestDeviceC.nc deleted file mode 100644 index c11193a2..00000000 --- a/apps/tests/tkn154/TestStartSync/device/TestDeviceC.nc +++ /dev/null @@ -1,160 +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 - * ======================================================================== - */ - -#include "TKN154.h" -#include "app_profile.h" -module TestDeviceC -{ - uses { - interface Boot; - interface MLME_RESET; - interface MLME_SET; - interface MLME_GET; - interface MLME_SCAN; - interface MLME_SYNC; - interface MLME_BEACON_NOTIFY; - interface MLME_SYNC_LOSS; - interface Leds; - interface IEEE154BeaconFrame as BeaconFrame; - } -} implementation { - - enum { - NUM_PAN_DESCRIPTORS = 10, - }; - ieee154_PANDescriptor_t m_PANDescriptor[NUM_PAN_DESCRIPTORS]; - void startApp(); - - event void Boot.booted() { - call MLME_RESET.request(TRUE); - } - - event void MLME_RESET.confirm(ieee154_status_t status) - { - if (status == IEEE154_SUCCESS) - startApp(); - } - - void startApp() - { - ieee154_phyChannelsSupported_t scanChannels; - uint8_t scanDuration = BEACON_ORDER; - - // set the short address to whatever was passed - // as a parameter to make system ("make install,X") - call MLME_SET.macShortAddress(TOS_NODE_ID); - scanChannels = call MLME_GET.phyChannelsSupported(); - //scanChannels = (uint32_t) 1 << RADIO_CHANNEL; - - // setting the macAutoRequest attribute to TRUE means - // that during the scan beacons will not be signalled - // through MLME_BEACON_NOTIFY - call MLME_SET.macAutoRequest(TRUE); - call MLME_SCAN.request ( - PASSIVE_SCAN, // ScanType - scanChannels, // ScanChannels - scanDuration, // ScanDuration - 0x00, // ChannelPage - 0, // EnergyDetectListNumEntries - NULL, // EnergyDetectList - NUM_PAN_DESCRIPTORS, // PANDescriptorListNumEntries - m_PANDescriptor, // PANDescriptorList - 0 // security - ); - } - - event void MLME_SCAN.confirm ( - ieee154_status_t status, - uint8_t ScanType, - uint8_t ChannelPage, - uint32_t UnscannedChannels, - uint8_t EnergyDetectListNumEntries, - int8_t* EnergyDetectList, - uint8_t PANDescriptorListNumEntries, - ieee154_PANDescriptor_t* PANDescriptorList - ) - { - uint8_t i; - switch (status){ - case IEEE154_NO_BEACON: - startApp(); - break; - case IEEE154_SUCCESS: - if (PANDescriptorListNumEntries > 0){ - for (i=0; i - * ======================================================================== - */ - -configuration TestStartSyncAppC -{ -} implementation { - - components MainC, LedsC, Ieee802154BeaconEnabledC as MAC; - components TestDeviceC as App; - - App.MLME_SCAN -> MAC; - App.MLME_SYNC -> MAC; - App.MLME_BEACON_NOTIFY -> MAC; - App.MLME_SYNC_LOSS -> MAC; - App.BeaconFrame -> MAC; - - MainC.Boot <- App; - App.Leds -> LedsC; - App.MLME_RESET -> MAC; - App.MLME_SET -> MAC; - App.MLME_GET -> MAC; - -#ifdef PRINTF_ENABLED - components PrintfC; - App.PrintfControl -> PrintfC; - App.PrintfFlush -> PrintfC; -#endif -} diff --git a/apps/tests/tkn154/makeall.sh b/apps/tests/tkn154/makeall.sh new file mode 100755 index 00000000..a7e92614 --- /dev/null +++ b/apps/tests/tkn154/makeall.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# compile/clean all test applications +PLATFORM=$1 +OPTIONS= +STARTDIR=`pwd` +MAKEFILES=`find . -name Makefile` + +if [ $# == 0 ]; +then + echo "Usage: $0 " + exit +fi + +for m in $MAKEFILES +do + cd ${m%Makefile} + if [ "x$1" == xclean ]; + then + make clean + else + make $PLATFORM $OPTIONS; + fi + cd $STARTDIR +done +exit + -- 2.39.2