54 void push(std::span<const uint8_t> chunk);
60 [[nodiscard]] uint32_t
id()
const {
return m_id; }
80 static Framer make_framer(
const SerialSpec& spec);
84 void parse_midi(std::span<const uint8_t> chunk);
85 void deliver(std::optional<InputValue> value);
What a serial device needs from the transport under it.
std::atomic< uint64_t > m_frames
SerialReader(const SerialReader &)=delete
SerialReader & operator=(SerialReader &&)=delete
SerialReaderStats stats() const
std::variant< Transitive::Protocol::RawChunkFramer, Transitive::Protocol::LineFramer, Transitive::Protocol::DelimiterFramer, Transitive::Protocol::CobsFramer, Transitive::Protocol::SlipFramer, Transitive::Protocol::IdleGapFramer > Framer
std::atomic< uint64_t > m_dropped
SerialReader & operator=(const SerialReader &)=delete
std::function< bool(Transitive::Protocol::Message message)> FrameFilter
std::atomic< ISerialLink::TimerToken > m_gap_timer
std::function< void(const InputValue &)> ValueCallback
void reset()
Drop the partial message, the running MIDI status and a pending gap.
std::atomic< uint64_t > m_unparsed
SerialReader(SerialReader &&)=delete
const SerialSpec & spec() const
SerialReader(uint32_t id, SerialSpec spec, ISerialLink &link)
void push(std::span< const uint8_t > chunk)
void set_frame_filter(FrameFilter filter)
void set_value_callback(ValueCallback callback)
Messages in Consistent Overhead Byte Stuffing, each ended by a zero byte.
Splits a byte stream at a terminator of one or more bytes, whatever the chunking.
Messages ended by a quiet period on the line, as in Modbus RTU.
Splits a byte stream into lines, whatever the chunking.
Messages in SLIP (RFC 1055), each ended by 0xC0.
std::span< const uint8_t > Message
One complete message.
What a reader has seen since it was made.
What a serial device is: its line setup, framing and parsing, as a plain value.
The framer for raw streams: every push is one message, with nothing to reassemble.