Go to the documentation of this file.
16 namespace fusion_engine {
86 void SetBuffer(
void* buffer,
size_t capacity_bytes);
126 size_t OnData(
const uint8_t* buffer,
size_t length_bytes);
159 int32_t
OnByte(
bool quiet);
void WarnOnError(bool enabled)
Enable/disable warnings for CRC and "message too large" failures.
FusionEngineFramer(size_t capacity_bytes)
Construct a framer instance with an internally allocated buffer.
uint32_t current_message_size_
void Reset()
Reset the framer and discard all pending data.
uint32_t Resync()
Perform a resynchronization operation starting at buffer_[1].
FusionEngineFramer()=default
Construct a framer instance with no buffer allocated.
Frame and validate incoming FusionEngine messages.
void SetMessageCallback(std::function< void(const messages::MessageHeader &, const void *)> callback)
Specify a function to be called when a message is framed.
size_t OnData(const uint8_t *buffer, size_t length_bytes)
Process incoming data.
void SetBuffer(void *buffer, size_t capacity_bytes)
Set the buffer to use for message framing.
uint32_t next_byte_index_
std::function< void(const messages::MessageHeader &, const void *)> callback_
Point One FusionEngine output message common definitions.
int32_t OnByte(bool quiet)
Process a single byte.
std::unique_ptr< uint8_t[]> managed_buffer_