Arduino KVComm
master
Key-Value pair communication library for Arduino
|
Go to the documentation of this file.
3 #include <AH/STL/cstddef>
4 #include <AH/STL/utility>
9 #include <boost/integer.hpp>
73 template <
class Callback>
74 size_t parse(uint8_t c, Callback callback);
92 auto cb = [](uint8_t, size_t) {};
145 using checksum_t =
typename boost::uint_t<CRC::bit_count>::least;
166 auto cb = [
this](uint8_t c,
size_t index) {
size_t numTruncated() const
Get the number of bytes that were truncated due to the previous packet being too large for the buffer...
typename boost::uint_t< CRC::bit_count >::least checksum_t
The integer type of the checksum.
SLIPParserCRC(const SLIPParser &parser, CRC &&crc)
size_t parse(uint8_t c)
Parse the given byte without using a callback function.
Class for parsing SLIP packets with a CRC checksum to check the integrity of the packets.
SLIPParser(std::nullptr_t)
Constructor for a parser without a buffer.
Class for parsing SLIP packets.
bool wasTruncated() const
Check if the previous packet was truncated.
SLIPParserCRC(const SLIPParser &parser)
size_t parse(uint8_t c, Callback callback)
Parse the given byte, and call the callback for each data byte.
size_t numTruncated() const
Get the number of bytes that were truncated due to the previous packet being too large for the buffer...
bool wasTruncated() const
Check if the previous packet was truncated.
SLIPParser(uint8_t *buffer, size_t bufferSize)
Constructor.
SLIPParser(uint8_t(&buffer)[N])
Constructor.
SLIPParser()
Default constructor for a parser without a buffer.
size_t parse(uint8_t c)
Parse the given byte.
checksum_t checksum() const
Get the checksum of the previous packet.