Class for parsing SLIP packets with a CRC checksum to check the integrity of the packets.
More...
#include <SLIPStream/SLIPParser.hpp>
|
using | checksum_t = typename boost::uint_t< CRC::bit_count >::least |
| The integer type of the checksum. More...
|
|
template<class CRC>
class SLIPParserCRC< CRC >
Class for parsing SLIP packets with a CRC checksum to check the integrity of the packets.
- Template Parameters
-
Definition at line 138 of file SLIPParser.hpp.
◆ checksum_t
using checksum_t = typename boost::uint_t<CRC::bit_count>::least |
◆ SLIPParserCRC() [1/2]
◆ SLIPParserCRC() [2/2]
◆ parse()
size_t parse |
( |
uint8_t |
c | ) |
|
|
inline |
Parse the given byte.
- Parameters
-
- Return values
-
0 | The packet is not finished yet. |
>0 | The packet was received in its entirety, and the return value is the size of the packet in the buffer.
If the packet is not larger than the buffer, this will be the same as the size of the packet. If the packet was larger than the buffer, the return value will be the size of the buffer, and wasTruncated will return true. |
Definition at line 163 of file SLIPParser.hpp.
◆ wasTruncated()
bool wasTruncated |
( |
| ) |
const |
|
inline |
Check if the previous packet was truncated.
- Return values
-
true | The previous packet didn't fit the buffer. The size returned by SLIPParser::parse was smaller than the actual size of the packet. |
false | The buffer was large enough to store the previous packet. |
Definition at line 192 of file SLIPParser.hpp.
◆ numTruncated()
size_t numTruncated |
( |
| ) |
const |
|
inline |
Get the number of bytes that were truncated due to the previous packet being too large for the buffer.
Definition at line 198 of file SLIPParser.hpp.
◆ checksum()
Get the checksum of the previous packet.
A checksum of zero indicates that the packet was received correctly.
Definition at line 207 of file SLIPParser.hpp.
◆ parser
◆ crc
The documentation for this class was generated from the following file: