[Firebug-cvs] firebug/project/src/multihop BaseStation.nc,1.5,1.6 BaseStationM.nc,1.7,1.8 CollectDat
Brought to you by:
doolin
From: <che...@us...> - 2003-07-02 00:47:55
|
Update of /cvsroot/firebug/firebug/project/src/multihop In directory sc8-pr-cvs1:/tmp/cvs-serv30991/src/multihop Modified Files: BaseStation.nc BaseStationM.nc CollectDataFB.nc CollectDataMFB.nc Makefile Log Message: change code for Blast-Mica2 Index: BaseStation.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/multihop/BaseStation.nc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BaseStation.nc 25 Apr 2003 01:10:14 -0000 1.5 --- BaseStation.nc 2 Jul 2003 00:47:50 -0000 1.6 *************** *** 7,15 **** --- 7,29 ---- /*////////////////////////////////////////////////////////*/ + includes RoutingStack; configuration BaseStation { } + implementation { + components Main, BaseStationM, MHSender, TimerWrapper, LedsC, VirtualComm, ParentSelection; + Main.StdControl -> BaseStationM.StdControl; + //BaseStationM.MultiHopSend -> MHSender.MultiHopSend[MH_STATISTIC_TYPE]; + //ParentSelection.InForwardReceive -> VirtualComm.ReceiveMsg[MH_STATISTIC_TYPE]; + BaseStationM.MultiHopSend -> MHSender.MultiHopSend[RS_DATA_TYPE]; + ParentSelection.InForwardReceive -> VirtualComm.ReceiveMsg[RS_DATA_TYPE]; + BaseStationM.Timer -> TimerWrapper.Timer[unique("Timer")]; + BaseStationM.Leds -> LedsC; + Main.StdControl -> MHSender.StdControl; + //BaseStationM.Random -> RandomLFSR; + } + /* implementation { components Main, BaseStationM, MHDispatcher, TimerWrapper, LedsC, BcastCommand; *************** *** 21,22 **** --- 35,37 ---- //BaseStationM.ReceiveMsg -> CrcFilter.UpperReceive; } + */ Index: BaseStationM.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/multihop/BaseStationM.nc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** BaseStationM.nc 22 May 2003 22:39:51 -0000 1.7 --- BaseStationM.nc 2 Jul 2003 00:47:50 -0000 1.8 *************** *** 14,18 **** ! includes RoutingStackShared; module BaseStationM { --- 14,19 ---- ! //includes RoutingStackShared; ! includes RoutingStack; module BaseStationM { *************** *** 21,32 **** } uses { ! interface MultiHopSend as MultiHopSend; interface Timer as Timer; interface Leds; ! interface HandleBcast; //interface ReceiveMsg; } } implementation { --- 22,35 ---- } uses { ! interface Send as MultiHopSend; interface Timer as Timer; interface Leds; ! //interface HandleBcast; //interface ReceiveMsg; + //interface Random; } } + #define DATA_FREQ 3000 implementation { *************** *** 69,75 **** // struct DataFormat_t *dataPortion; uint8_t *dataPortion; struct DataFormat_t *df; if (sending == 1) return SUCCESS; ! dataPortion = call MultiHopSend.getUsablePortion(msgToSend.data); df = (struct DataFormat_t *) dataPortion; df->addr = TOS_LOCAL_ADDRESS; --- 72,80 ---- // struct DataFormat_t *dataPortion; uint8_t *dataPortion; + uint16_t availableLength = 0; + struct DataFormat_t *df; if (sending == 1) return SUCCESS; ! dataPortion = call MultiHopSend.getBuffer(&msgToSend, &availableLength); df = (struct DataFormat_t *) dataPortion; df->addr = TOS_LOCAL_ADDRESS; *************** *** 92,98 **** * @return: void */ ! event void MultiHopSend.sendDone(TOS_MsgPtr msg, uint8_t success) { ! sending = 0; } --- 97,103 ---- * @return: void */ ! event result_t MultiHopSend.sendDone(TOS_MsgPtr msg, uint8_t success) { sending = 0; + return SUCCESS; } *************** *** 123,130 **** * @return: void */ ! event void HandleBcast.execute(TOS_MsgPtr msg) { // uint8_t *cmdmsg = call HandleBcast.extractData(msg); // do whatever we want to this message } } --- 128,136 ---- * @return: void */ ! /* event void HandleBcast.execute(TOS_MsgPtr msg) { // uint8_t *cmdmsg = call HandleBcast.extractData(msg); // do whatever we want to this message } + */ } Index: CollectDataFB.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/multihop/CollectDataFB.nc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CollectDataFB.nc 23 May 2003 14:58:27 -0000 1.3 --- CollectDataFB.nc 2 Jul 2003 00:47:50 -0000 1.4 *************** *** 6,17 **** */ - includes RoutingStackShared; configuration CollectDataFB { } - implementation { --- 6,34 ---- */ + includes RoutingStack; + configuration CollectDataFB { + + } + implementation { + components Main, CollectDataMFB, MHSender, TimerWrapper, LedsC, VirtualComm, ParentSelection; + Main.StdControl -> CollectDataMFB.StdControl; + //CollectDataMFB.MultiHopSend -> MHSender.MultiHopSend[MH_STATISTIC_TYPE]; + //ParentSelection.InForwardReceive -> VirtualComm.ReceiveMsg[MH_STATISTIC_TYPE]; + CollectDataMFB.MultiHopSend -> MHSender.MultiHopSend[RS_DATA_TYPE]; + ParentSelection.InForwardReceive -> VirtualComm.ReceiveMsg[RS_DATA_TYPE]; + CollectDataMFB.Timer -> TimerWrapper.Timer[unique("Timer")]; + CollectDataMFB.Leds -> LedsC; + Main.StdControl -> MHSender.StdControl; + //CollectDataMFB.Random -> RandomLFSR; + } + + /* + includes RoutingStackShared; configuration CollectDataFB { } implementation { *************** *** 23,29 **** BcastCommand, RandomLFSR; ! ! ! Main.StdControl -> CollectDataMFB.StdControl; --- 40,44 ---- BcastCommand, RandomLFSR; ! Main.StdControl -> CollectDataMFB.StdControl; *************** *** 35,36 **** --- 50,52 ---- } + */ Index: CollectDataMFB.nc =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/multihop/CollectDataMFB.nc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CollectDataMFB.nc 27 Jun 2003 19:17:20 -0000 1.7 --- CollectDataMFB.nc 2 Jul 2003 00:47:50 -0000 1.8 *************** *** 16,27 **** */ ! includes RoutingStackShared; ! includes Routing; ! /** max int is 2^16 for the lfsr random * number generation scheme used in tinyos. */ ! //#define FB_RAND_MAX 256*256 module CollectDataMFB { --- 16,27 ---- */ ! //includes RoutingStackShared; ! //includes Routing; ! includes RoutingStack; /** max int is 2^16 for the lfsr random * number generation scheme used in tinyos. */ ! #define FB_RAND_MAX 256*256 module CollectDataMFB { *************** *** 34,46 **** uses { ! interface MultiHopSend as MultiHopSend; interface Timer as Timer; interface Leds; ! interface HandleBcast; ! interface Random; } } implementation { --- 34,47 ---- uses { ! interface Send as MultiHopSend; interface Timer as Timer; interface Leds; ! //interface HandleBcast; ! //interface Random; } } + #define DATA_FREQ 3000 implementation { *************** *** 100,104 **** //#endif */ - return 72.1; } --- 101,104 ---- *************** *** 125,128 **** --- 125,129 ---- //uint8_t result; uint8_t *dataPortion; + uint16_t availableLength = 0; struct DataFormat_t *df; *************** *** 132,136 **** } ! dataPortion = call MultiHopSend.getUsablePortion(msgToSend.data); df = (struct DataFormat_t *) dataPortion; df->addr = TOS_LOCAL_ADDRESS; --- 133,137 ---- } ! dataPortion = call MultiHopSend.getBuffer(&msgToSend, &availableLength); df = (struct DataFormat_t *) dataPortion; df->addr = TOS_LOCAL_ADDRESS; *************** *** 144,150 **** df->baro_pres = get_baro_pres(); ! sending = 1; ! call MultiHopSend.send(&msgToSend, sizeof(struct DataFormat_t)); ! //call Leds.greenToggle(); return SUCCESS; } --- 145,150 ---- df->baro_pres = get_baro_pres(); ! sending = call MultiHopSend.send(&msgToSend, sizeof(struct DataFormat_t)); ! call Leds.greenToggle(); return SUCCESS; } *************** *** 160,170 **** */ ! event void MultiHopSend.sendDone(TOS_MsgPtr msg, uint8_t success) { sending = 0; ! } ! ! event void HandleBcast.execute(TOS_MsgPtr msg) { ! // uint8_t *cmdmsg = call HandleBcast.extractData(msg); ! // do whatever we want to this message } --- 160,166 ---- */ ! event result_t MultiHopSend.sendDone(TOS_MsgPtr msg, uint8_t success) { sending = 0; ! return SUCCESS; } Index: Makefile =================================================================== RCS file: /cvsroot/firebug/firebug/project/src/multihop/Makefile,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Makefile 2 Jul 2003 00:19:22 -0000 1.12 --- Makefile 2 Jul 2003 00:47:50 -0000 1.13 *************** *** 12,20 **** UISP = uisp UISP_FLAGS = -dprog=dapa $(UISP_EXTRA_FLAGS) ! TOSROOT=/cygdrive/c/tinyos-1.x PLATFORMS= mica mica2 pc ! DATASTRUCTURE=$(TOSROOT)/broken/experimental/terence/tos/lib/DataStructure ! ROUTESTACK=$(TOSROOT)/broken/experimental/terence/apps/mh6 ! INCLUDES=-I$(DATASTRUCTURE) -I$(ROUTESTACK) PFLAGS := $(PFLAGS) -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x7d --- 12,23 ---- UISP = uisp UISP_FLAGS = -dprog=dapa $(UISP_EXTRA_FLAGS) ! TOSROOT=/cygdrive/c PLATFORMS= mica mica2 pc ! #DATASTRUCTURE=$(TOSROOT)/broken/experimental/terence/tos/lib/DataStructure ! #ROUTESTACK=$(TOSROOT)/broken/experimental/terence/apps/mh6 ! #INCLUDES=-I$(DATASTRUCTURE) -I$(ROUTESTACK) ! ! INCLUDES=-I$(TOSROOT)/Blast-0.1/Sender -I$(TOSROOT)/Blast-0.1/Interface -I$(TOSROOT)/Blast-0.1/DataStructure -I$(TOSROOT)/Blast-0.1/VirtualComm -I$(TOSROOT)/Blast-0.1/ParentSelection -I$(TOSROOT)/tinyos-1.x/tos ! PFLAGS := $(PFLAGS) -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x7d |