|
|
Jump to this file's LXR Page |
|
|
File: [CENS] / tos-contrib / StatisticsTracker / StatisticsC.nc
(download)
/
(as text)
Revision: 1.1, Wed Sep 22 17:51:26 2004 UTC (5 years, 2 months ago) by nithya Branch: MAIN CVS Tags: rdd_alpha_version_1, pregeonet, acoustic-05-18-06, PRE_TOSNIC_FIX, PRE_NOMEGA_MOTENIC, PRE_CEILING_FIX, PRE_64BIT, MOTENIC_PRE_BUGFIX_20050415, LAURA_CALIBRATION_EXPERIMENTS, HOSTMOTE_PROTOCOL_VERSION_7, HEAD, ESS_RELEASE_3_5, ESS_RELEASE_3_4, ESS_RELEASE_3_3, ESS_RELEASE_3_2, ESS_RELEASE_3_1, ESS_RELEASE_3_0, ESS_RELEASE_2_0, ESS_CONNECTIVITY, ESS_CENTROUTE_TESTING, ESS2-CMS-V1_5_pretest, ESS2-CMS-V1_4cMergeSympathy_2, ESS2-CMS-V1_4c, ESS2-CMS-V1_4b, ESS2-CMS-V1_4a, ESS2-CMS-V1_3, ESS2-CMS-V1_2, ESS2-CMS-V1_1, ESS2-CMS-V1_0, EMSTAR_RELEASE_2_5, EMSTAR_RELEASE_2_1_BRANCH, EMSTAR_RELEASE_2_1, EMSTAR_PRE_HTML, CYCLOPS_RELEASE_CANDIDATE_2_0, CYCLOPS_PRERELEASE_STABLE, CENTROUTE_EMSTAR_SOCKETS, BG_1_0, BANGLADESH_ARSENIC_1_2, BANGLADESH_ARSENIC_1_1, AMARSS_JR_DEPLOYMENT_6_05_07 This module can be used to track various power-related statistics (e.g. time the radio is on, number of packets sent, time spent transmitting). It is very easy to use - in order to indicate the start/stop of an event, the ReportPacketEvent interface is used. n order to retreive the latest snapshot, or to reset the stats, the RetreiveStatistics interface is used. StatisticsC/M provide both of these interfaces. I implemented a milli-second granularity clock as well in order to get ms times (o/w the options were micro-second, or 32 millisecond granularities). |
configuration StatisticsC
{
provides {
interface StdControl;
interface RetreiveStatistics;
interface ReportPacketEvent;
interface SysTime as SysClock;
}
}
implementation
{
components SysTimeC, msClockM, StatisticsM, Main, TimerC;
StdControl = StatisticsM;
RetreiveStatistics = StatisticsM;
ReportPacketEvent = StatisticsM;
SysClock = msClockM.SysTime;
msClockM.Timer -> TimerC.Timer[unique("Timer")];
msClockM.SysClock -> SysTimeC.SysTime;
Main.StdControl -> msClockM.StdControl;
StatisticsM.SysTime -> msClockM;
}
| CENS CVS Mailing List |
Powered by ViewCVS 0.9.2 |