[Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/TestDissemination
TestDisseminationAppC.nc, 1.4, 1.5 TestDisseminationC.nc, 1.4, 1.5
Gilman Tolle
gtolle at users.sourceforge.net
Fri Apr 13 17:34:24 PDT 2007
- Previous message: [Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/telosb/TestUserButton
Makefile, NONE, 1.1 TestUserButtonAppC.nc, NONE,
1.1 TestUserButtonC.nc, NONE, 1.1
- Next message: [Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/TestNetwork
TestNetworkAppC.nc, 1.4, 1.5 TestNetworkC.nc, 1.4, 1.5
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/tinyos/tinyos-2.x/apps/tests/TestDissemination
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv32160/TestDissemination
Modified Files:
TestDisseminationAppC.nc TestDisseminationC.nc
Log Message:
Updated TestDissemination and TestNetwork to start the dissemination service manually. I've tried TestDissemination, but haven't tried TestNetwork. Let me know if you experience any problems.
Index: TestDisseminationAppC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestDissemination/TestDisseminationAppC.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TestDisseminationAppC.nc 12 Dec 2006 18:22:50 -0000 1.4
--- TestDisseminationAppC.nc 14 Apr 2007 00:34:20 -0000 1.5
***************
*** 53,56 ****
--- 53,66 ----
TestDisseminationC.Boot -> MainC;
+ components ActiveMessageC;
+ TestDisseminationC.RadioControl -> ActiveMessageC;
+
+ components DisseminationC;
+ TestDisseminationC.DisseminationControl -> DisseminationC;
+
+ components UserButtonC;
+ TestDisseminationC.Get -> UserButtonC;
+ TestDisseminationC.Notify -> UserButtonC;
+
components new DisseminatorC(uint32_t, 0x1234) as Object32C;
TestDisseminationC.Value32 -> Object32C;
Index: TestDisseminationC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/apps/tests/TestDissemination/TestDisseminationC.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TestDisseminationC.nc 12 Dec 2006 18:22:50 -0000 1.4
--- TestDisseminationC.nc 14 Apr 2007 00:34:20 -0000 1.5
***************
*** 1,3 ****
--- 1,4 ----
#include <Timer.h>
+ #include <UserButton.h>
/*
***************
*** 51,54 ****
--- 52,62 ----
uses interface Boot;
+ uses interface SplitControl as RadioControl;
+
+ uses interface StdControl as DisseminationControl;
+
+ uses interface Get<button_state_t>;
+ uses interface Notify<button_state_t>;
+
uses interface DisseminationValue<uint32_t> as Value32;
uses interface DisseminationUpdate<uint32_t> as Update32;
***************
*** 63,79 ****
implementation {
event void Boot.booted() {
! if ( TOS_NODE_ID % 4 == 1 ) {
! call Timer.startPeriodic(20000);
}
}
event void Timer.fired() {
uint32_t newVal32 = 0xDEADBEEF;
uint16_t newVal16 = 0xABCD;
! call Leds.led0Toggle();
! call Leds.led1Toggle();
! call Update32.change( &newVal32 );
! call Update16.change( &newVal16 );
! dbg("TestDisseminationC", "TestDisseminationC: Timer fired.\n");
}
--- 71,119 ----
implementation {
event void Boot.booted() {
! uint32_t initialVal32 = 123456;
! uint16_t initialVal16 = 1234;
!
! call Value32.set( &initialVal32 );
! call Value16.set( &initialVal16 );
!
! call RadioControl.start();
! }
!
! event void RadioControl.startDone( error_t result ) {
!
! if ( result != SUCCESS ) {
!
! call RadioControl.start();
!
! } else {
!
! call DisseminationControl.start();
!
! if ( TOS_NODE_ID % 4 == 1 ) {
! call Timer.startPeriodic( 1024 * 20 );
! } else {
! call Timer.startPeriodic( 1024 );
! }
}
}
+ event void RadioControl.stopDone( error_t result ) { }
+
event void Timer.fired() {
uint32_t newVal32 = 0xDEADBEEF;
uint16_t newVal16 = 0xABCD;
!
! if ( TOS_NODE_ID % 4 == 1 ) {
! call Leds.led0Toggle();
! call Leds.led1Toggle();
! call Update32.change( &newVal32 );
! call Update16.change( &newVal16 );
! dbg("TestDisseminationC", "TestDisseminationC: Timer fired.\n");
! } else {
! const uint32_t* newVal = call Value32.get();
! if ( *newVal == 123456 ) {
! call Leds.led2Toggle();
! }
! }
}
- Previous message: [Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/telosb/TestUserButton
Makefile, NONE, 1.1 TestUserButtonAppC.nc, NONE,
1.1 TestUserButtonC.nc, NONE, 1.1
- Next message: [Tinyos-2-commits] CVS: tinyos-2.x/apps/tests/TestNetwork
TestNetworkAppC.nc, 1.4, 1.5 TestNetworkC.nc, 1.4, 1.5
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-2-commits
mailing list