24 #include <string_view>
48 Serial(
const std::string& device, uint32_t baud_rate);
49 Serial(
const std::string& device, uint32_t baud_rate, std::shared_ptr<boost::asio::io_context> external_ioc);
50 explicit Serial(std::shared_ptr<interface::Channel> channel);
62 std::future<
bool> start() override;
64 void send(std::string_view data) override;
65 void send_line(std::string_view line) override;
66 bool is_connected() const override;
76 void set_baud_rate(uint32_t baud_rate);
77 void set_data_bits(
int data_bits);
78 void set_stop_bits(
int stop_bits);
79 void set_parity(const std::
string& parity);
80 void set_flow_control(const std::
string& flow_control);
81 void set_retry_interval(std::chrono::milliseconds interval);
82 void set_manage_external_context(
bool manage);
85 config::SerialConfig build_config() const;
89 const
Impl* get_impl()
const {
return impl_.get(); }
90 Impl* get_impl() {
return impl_.get(); }
91 std::unique_ptr<Impl> impl_;
Common interface for 1:1 point-to-point communication (e.g., TcpClient, Serial, Udp)
std::function< void(const ErrorContext &)> ErrorHandler
std::function< void(const MessageContext &)> MessageHandler
std::function< void(const ConnectionContext &)> ConnectionHandler
Modernized Serial Wrapper.
Serial(Serial &&) noexcept