[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/rf2xx/layers SlottedCollisionConfig.nc, 1.1, 1.2 SlottedCollisionLayerP.nc, 1.1, 1.2 TrafficMonitorConfig.nc, 1.1, 1.2 TrafficMonitorLayerP.nc, 1.1, 1.2
Miklos Maroti
mmaroti at users.sourceforge.net
Fri Apr 10 01:33:22 PDT 2009
Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/rf2xx/layers
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25221/layers
Modified Files:
SlottedCollisionConfig.nc SlottedCollisionLayerP.nc
TrafficMonitorConfig.nc TrafficMonitorLayerP.nc
Log Message:
make traffic monitor optional
Index: SlottedCollisionConfig.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf2xx/layers/SlottedCollisionConfig.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SlottedCollisionConfig.nc 10 Mar 2009 20:37:58 -0000 1.1
--- SlottedCollisionConfig.nc 10 Apr 2009 08:33:20 -0000 1.2
***************
*** 53,61 ****
*/
async command uint16_t getCollisionWindowLength(message_t* msg);
-
- /**
- * This event should be called periodically to indicate the passing of
- * time (maybe we should use a timer)
- */
- tasklet_async event void timerTick();
}
--- 53,55 ----
Index: SlottedCollisionLayerP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf2xx/layers/SlottedCollisionLayerP.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SlottedCollisionLayerP.nc 10 Mar 2009 20:37:58 -0000 1.1
--- SlottedCollisionLayerP.nc 10 Apr 2009 08:33:20 -0000 1.2
***************
*** 74,77 ****
--- 74,79 ----
/* ----- schedule selection ----- */
+ void printStats();
+
tasklet_async event bool SubReceive.header(message_t* msg)
{
***************
*** 113,121 ****
uint16_t length = call Config.getCollisionWindowLength(msg);
! error1 -= error1 >> ERROR_DECAY;
if( isBetween(exponent, schedule1, start, length) )
error1 += ERROR_COLLISION;
! error2 -= error2 >> ERROR_DECAY;
if( isBetween(exponent, schedule2, start, length) )
error2 += ERROR_COLLISION;
--- 115,123 ----
uint16_t length = call Config.getCollisionWindowLength(msg);
! error1 -= (error1 + (1<<ERROR_DECAY) - 1) >> ERROR_DECAY;
if( isBetween(exponent, schedule1, start, length) )
error1 += ERROR_COLLISION;
! error2 -= (error1 + (1<<ERROR_DECAY) - 1) >> ERROR_DECAY;
if( isBetween(exponent, schedule2, start, length) )
error2 += ERROR_COLLISION;
***************
*** 134,155 ****
}
- return signal RadioReceive.receive(msg);
- }
-
- void printStats();
-
- tasklet_async event void Config.timerTick()
- {
- if( error1 >= (1 << ERROR_DECAY) )
- error1 -= error1 >> ERROR_DECAY;
- else if( error1 > 0 )
- --error1;
-
- if( error2 >= (1 << ERROR_DECAY) )
- error2 -= error2 >> ERROR_DECAY;
- else if( error2 > 0 )
- --error2;
-
printStats();
}
--- 136,142 ----
}
printStats();
+
+ return signal RadioReceive.receive(msg);
}
***************
*** 197,200 ****
--- 184,189 ----
txTime = time + backoff;
+ printStats();
+
return SUCCESS;
}
***************
*** 257,261 ****
void printStats()
{
! if( ++count > 10 && call DiagMsg.record() )
{
count = 0;
--- 246,250 ----
void printStats()
{
! if( ++count > 50 && call DiagMsg.record() )
{
count = 0;
Index: TrafficMonitorConfig.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf2xx/layers/TrafficMonitorConfig.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrafficMonitorConfig.nc 10 Mar 2009 20:37:58 -0000 1.1
--- TrafficMonitorConfig.nc 10 Apr 2009 08:33:20 -0000 1.2
***************
*** 72,80 ****
*/
tasklet_async event uint8_t getErrorAverage();
-
- /**
- * This command is periodically called when the timer is fired and
- * the averages are updated
- */
- tasklet_async command void timerTick();
}
--- 72,74 ----
Index: TrafficMonitorLayerP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/rf2xx/layers/TrafficMonitorLayerP.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TrafficMonitorLayerP.nc 10 Mar 2009 20:37:58 -0000 1.1
--- TrafficMonitorLayerP.nc 10 Apr 2009 08:33:20 -0000 1.2
***************
*** 150,155 ****
neighborCount = 0;
- call TrafficMonitorConfig.timerTick();
-
call Tasklet.resume();
--- 150,153 ----
More information about the Tinyos-2-commits
mailing list