#include <CmdParser.h>
Definition at line 25 of file CmdParser.h.
◆ CmdParser()
CmdParser::CmdParser |
( |
const uint32_t |
bufferMaxCapacity = 512 | ) |
|
Constructs a string command parser
- Parameters
-
[in] | bufferMaxCapacity | capacity of the ringbuffer. Must be divisible by 2 and smaller than CMDPARSER_MAX_VALID_CAPACITY |
Definition at line 18 of file CmdParser.cpp.
◆ ~CmdParser()
CmdParser::~CmdParser |
( |
| ) |
|
|
virtual |
◆ add()
bool CmdParser::add |
( |
char * |
Buf, |
|
|
uint32_t * |
Len |
|
) |
| |
Adds one or more characters to the parser buffer Returns true if an end marker was detected and a command is ready to be parsed
Definition at line 37 of file CmdParser.cpp.
◆ bufferCapacity()
int32_t CmdParser::bufferCapacity |
( |
| ) |
|
◆ clear()
void CmdParser::clear |
( |
| ) |
|
◆ parse()
◆ setClearBufferTimeout()
void CmdParser::setClearBufferTimeout |
( |
uint32_t |
timeout | ) |
|
If the last command was earlier than the timeout force clear the buffer before appending. Gets rid of unparsable parts in the buffer. Set 0 to never force clear the buffer automatically and only clear parsed portions (default).
Definition at line 71 of file CmdParser.cpp.
◆ bufferMaxCapacity
const uint32_t CmdParser::bufferMaxCapacity |
|
private |
◆ clearBufferTimeout
uint32_t CmdParser::clearBufferTimeout = 0 |
|
private |
◆ lastAddTime
uint32_t CmdParser::lastAddTime = 0 |
|
private |
◆ ringbuffer
The documentation for this class was generated from the following files: