[Firebug-cvs] fireboard/beta/fireworks/apps/Fireworks Fireworks.h,1.4,1.5 FireworksM.nc,1.3,1.4 Make
Brought to you by:
doolin
From: Karthik D. <da...@us...> - 2005-07-26 01:15:54
|
Update of /cvsroot/firebug/fireboard/beta/fireworks/apps/Fireworks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22589 Modified Files: Fireworks.h FireworksM.nc Makefile TODO Log Message: More modifications Index: Makefile =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/fireworks/apps/Fireworks/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 25 Jul 2005 22:08:16 -0000 1.2 --- Makefile 26 Jul 2005 01:15:45 -0000 1.3 *************** *** 3,7 **** PFLAGS +=-DDELUGE_LEDS PFLAGS += -I%T/lib/Deluge -I%T/interfaces -I%T/tos/lib/Commands -I%T/platform/mica2 ! include ../Makerules PLATFORMS = mica2 mica2dot telos telosb telosa --- 3,7 ---- PFLAGS +=-DDELUGE_LEDS PFLAGS += -I%T/lib/Deluge -I%T/interfaces -I%T/tos/lib/Commands -I%T/platform/mica2 ! include $(TOSROOT)/apps/Makerules PLATFORMS = mica2 mica2dot telos telosb telosa Index: Fireworks.h =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/fireworks/apps/Fireworks/Fireworks.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Fireworks.h 25 Jul 2005 22:19:40 -0000 1.4 --- Fireworks.h 26 Jul 2005 01:15:45 -0000 1.5 *************** *** 3,6 **** --- 3,8 ---- * Graduate Student * Firebug Project + * http://firebug.sf.net + * * Date: 7/20/2005 * *************** *** 24,39 **** */ enum { ! CLEAR = 0x0, \\ Begin application ! RCV_DR_MSG = 0x1, \\Received DataRequestMsg ! SND_P_MSG = 0x2, \\ Sent Ping Msg ! RCV_PR_MSG = 0x3, \\ Received PingReplyMsg ! RCV_P_MSG = 0x4, \\ Received Ping Msg ! SND_PR_MSG = 0x5, \\ Sent PingReplyMsg ! SND_D_MSG = 0x6, \\ Sent DataMsg ! ERROR = 0x7 \\ Error }; struct DataRequestMsg { ! uint16_t seqNo; uint16_t source; uint16_t numNodes; --- 26,41 ---- */ enum { ! CLEAR = 0x0, // Begin application ! RCV_DR_MSG = 0x1, // Received DataRequestMsg ! SND_P_MSG = 0x2, // Sent Ping Msg ! RCV_PR_MSG = 0x3, // Received PingReplyMsg ! RCV_P_MSG = 0x4, // Received Ping Msg ! SND_PR_MSG = 0x5, // Sent PingReplyMsg ! SND_D_MSG = 0x6, // Sent DataMsg ! ERROR = 0x7 // Error }; struct DataRequestMsg { ! uint16_t seqno; uint16_t source; uint16_t numNodes; *************** *** 45,54 **** typedef struct DataRequestMsg DataRequestMsg; struct DataMsg { ! uint16_t seqNo; ! uint16_t source; ! uint16_t numNodes; ! uint16_t numPowerLevels; ! uint16_t trialFrequency; } ; --- 47,61 ---- typedef struct DataRequestMsg DataRequestMsg; + /* The data msg is complicated since it goes over one packet. + The first packet is the header. It has all the above + information from the DataRequestMsg. The following packets + have just a sequence number and 16-bit RSSI values. It is + upto the client to figure out that there will be 'numTrials' + number of RSSI values for each destination and 'numNodes' + destinations */ + struct DataMsg { ! uint8_t seqno; ! uint16_t data[14]; } ; Index: TODO =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/fireworks/apps/Fireworks/TODO,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TODO 25 Jul 2005 22:08:16 -0000 1.1 --- TODO 26 Jul 2005 01:15:45 -0000 1.2 *************** *** 1,3 **** ! - Implement ReceiveDataMsg.receive ! - Write README.txt --- 1,20 ---- ! SHORT TERM ! - Send data to client ! - Handle tFrequency - as of now, we do things at our own pace ! Ideally, we want two timers - one for timeouts and other for ! sending packets at a certain frequency ! - Handle power levels - as of now, we do everything at max power ! - Max number of trials that can be performed is 100. This is ! an artificial limitation. Use dynamic memory allocation to ! go beyond this. ! ! LONG TERM ! - Implement multi-hop data collection ! - We now assume that 3 seconds is long enough for a one-hop reply ! to receive the sender of the ping. If we are to do multihop, ! it might be dicy. Think of a better scheme to do loss resolution ! ! - Try to study path loss alongwith link loss ! - We can incorporate studies like congestion loss to error loss ! Index: FireworksM.nc =================================================================== RCS file: /cvsroot/firebug/fireboard/beta/fireworks/apps/Fireworks/FireworksM.nc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FireworksM.nc 25 Jul 2005 22:08:16 -0000 1.3 --- FireworksM.nc 26 Jul 2005 01:15:45 -0000 1.4 *************** *** 3,6 **** --- 3,8 ---- * Graduate Student * Firebug Project + * http://firebug.sf.net + * * Date: 7/20/2005 * *************** *** 19,23 **** interface SendMsg as SendPingReplyMsg; interface ReceiveMsg as ReceiveDataRequestMsg; - interface ReceiveMsg as ReceiveDataMsg; interface ReceiveMsg as ReceivePingMsg; interface ReceiveMsg as ReceivePingReplyMsg; --- 21,24 ---- *************** *** 41,44 **** --- 42,48 ---- uint16_t counter; uint16_t dest; + uint16_t rcvseq; + uint16_t lastseq; + uint16_t client; TOS_Msg msg; *************** *** 77,83 **** } ! task void sendPing() { ! /* NOTE: Again, since tasks dont seem to allow parameters, ! we use the global 'dest' as destination */ clearPacket(); pMsg = (PingMsg *) &(msg.data); --- 81,88 ---- } ! void sendPing() { ! /* NOTE: Since tasks do not seem to allow parameters, we use ! dest as a global variable. It should not be ! used by anybody else */ clearPacket(); pMsg = (PingMsg *) &(msg.data); *************** *** 95,98 **** --- 100,104 ---- /* We have sent the msg. Set timer to fire after 3 seconds */ blink(SND_P_MSG); + lastseq = pMsg->seqno; call Timer.start(TIMER_ONE_SHOT, 3072); counter++; *************** *** 104,114 **** task void sendPingReply() { /* NOTE: Since tasks do not seem to allow parameters, we use ! src and seqno as global variables. They should not be used by anybody else */ prMsg = (PingReplyMsg *) &(msg.data); prMsg->source = src; ! prMsg->seqno = seqno; if(!sendBusy) { --- 110,121 ---- task void sendPingReply() { /* NOTE: Since tasks do not seem to allow parameters, we use ! src and rcvseq as global variables. They should not be used by anybody else */ + clearPacket(); prMsg = (PingReplyMsg *) &(msg.data); prMsg->source = src; ! prMsg->seqno = rcvseq; if(!sendBusy) { *************** *** 127,133 **** task void sendData() { } - task void takeMeasurements() { uint16_t trial; --- 134,153 ---- task void sendData() { + /* Send all the collected data to the client */ + uint8_t dseq = 0; + + clearPacket(); + dMsg = (DataMsg *) &(msg.data); + dMsg->seqno = dseq++; + drMsg = (DataRequestMsg *) (&dMsg->data); + drMsg->source = TOS_LOCAL_ADDRESS; + drMsg->numNodes = nNodes; + drMsg->numTrials = nTrials; + drMsg->numPowerLevels = nPowerLevels; + drMsg->trialFrequency = tFrequency; + + if(!call SendDataMsg.send( } task void takeMeasurements() { uint16_t trial; *************** *** 136,140 **** RSSI value. Once we send a ping, we start a timer. If the timer expires, we assume that the node is out of range/unreachable */ - dest = 1; for(dest=1; dest <= nNodes; dest++) { counter = 0; --- 156,159 ---- *************** *** 147,151 **** trial ++; taskBusy = TRUE; ! post sendPing(); } } --- 166,170 ---- trial ++; taskBusy = TRUE; ! sendPing(); } } *************** *** 171,175 **** counter = 0; dest = 0; ! call CommControl.start(); --- 190,196 ---- counter = 0; dest = 0; ! rcvseq = 0; ! src = 0; ! client = 0; call CommControl.start(); *************** *** 192,196 **** blink(RCV_PR_MSG); taskBusy = FALSE; - } --- 213,216 ---- *************** *** 215,227 **** } - event TOS_MsgPtr ReceiveDataMsg.receive(TOS_MsgPtr m) { - return m; - } - event TOS_MsgPtr ReceivePingMsg.receive(TOS_MsgPtr m) { if(TOS_LOCAL_ADDRESS == m->addr) { blink(RCV_P_MSG); pMsg = (PingMsg *) &(m->data); ! while(taskBusy); --- 235,245 ---- } event TOS_MsgPtr ReceivePingMsg.receive(TOS_MsgPtr m) { if(TOS_LOCAL_ADDRESS == m->addr) { blink(RCV_P_MSG); pMsg = (PingMsg *) &(m->data); ! rcvseq = pMsg->seqno; ! src = pMsg->source; ! while(taskBusy); *************** *** 238,242 **** data[dest][counter]=LOST; taskBusy = FALSE; - sendBusy = FALSE; return SUCCESS; } --- 256,259 ---- |