Apps     Components     Interfaces     All Files     Source Tree     source: apps.TestEEPROM.Byte.TestByteEEPROMC.nc

Component: TestByteEEPROMC

This program is a simple test of ByteEEPROM, a component which provides a byte-level abstraction to the EEPROM. This application was used to debug ByteEEPROM, and is a good example on how to wire and use it. Requests are made for different memory regions, and a write followed by a read is made from the same region. If the data in the write buffer is the same as the data in the read buffer, the red led should remain on when execution of the application ends. Currently GenericComm is wired to this application so that buffers read and written could be written over the UART. The full functionality of this debugging mechanism has not been implemented fully. It currently supports the output of one packet over the UART, which can be observed using the java tool "ListenRaw"

Required Interfaces

Provided Interfaces

Variables

Function Index

Function Descriptions

StdControl.init

command result_t StdControl.init (void)

Initialize the application by initializing the character array blah, whose data will be written. Initialize GenericComm, Leds, and ByteEEPROM. Turn on the red Led and request for distinct memory regions
Returns: Always returns SUCCESS

StdControl.start

command result_t StdControl.start (void)

call ByteEEPROMStdControl.start(). ByteEEPROM will allocate memory and signal AllocationReq.requestProcessed to applications that had successful calls to either request or requestAddr. call WriteData.write(...). Write out a portion of the write buffer to the EEPROM.
Returns: Always returns SUCCESS

AllocationReq1.requestProcessed

event result_t AllocationReq1.requestProcessed (result_t success)

Signalled when ByteEEPROM processes a particular allocation request. if the memory was allocated, meaning SUCCESS was signalled, turn the red Led off
Returns: Always returns SUCCESS

WriteData1.writeDone

event result_t WriteData1.writeDone (uint8_t *data, uint32_t numBytesWrite, result_t success)

Signalled when ByteEEPROM has finished writing. Output dbg statements indicating whether or not the write was successful. call ReadData.read(...) Read out the portion of the write buffer previously written.
Returns: Always returns SUCCESS

ReadData1.readDone

event result_t ReadData1.readDone (uint8_t *buffer, uint32_t numBytesRead, result_t success)

Signalled when ByteEEPROM has finished reading. Turns the yellow Led on if the read was successful. Outputs the buffer read through dbg statments. Also does a comparison with the buffer written and the buffer read; if they are the same, the red Led is turned on.
Returns: Always returns SUCCESS

SendMsg.sendDone

event result_t SendMsg.sendDone (TOS_MsgPtr msg, result_t success)

does nothing right now.
Returns: Always returns SUCCESS