|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
An ISerialLink over a SERIAL endpoint of the NetworkService. More...
#include <NetworkSerialLink.hpp>
Classes | |
| struct | Shared |
Public Member Functions | |
| size_t | backlog () const override |
| Bytes accepted by write() and not yet sent. | |
| void | cancel_post (TimerToken token) override |
| Cancel a timer. | |
| void | close () override |
| Close the port. | |
| NetworkSerialLink (const NetworkSerialLink &)=delete | |
| NetworkSerialLink (NetworkSerialLink &&)=delete | |
| NetworkSerialLink (Registry::Service::NetworkService *service) | |
| bool | open (const std::string &path, const SerialLineSettings &line) override |
Open the port at path with line. | |
| NetworkSerialLink & | operator= (const NetworkSerialLink &)=delete |
| NetworkSerialLink & | operator= (NetworkSerialLink &&)=delete |
| TimerToken | post_after (std::chrono::milliseconds delay, std::function< void()> callback) override |
Run callback once after delay on the link's thread. | |
| bool | send_break () override |
| void | set_chunk_callback (ChunkCallback callback) override |
| bool | set_control_lines (std::optional< bool > dtr, std::optional< bool > rts) override |
| Set DTR and RTS, each optional so one can change alone. | |
| void | set_state_callback (StateCallback callback) override |
| EndpointState | state () const override |
| bool | write (std::span< const uint8_t > bytes) override |
| ~NetworkSerialLink () override | |
| Public Member Functions inherited from MayaFlux::Core::ISerialLink | |
| virtual | ~ISerialLink ()=default |
Private Attributes | |
| ChunkCallback | m_chunk |
| uint64_t | m_endpoint { 0 } |
| Registry::Service::NetworkService * | m_service |
| std::shared_ptr< Shared > | m_shared |
| StateCallback | m_state |
Additional Inherited Members | |
| Public Types inherited from MayaFlux::Core::ISerialLink | |
| using | ChunkCallback = std::function<void(std::span<const uint8_t> bytes)> |
| using | StateCallback = std::function<void(EndpointState previous, EndpointState current)> |
| using | TimerToken = uint64_t |
An ISerialLink over a SERIAL endpoint of the NetworkService.
The endpoint is opened with framing NONE, so every chunk the port yields reaches the chunk callback as it is. Reconnection, settle time and line control are the endpoint's, driven by the SerialLineSettings given to open(). The state callback also reports the endpoint's state at the moment open() returns, so a transition that happened before the callbacks were registered is not lost.
Without a service, open() fails.
Definition at line 23 of file NetworkSerialLink.hpp.