|
|
Jump to this file's LXR Page |
|
|
File: [CENS] / tos-contrib / reset_count / README
(download)
Revision: 1.2, Fri Mar 24 23:37:50 2006 UTC (3 years, 8 months ago) by jhicks Branch: MAIN CVS Tags: pregeonet, acoustic-05-18-06, PRE_TOSNIC_FIX, PRE_64BIT, HEAD, ESS_CENTROUTE_TESTING, CYCLOPS_RELEASE_CANDIDATE_2_0, CYCLOPS_PRERELEASE_STABLE, CENTROUTE_EMSTAR_SOCKETS, BG_1_0, AMARSS_JR_DEPLOYMENT_6_05_07 Changes since 1.1: +3 -19 lines Reflects the changes to use the onboard flash instead of the external EEPROM. |
ResetCount -
Purpose:
ResetCount was made as a simple utility to track mote restarts. Upon
startup, the module will increment a counter in flash, and report the number
back when needed. Its use was intended to simplify the ordering of packets
across restarts, but can be used for any number of debugging purposes. Its
memory usage is extremely small, only requiring 2 bytes of RAM and 2 bytes of
ROM.
Usage:
Using ResetCount is straight forward. Make sure its directories are
included in the compile options. Then link in as any other module:
- Add ResetCountC to your components list
- Add <filenameM>.ResetCountI -> ResetCountC in your configuration file
- Add interface ResetCountI to your uses list in your M file
- Now call ResetCountI.get_count() whenever you need the current reset
count
Interface:
command uint16_t get_count() - Returns the number of times the mote has
been reset.
command result_t reset() - Reset the count in flash. Returns
SUCCESS or FAIL.
Functions:
ResetCountM.nc:
load_count() - Called from StdControl.start(). Initiates a sequence
of checking for a previous count in flash, updating that count
(or setting it to 0 if it does not yet exist), then writing the
new count back into flash. Also stores the updated count in
memory for fast retrieval via get_count().
| CENS CVS Mailing List |
Powered by ViewCVS 0.9.2 |