MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Core::SerialTransport Struct Reference

StreamBackend policy for serial ports. More...

#include <SerialBackend.hpp>

Collaboration diagram for MayaFlux::Core::SerialTransport:

Public Types

using Config = SerialLinkInfo
using Stream = asio::serial_port

Static Public Member Functions

static std::string describe (const EndpointInfo &info)
static asio::error_code open (Stream &port, const EndpointInfo &info)
static std::string peer_label (const EndpointInfo &info)
static void ready (Stream &port, const EndpointInfo &info)
static bool send_break (Stream &port)
static bool set_control_lines (Stream &port, std::optional< bool > dtr, std::optional< bool > rts)
static std::chrono::milliseconds settle_time (const EndpointInfo &info)

Static Public Attributes

static constexpr FramingPolicy automatic_framing = FramingPolicy::NONE
static constexpr NetworkTransport id = NetworkTransport::SERIAL
static constexpr std::string_view label = "Serial"
static constexpr bool listens = false
static constexpr std::string_view name = "Serial (Asio)"

Detailed Description

StreamBackend policy for serial ports.

An endpoint opens the device named by remote_path with the line setup in EndpointInfo::serial. The port opens synchronously, so open_endpoint returns 0 for a port that cannot be opened, unless the backend reconnects, in which case the endpoint waits in RECONNECTING until the device appears. AUTO framing is NONE: each read is delivered as one message and a send writes its payload as it is.

Baud rates outside asio's table go through the platform: termios2 on Linux and IOSSIOSPEED on macOS, and Windows accepts any value. DTR and RTS are driven after the open, which asserts both, so a board that restarts on DTR sees the open itself. The endpoint then stays OPENING for settle_ms before any read, and input received before it opens is discarded.

Definition at line 26 of file SerialBackend.hpp.


The documentation for this struct was generated from the following files: