Interface: LoggerWrite
Implements a circular log interface.
Allows a line at a time to be written, automatically
maintaining a current line pointer. The pointer wraps around to the
beginning of the log.
- Components providing this interface:
-
tos.system.Logger
tos.system.LoggerM
- Components requiring this interface:
-
apps.Ident.AppM
apps.SenseLightToLog.SenseLightToLogM
-
result_t
append
(uint8_t *data)
-
result_t
resetPointer
(void)
-
result_t
setPointer
(uint16_t line)
-
result_t
write
(uint16_t line, uint8_t *data)
-
result_t
writeDone
(result_t success)
append
result_t append(uint8_t *data)
resetPointer
result_t resetPointer(void)
Reset the current line pointer to the beginning of the log.
Returns: |
SUCCESS if the line pointer can be moved and no other operations
are pending.
|
setPointer
result_t setPointer(uint16_t line)
Set the current line pointer to the value of 'line'.
Not all line values are valid.
Parameters: |
line - The address of the line to set the current pointer to.
|
Returns: |
FAIL if the line is invalid, SUCCESS otherwise.
|
write
result_t write(uint16_t line, uint8_t *data)
Write a specified line to the log.
Sets the current line to the input line
and then behaves as append(data)
.
Equivalent to calling setPointer(line)
followed by append(data)
Parameters: |
line - the address of the line
data - the data to be written to the log
|
Returns: |
FAIL if the write cannot occur, SUCCESS otherwise
|
writeDone
result_t writeDone(result_t success)
Notification that a write command has been completed.
Signaled by both write()
and append()
.
Parameters: |
success - SUCCESS if the write was successfully written to the log
|
Returns: |
SUCCESS to notify the logger to keep its bookmark
(current line) in the log
|