Apps     Components     Interfaces     All Files     Source Tree     source: tos.interfaces.LoggerRead.nc

Interface: LoggerRead

Interface to read a line at a time from the EEPROM, maintaining an internal "current line" pointer.

Components providing this interface:
tos.system.Logger
tos.system.LoggerM

Components requiring this interface:
apps.Ident.AppM
apps.SenseLightToLog.SimpleCmdM

Commands

Events

Commands - Details

readNext

result_t readNext(uint8_t *buffer)

Read the next line from the log, wrapping around to the beginning of the log.

Parameters:

buffer - The buffer to read data into.

Returns: FAIL if the component is busy, SUCCESS otherwise.

read

result_t read(uint16_t line, uint8_t *buffer)

Equivalent to calling setPointer(line) followed by read(buffer).

Parameters:

line - The line to read from

buffer - The buffer to read data into.

Returns: FAIL if the component is busy or the line is invalid, SUCCESS otherwise.

resetPointer

result_t resetPointer(void)

Reset the current read pointer to the beginning of the log.
Returns: Always return SUCCESS.

setPointer

result_t setPointer(uint16_t line)

Set the current read pointer to the given value. Not all pointer values are valid.

Parameters:

line - The line to set the pointer to.

Returns: FAIL if the line is invalid, SUCCESS otherwise.

Events - Details

readDone

result_t readDone(uint8_t *buffer, result_t success)

Signaled when a read completes.

Parameters:

buffer - The buffer containing the read data.

success - Whether the read was successful. If FAIL, the buffer data is invalid.