Fixposition SDK 0.0.0-heads/main-0-g90a51ff
Collection of c++ libraries and apps for use with Fixposition products
|
Message parser class. More...
#include <parser.hpp>
Public Member Functions | |
Parser () | |
Constructor, initialises parser and makes it ready to accept data and emit messages. | |
bool | Add (const uint8_t *data, const std::size_t size) |
Add data to parser. | |
bool | Add (const std::vector< uint8_t > &data) |
Add data to parser. | |
void | Reset () |
Reset parser. | |
bool | Process (ParserMsg &msg) |
Process data in parser, return message. | |
bool | Flush (ParserMsg &msg) |
Get remaining data from parser as OTHER message(s) | |
ParserStats | GetStats () const |
Get parser statistics. | |
Message parser class.
Definition at line 164 of file parser.hpp.
bool fpsdk::common::parser::Parser::Add | ( | const uint8_t * | data, |
const std::size_t | size ) |
Add data to parser.
[in] | data | Pointer to data |
[in] | size | Size of data (should be <= MAX_ADD_SIZE) |
bool fpsdk::common::parser::Parser::Add | ( | const std::vector< uint8_t > & | data | ) |
Add data to parser.
[in] | data | data, can be empty (should be <= MAX_ADD_SIZE) |
void fpsdk::common::parser::Parser::Reset | ( | ) |
Reset parser.
Resets the parser state and discards all collected data.
bool fpsdk::common::parser::Parser::Process | ( | ParserMsg & | msg | ) |
Process data in parser, return message.
[out] | msg | The detected message frame |
bool fpsdk::common::parser::Parser::Flush | ( | ParserMsg & | msg | ) |
Get remaining data from parser as OTHER message(s)
[out] | msg | A chunk of the remaining data as a OTHER message |
ParserStats fpsdk::common::parser::Parser::GetStats | ( | ) | const |
Get parser statistics.