[Tinyos-2-commits]
CVS: tinyos-2.x-contrib/tunit/tests/tinyos-2.x/tos/chips/cc2420/TestTxThroughputWithHwAcks
Makefile, NONE, 1.1 TestTunitC.nc, NONE, 1.1 TestTunitP.nc,
NONE, 1.1 suite.properties, NONE, 1.1
David Moss
mossmoss at users.sourceforge.net
Sat Jul 21 22:32:02 PDT 2007
- Previous message: [Tinyos-2-commits]
CVS: tinyos-2.x-contrib/tunit/tests/tinyos-2.x/tos/chips/cc2420/TestTxThroughputNoCca
Makefile, NONE, 1.1 TestTunitC.nc, NONE, 1.1 TestTunitP.nc,
NONE, 1.1 suite.properties, NONE, 1.1
- Next message: [Tinyos-2-commits]
CVS: tinyos-2.x-contrib/tunit/tests/tinyos-2.x/tos/chips/cc2420/TestTxThroughputWithNoAcks
Makefile, NONE, 1.1 TestTunitC.nc, NONE, 1.1 TestTunitP.nc,
NONE, 1.1 suite.properties, NONE, 1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/tinyos/tinyos-2.x-contrib/tunit/tests/tinyos-2.x/tos/chips/cc2420/TestTxThroughputWithHwAcks
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19699/TestTxThroughputWithHwAcks
Added Files:
Makefile TestTunitC.nc TestTunitP.nc suite.properties
Log Message:
Moved from a flat directory structure to a project-oriented directory structure
--- NEW FILE: Makefile ---
COMPONENT=TestTunitC
CFLAGS += -DCC2420_HW_ACKNOWLEDGEMENTS
include $(MAKERULES)
--- NEW FILE: TestTunitC.nc ---
/*
* Copyright (c) 2005-2006 Rincon Research Corporation
* 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 Rincon Research Corporation 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
* RINCON RESEARCH OR ITS 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
*/
/**
* @author David Moss
*/
configuration TestTunitC {
}
implementation {
components TestTunitP,
new TestCaseC() as TestThroughputC,
new StatisticsC() as ThroughputStatsC,
ActiveMessageC,
new AMSenderC(4),
new AMReceiverC(4),
new TimerMilliC(),
new StateC(),
LedsC;
TestTunitP.SetUpOneTime -> TestThroughputC.SetUpOneTime;
TestTunitP.TestThroughput -> TestThroughputC;
TestTunitP.SplitControl -> ActiveMessageC;
TestTunitP.AMSend -> AMSenderC;
TestTunitP.Receive -> AMReceiverC;
TestTunitP.Leds -> LedsC;
TestTunitP.PacketAcknowledgements -> ActiveMessageC;
TestTunitP.Statistics -> ThroughputStatsC;
TestTunitP.RunState -> StateC;
TestTunitP.Timer -> TimerMilliC;
TestTunitP.TearDownOneTime -> TestThroughputC.TearDownOneTime;
}
--- NEW FILE: TestTunitP.nc ---
/*
* Copyright (c) 2005-2006 Rincon Research Corporation
* 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 Rincon Research Corporation 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
* RINCON RESEARCH OR ITS 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
*/
/**
* @author David Moss
*/
#include "TestCase.h"
module TestTunitP {
uses {
interface TestControl as SetUpOneTime;
interface TestCase as TestThroughput;
interface TestControl as TearDownOneTime;
interface SplitControl;
interface AMSend;
interface Receive;
interface Leds;
interface PacketAcknowledgements;
interface Statistics;
interface Timer<TMilli>;
interface State as RunState;
}
}
implementation {
/** Message to send */
message_t myMsg;
/** Number of messages sent */
uint32_t sent;
/**
* Minimum number of packets we should be seeing per second
*/
enum {
LOWER_BOUNDS = 6640, // 119+ packets per second
TEST_DURATION = 61440, // 1 min
};
enum {
S_IDLE,
S_RUNNING,
};
/***************** Prototypes ****************/
task void sendMsg();
/***************** SetUpOneTime Events ****************/
event void SetUpOneTime.run() {
call SplitControl.start();
call PacketAcknowledgements.requestAck(&myMsg);
}
/***************** TearDownOneTime Events ****************/
event void TearDownOneTime.run() {
call SplitControl.stop();
}
/***************** SplitControl Events ****************/
event void SplitControl.startDone(error_t error) {
call SetUpOneTime.done();
}
event void SplitControl.stopDone(error_t error) {
call TearDownOneTime.done();
}
/***************** TestThroughput Events ****************/
event void TestThroughput.run() {
sent = 0;
call RunState.forceState(S_RUNNING);
call Timer.startOneShot(TEST_DURATION);
post sendMsg();
}
/***************** Timer Events ****************/
event void Timer.fired() {
call RunState.toIdle();
call Statistics.log("[packets/sec]", (uint32_t) ((float) sent / (float) 60));
assertResultIsAbove("Throughput is too low", LOWER_BOUNDS, sent);
call TestThroughput.done();
}
/***************** AMSend Events ****************/
event void AMSend.sendDone(message_t *msg, error_t error) {
sent++;
if(!call RunState.isIdle()) {
post sendMsg();
}
}
event message_t *Receive.receive(message_t *msg, void *payload, error_t error) {
call Leds.led1Toggle();
return msg;
}
/***************** Statistics Events *****************/
event void Statistics.logDone() {
}
/***************** Tasks *****************/
task void sendMsg() {
call Leds.led0Toggle();
if(call AMSend.send(1, &myMsg, 0) != SUCCESS) {
post sendMsg();
}
}
}
--- NEW FILE: suite.properties ---
/**
* Valid keywords are:
* @author <optional author(s)> (multiple)
* @testname <optional testname> (once)
* @description <optional, multiline description> (once)
* @extra <any build/install extras> (multiple)
* @ignore <single target> (multiple)
* @only <single target> (multiple)
* @minnodes <# nodes> (once)
* @maxnodes <# nodes> (once)
* @exactnodes <# of exact nodes> (once)
* @mintargets <# of minimum targets for heterogeneous network testing> (once)
* @timeout <timeout duration of the test in minutes, default is 1 min.>
* @skip (once)
*/
@testname Test Transmitter Throughput
@author David Moss
@description Tests the transmission throughput with hardware acknowledgements
over a period of 2 minutes.
@exactnodes 2
@timeout 2
@ignore mica2
@ignore mica2dot
- Previous message: [Tinyos-2-commits]
CVS: tinyos-2.x-contrib/tunit/tests/tinyos-2.x/tos/chips/cc2420/TestTxThroughputNoCca
Makefile, NONE, 1.1 TestTunitC.nc, NONE, 1.1 TestTunitP.nc,
NONE, 1.1 suite.properties, NONE, 1.1
- Next message: [Tinyos-2-commits]
CVS: tinyos-2.x-contrib/tunit/tests/tinyos-2.x/tos/chips/cc2420/TestTxThroughputWithNoAcks
Makefile, NONE, 1.1 TestTunitC.nc, NONE, 1.1 TestTunitP.nc,
NONE, 1.1 suite.properties, NONE, 1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-2-commits
mailing list