[Tinyos-2-commits]
CVS: tinyos-2.x-contrib/tunit/tests/tinyos-2.x/tos/chips/cc2420/TestInUseTxDutyCycle
Makefile, NONE, 1.1 TestRadioC.nc, NONE, 1.1 TestRadioP.nc,
NONE, 1.1 suite.properties, NONE, 1.1
David Moss
mossmoss at users.sourceforge.net
Sat Jul 21 22:31:48 PDT 2007
- Previous message: [Tinyos-2-commits]
CVS: tinyos-2.x-contrib/tunit/tests/tinyos-2.x/tos/chips/cc2420/TestInUseRxDutyCycle
Makefile, NONE, 1.1 TestRadioC.nc, NONE, 1.1 TestRadioP.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/TestIndirectActiveByteIndicator
Makefile, NONE, 1.1 TestRadioC.nc, NONE, 1.1 TestRadioP.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/TestInUseTxDutyCycle
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19699/TestInUseTxDutyCycle
Added Files:
Makefile TestRadioC.nc TestRadioP.nc suite.properties
Log Message:
Moved from a flat directory structure to a project-oriented directory structure
--- NEW FILE: Makefile ---
COMPONENT=TestRadioC
include $(MAKERULES)
--- NEW FILE: TestRadioC.nc ---
#include "TestCase.h"
/**
* @author David Moss
*/
configuration TestRadioC {
}
implementation {
components
new TestCaseC() as TestInUseDutyCycleC;
components TestRadioP,
ActiveMessageC,
new AMSenderC(4),
new AMReceiverC(4),
new TimerMilliC(),
new StateC(),
LedsC;
TestRadioP.SetUp -> TestInUseDutyCycleC.SetUp;
TestRadioP.TestInUseDutyCycle -> TestInUseDutyCycleC;
TestRadioP.SplitControl -> ActiveMessageC;
TestRadioP.AMSend -> AMSenderC;
TestRadioP.Receive -> AMReceiverC;
TestRadioP.PacketAcknowledgements -> ActiveMessageC;
TestRadioP.Timer -> TimerMilliC;
TestRadioP.State -> StateC;
TestRadioP.Leds -> LedsC;
}
--- NEW FILE: TestRadioP.nc ---
#include "TestCase.h"
/**
* @author David Moss
*/
module TestRadioP {
uses {
interface TestControl as SetUp;
interface TestCase as TestInUseDutyCycle;
interface SplitControl;
interface AMSend;
interface Receive;
interface PacketAcknowledgements;
interface Timer<TMilli>;
interface State;
interface Leds;
}
}
implementation {
uint16_t myIndex;
message_t myMsg;
/** TRUE if the radio is on */
bool on;
enum {
S_IDLE,
S_TESTINUSEDUTYCYCLE,
};
enum {
RADIO_POWER_CYCLES = 100,
};
/***************** Prototypes ****************/
task void sendMsg();
/***************** SetUp Events ****************/
event void SetUp.run() {
call PacketAcknowledgements.requestAck(&myMsg);
call SetUp.done();
}
/***************** Tests ****************/
/**
* Make sure the radio doesn't lock up if we continuously send messages
* and duty cycle it at the same time
*/
event void TestInUseDutyCycle.run() {
call State.forceState(S_TESTINUSEDUTYCYCLE);
call Timer.startPeriodic(128);
post sendMsg();
}
/***************** SplitControl Events ****************/
event void SplitControl.startDone(error_t error) {
call Leds.led2On();
on = TRUE;
}
event void SplitControl.stopDone(error_t error) {
call Leds.led2Off();
on = FALSE;
}
/***************** AMSend Events ****************/
event void AMSend.sendDone(message_t *msg, error_t error) {
call Leds.led1Toggle();
call Leds.led0Off();
if(call State.isState(S_TESTINUSEDUTYCYCLE)) {
post sendMsg();
}
}
/***************** Receive Events ****************/
event message_t *Receive.receive(message_t *msg, void *payload, uint8_t len) {
return msg;
}
/***************** Timer Events ****************/
event void Timer.fired() {
if(on) {
call SplitControl.stop();
} else {
if(call State.isState(S_TESTINUSEDUTYCYCLE)) {
myIndex++;
if(myIndex > RADIO_POWER_CYCLES) {
call Timer.stop();
call State.toIdle();
assertSuccess();
call TestInUseDutyCycle.done();
}
}
call SplitControl.start();
}
}
/***************** Tasks ****************/
task void sendMsg() {
// Send to a node that probably isn't in our network to increase the
// amount of time spent in transmit. Request acks too.
if(call AMSend.send(100, &myMsg, TOSH_DATA_LENGTH) != SUCCESS) {
call Leds.led1Off();
call Leds.led0Toggle();
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 Radio Duty Cycling Transmission
@author David Moss
@description Verify we can constantly transmit while our radio is duty cycling
@exactnodes 1
@ignore mica2
@ignore mica2dot
- Previous message: [Tinyos-2-commits]
CVS: tinyos-2.x-contrib/tunit/tests/tinyos-2.x/tos/chips/cc2420/TestInUseRxDutyCycle
Makefile, NONE, 1.1 TestRadioC.nc, NONE, 1.1 TestRadioP.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/TestIndirectActiveByteIndicator
Makefile, NONE, 1.1 TestRadioC.nc, NONE, 1.1 TestRadioP.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