KM3NeT CLB
2.0
KM3NeT CLB v2 Embedded Software
|
Stores logging history. More...
Go to the source code of this file.
Macros | |
#define | LH_BUFFER_LENGTH 16 |
Maximum number of entries stored in memory. | |
#define | LH_BUFFER_WIDTH 80 |
Maximum width of the in memory log lines. | |
Functions | |
bool | lhFlashInit () |
Initializes the flash storage (may take a while). | |
bool | lhFlashItStart (int count) |
Start the iteration through the flash entries. More... | |
bool | lhFlashItNext (char *bufPtr, int bufSize) |
Get the next element. More... | |
void | lhStore (LogLevel level, char *msg) |
Stores a line in the buffer, and in flash if activated. | |
char * | lhGetLine (int idx) |
Returns a line from the in memory log, where index 0 is the last logged line. More... | |
uint32_t | lhGetLineById (uint32_t lastId, char **logLinePtr) |
Returns the last log-line based on log-line ID. More... | |
Variables | |
bool | lhEnableFlashWrite |
Boolean to enable to disable the writing of logging to the flash. More... | |
bool lhFlashItNext | ( | char * | bufPtr, |
int | bufSize | ||
) |
bool lhFlashItStart | ( | int | count | ) |
char* lhGetLine | ( | int | idx | ) |
Returns a line from the in memory log, where index 0 is the last logged line.
The maximum number of idx is defined in SYS_LOG_BUFFER_LENGTH.
idx | Index, 0 - last logged line. |
uint32_t lhGetLineById | ( | uint32_t | lastId, |
char ** | logLinePtr | ||
) |
Returns the last log-line based on log-line ID.
Returns from the log-buffer a single log line. The provided ID represents the log-line you last got returned, or 0 if you did not receive a line yet.
The provided character pointer-pointer will point to a log line, if available, or else NULL.
If there is any logging available, and which you did get yet, it will return the oldest still available logging, and return its ID. Usually this is lastId + 1.
If the lastId provided is older than what is available in the log buffer, the oldest available entry is returned, and the associated ID.
If the lastId provided is the last logged line, the returned log line ID is the same, and the log-line pointer will not be filled.
lastId | The last logID returned |
logLinePtr | A pointer pointer to be set |