#include "ocs.h"Go to the source code of this file.
RAM buffer logging code
Definition in file ocs_ramlog.c.
Data Structures | |
| struct | ocs_ramlog_t |
Functions | |
| static uint32_t | ocs_ramlog_next_idx (ocs_ramlog_t *ramlog, uint32_t idx) |
| Return next ramlog buffer index. More... | |
| ocs_ramlog_t * | ocs_ramlog_init (ocs_t *ocs, uint32_t buffer_len, uint32_t buffer_count) |
| Allocate a ramlog buffer. More... | |
| void | ocs_ramlog_free (ocs_t *ocs, ocs_ramlog_t *ramlog) |
| Free a ramlog buffer. More... | |
| void | ocs_ramlog_clear (ocs_t *ocs, ocs_ramlog_t *ramlog, int clear_start_of_day, int clear_recent) |
| Clear a ramlog buffer. More... | |
| int32_t | ocs_ramlog_printf (void *os, const char *fmt,...) |
| Append formatted printf data to a ramlog buffer. More... | |
| int32_t | ocs_ramlog_vprintf (ocs_ramlog_t *ramlog, const char *fmt, va_list ap) |
| Append formatted text to a ramlog using variable arguments. More... | |
| int32_t | ocs_ddump_ramlog (ocs_textbuf_t *textbuf, ocs_ramlog_t *ramlog) |
| Perform ramlog buffer driver dump. More... | |
| int32_t ocs_ddump_ramlog | ( | ocs_textbuf_t * | textbuf, |
| ocs_ramlog_t * | ramlog | ||
| ) |
Perform ramlog buffer driver dump.
The RAM logging buffer is appended to the driver dump data.
| textbuf | Pointer to the driver dump text buffer. |
| ramlog | Pointer to the RAM logging buffer. |
Definition at line 266 of file ocs_ramlog.c.
| void ocs_ramlog_clear | ( | ocs_t * | ocs, |
| ocs_ramlog_t * | ramlog, | ||
| int | clear_start_of_day, | ||
| int | clear_recent | ||
| ) |
Clear a ramlog buffer.
The text in the start of day and/or recent ramlog text buffers is cleared.
| ocs | Pointer to driver structure. |
| ramlog | Pointer to RAM logging buffer structure. |
| clear_start_of_day | Clear the start of day (driver init) portion of the ramlog. |
| clear_recent | Clear the recent messages portion of the ramlog. |
Definition at line 148 of file ocs_ramlog.c.
| void ocs_ramlog_free | ( | ocs_t * | ocs, |
| ocs_ramlog_t * | ramlog | ||
| ) |
Free a ramlog buffer.
A previously allocated RAM logging buffer is freed.
| ocs | Pointer to driver structure. |
| ramlog | Pointer to RAM logging buffer structure. |
Definition at line 116 of file ocs_ramlog.c.
| ocs_ramlog_t* ocs_ramlog_init | ( | ocs_t * | ocs, |
| uint32_t | buffer_len, | ||
| uint32_t | buffer_count | ||
| ) |
Allocate a ramlog buffer.
Initialize a RAM logging buffer with text buffers totalling buffer_len.
| ocs | Pointer to driver structure. |
| buffer_len | Total length of RAM log buffers. |
| buffer_count | Number of text buffers to allocate (totalling buffer-len). |
Definition at line 65 of file ocs_ramlog.c.
|
static |
Return next ramlog buffer index.
Given a RAM logging buffer index, return the next index.
| ramlog | Pointer to RAM logging buffer. |
| idx | Index value. |
Definition at line 243 of file ocs_ramlog.c.
| int32_t ocs_ramlog_printf | ( | void * | os, |
| const char * | fmt, | ||
| ... | |||
| ) |
Append formatted printf data to a ramlog buffer.
Formatted data is appended to a RAM logging buffer.
| os | Pointer to driver structure. |
| fmt | Pointer to printf style format specifier. |
Definition at line 179 of file ocs_ramlog.c.
| int32_t ocs_ramlog_vprintf | ( | ocs_ramlog_t * | ramlog, |
| const char * | fmt, | ||
| va_list | ap | ||
| ) |
Append formatted text to a ramlog using variable arguments.
Formatted data is appended to the RAM logging buffer, using variable arguments.
| ramlog | Pointer to RAM logging buffer. |
| fmt | Pointer to printf style formatting string. |
| ap | Variable argument pointer. |
Definition at line 209 of file ocs_ramlog.c.