34 std::chrono::milliseconds
gap { 2 };
100 copy.line.baud_rate = rate;
107 copy.line.data_bits = bits;
114 copy.line.parity = value;
121 copy.line.stop_bits = value;
128 copy.line.flow_control = value;
135 copy.line.dtr_on_open = level;
142 copy.line.rts_on_open = level;
150 copy.line.settle_ms = milliseconds;
158 copy.message_limit =
bytes;
180 copy.parser = std::move(parser_function);
191 spec.
gap = std::chrono::milliseconds(protocol.
gap_ms);
SerialStopBits
Stop bits of a serial line.
SerialParity
Parity bit of a serial line.
std::function< std::optional< InputValue >(Transitive::Protocol::Message message)> SerialParser
A user parser: one message to a value, or nothing to drop it.
SerialParse
What a message becomes.
SerialFlowControl
Flow control of a serial line: XON/XOFF in software, or RTS/CTS in hardware.
SerialFraming
How the bytes of a port are cut into messages.
std::span< const uint8_t > Message
One complete message.
Line setup applied when a serial endpoint opens.
How a port is read, as plain data a config can hold.
std::vector< uint8_t > delimiter() const
The terminator of DELIMITED framing, LF when none was given.
SerialSpec parse_with(SerialParser parser_function) const
static SerialSpec midi()
A MIDI byte stream at 31250 baud: channel voice messages and real-time bytes.
SerialSpec max_message(size_t bytes) const
The longest message in bytes.
SerialSpec settle_ms(uint32_t milliseconds) const
How long the port stays unread after it opens, for boards that restart on open.
static SerialSpec from(const SerialLineSettings &line, const SerialProtocolSettings &protocol)
The spec a configured port describes.
std::chrono::milliseconds gap
static SerialSpec delimited(std::string_view terminator)
Messages ended by terminator, of one or more bytes.
static SerialSpec idle_gap(std::chrono::milliseconds gap)
Messages ended by gap of silence.
SerialSpec data_bits(uint8_t bits) const
SerialSpec parity(SerialParity value) const
SerialSpec rts_on_open(bool level) const
SerialSpec baud(uint32_t rate) const
static SerialSpec lines()
SerialSpec numbers() const
SerialSpec stop_bits(SerialStopBits value) const
SerialSpec dtr_on_open(bool level) const
std::vector< uint8_t > terminator
SerialSpec flow_control(SerialFlowControl value) const
What a serial device is: its line setup, framing and parsing, as a plain value.