|
Comms CCF
This is a simple communication layer based on COBS, CBOR and FNV-1A
|
Decodes data as a state-machine. More...
#include <cobs.hpp>
Public Member Functions | |
| bool | feed (uint8_t byte) |
| uint8_t | get (uint8_t byte) const |
Decodes data as a state-machine.
| bool Cobs::Decoder::feed | ( | uint8_t | byte | ) |
Feeds a character to the state-machine, returning whether that character is to be emitted, or only causing an internal transition
We reached an unescaped zero byte, our caller should already know we are at the end – reset for decoding next frame
And don't say skip, to emit the null and not process the next byte
| uint8_t Cobs::Decoder::get | ( | uint8_t | byte | ) | const |
Get the current character, should be called before feed, with the same byte that will be fed. But it is only valid if feed returns true, otherwise it should be ignored.