7 #include <boost/circular_buffer.hpp> 8 #include <boost/noncopyable.hpp> 39 std::function<bool(const MemoryBlockParserPtr&, const MemoryBlockParserPtr&)>>
59 void addNewData(
const uint8_t* data, std::size_t length);
76 void addNewData(
const std::vector<uint8_t>& data);
static constexpr size_t HEADER_SIZE_V2
boost::circular_buffer< uint8_t > internalBuffer
void addNewData(const uint8_t *data, std::size_t length)
Add new binary data to the parser internal buffer The new data can only be a part of a frame...
static constexpr size_t HEADER_SIZE_V5
bool haveEnoughBytesToParseHeader()
const tParsersSet extendedNavigationParsers
Data::BinaryNav getLastNavData(void) const
std::shared_ptr< MemoryBlockParser > MemoryBlockParserPtr
const tParsersSet externalDataParsers
void compareChecksum()
Compute current frame checksum and compare with the frame checksum. If mismatch, throw std::runtime_e...
bool parseNextFrame()
Try to parse a frame from the parser internal buffer. Some binary data must have been added with the ...
const tParsersSet navigationParsers
const std::vector< uint8_t > & getLastAnswerData(void) const
std::vector< uint8_t > lastAnswer
Data::BinaryNav lastParsed
Data::NavHeader getLastHeaderData(void) const
static constexpr size_t ANSWER_HEADER_SIZE
static constexpr size_t HEADER_SIZE_V3
Data::NavHeader lastHeader
std::set< MemoryBlockParserPtr, std::function< bool(const MemoryBlockParserPtr &, const MemoryBlockParserPtr &)> > tParsersSet
static constexpr size_t CHECKSUM_SIZE
Data::NavHeader::MessageType getHeaderType(boost::asio::const_buffer &buffer) const
static constexpr size_t HEADER_SIZE_V4
Data::NavHeader parseHeader(boost::asio::const_buffer &buffer) const
Parser of a STDBIN IXblue message. This is the entry point of the library. Usage of this class is as ...