MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ SerialDevice() [1/3]

MayaFlux::Core::SerialDevice::SerialDevice ( uint32_t device_id,
SerialSpec spec,
std::unique_ptr< ISerialLink > link )
Parameters
device_idId stamped on every value.
specThe line setup, framing and parsing.
linkThe transport. Owned.

Definition at line 7 of file SerialDevice.cpp.

9 , m_spec(std::move(spec))
10 , m_link(std::move(link))
11 , m_reader(std::make_unique<SerialReader>(device_id, m_spec, *m_link))
12{
13 m_reader->set_frame_filter([this](P::Message frame) { return complete_request(frame); });
14 m_link->set_chunk_callback([this](std::span<const uint8_t> chunk) { handle_chunk(chunk); });
15 m_link->set_state_callback([this](EndpointState previous, EndpointState current) {
16 handle_state(previous, current);
17 });
18}
std::unique_ptr< SerialReader > m_reader
std::unique_ptr< ISerialLink > m_link
void handle_chunk(std::span< const uint8_t > chunk)
void handle_state(EndpointState previous, EndpointState current)
bool complete_request(Transitive::Protocol::Message frame)
const SerialSpec & spec() const
EndpointState
Observable connection state for an endpoint.

References complete_request(), device_id(), handle_chunk(), handle_state(), m_device_id, m_link, m_reader, m_spec, and spec().

Referenced by operator=(), operator=(), SerialDevice(), and SerialDevice().

Here is the call graph for this function:
Here is the caller graph for this function: