Skip to main content
Pigweed's logo Pigweed
code_xml
  1. Home
  2. Reference
  3. C/C++
  4. Comms
  5. pw_cobs
  6. pw::cobs::Decoder Class Reference
Loading...
Searching...
No Matches
pw::cobs::Decoder Class Reference

Overview

Incremental streaming decoder for 0x00-delimited COBS frames.

Feed incoming wire bytes either one byte at a time (Process(std::byte)) or in chunks (Process(ConstByteSpan, callback)). Back-to-back 0x00 delimiters are ignored as idle line bytes.

Inheritance diagram for pw::cobs::Decoder:
pw::cobs::DecoderBuffer< kSizeBytes >

Public Member Functions

constexpr Decoder (ByteSpan decode_buffer)
 
void Clear ()
 Discards any partially received frame and resets the decoder to idle.
 
constexpr bool in_progress () const
 
Result< ByteSpan > Process (std::byte b)
 
template<typename Callback >
void Process (ConstByteSpan data, Callback &&callback)
 

Friends

Result< ByteSpan > Decode (ConstByteSpan encoded, ByteSpan output)
 

The documentation for this class was generated from the following file: