Update of /cvsroot/firebug/fireboard/beta/fireworks/apps/MultihopLinkEstimator
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23641
Modified Files:
MultihopLinkEstimatorM.nc
Log Message:
only 0 will send pings now
Index: MultihopLinkEstimatorM.nc
===================================================================
RCS file: /cvsroot/firebug/fireboard/beta/fireworks/apps/MultihopLinkEstimator/MultihopLinkEstimatorM.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** MultihopLinkEstimatorM.nc 9 Aug 2005 00:07:53 -0000 1.4
--- MultihopLinkEstimatorM.nc 25 Aug 2005 03:14:11 -0000 1.5
***************
*** 166,169 ****
--- 166,170 ----
call Leds.yellowOn();
#endif
+ linkMsg->seqno = ++leseqno;
linkMsg->source = lesource;
linkMsg->dest = TOS_LOCAL_ADDRESS;
***************
*** 220,236 ****
event result_t LinkTimer.fired() {
- uint16_t rtimer;
#ifdef LE_LEDS
! call Leds.greenToggle();
#endif
! /* Choose a random number between (1-4096)ms and add it to 10000.
! Basically, choose a random number between
! 10000-14096*/
! rtimer = (call Random.rand() & 0x1fff) + 0x2710;
! call LinkTimer.start(TIMER_ONE_SHOT, rtimer);
! post sendPing();
return SUCCESS;
}
--- 221,240 ----
event result_t LinkTimer.fired() {
+ if(TOS_LOCAL_ADDRESS == 0) {
+ uint16_t rtimer;
+
#ifdef LE_LEDS
! call Leds.greenToggle();
#endif
! /* Choose a random number between (1-4096)ms and add it to 10000.
! Basically, choose a random number between
! 10000-14096*/
! rtimer = (call Random.rand() & 0x1fff) + 0x2710;
! call LinkTimer.start(TIMER_ONE_SHOT, rtimer);
! post sendPing();
! }
return SUCCESS;
}
***************
*** 256,262 ****
/* Build the LinkEstimatorMsg */
atomic {
- LinkEstimatorMsg *le = (LinkEstimatorMsg *) &(leMsg.data);
-
- le->seqno = ++leseqno;
lesource = pingMsg->source;
lerssi = m->strength;
--- 260,263 ----
|