Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
SerialCommunicationsDriver.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_COMMS_SERIAL_SERIALCOMMUNICATIONSDRIVER_HPP_
2#define IV_SRC_COMMS_SERIAL_SERIALCOMMUNICATIONSDRIVER_HPP_
3
6
7namespace iv::comms::serial
8{
9
11{
12public:
17
20
21 void configure(const iv::model::comms::NetworkData &commConfig) override;
22
23 iv::comms::eResponse init() override;
24 iv::comms::eResponse end() override;
26 iv::comms::eResponse start() override;
27 iv::comms::eResponse stop() override;
28
29 void emptyInputBuffer() const;
30 iv::comms::eResponse receive(std::vector<std::byte> &buffer, bool stopOnNewLine = true) const;
31 [[nodiscard]] iv::comms::eResponse send(const std::vector<std::byte> &data) const;
32
33 bool isOnline() override;
34
35private:
37 std::unique_ptr<SerialPort> m_serialPort;
38};
39
40}// namespace iv::comms::serial
41
42#endif//IV_SRC_COMMS_SERIAL_SERIALCOMMUNICATIONSDRIVER_HPP_
Definition ICommunicationDriver.hpp:13
Definition SerialCommunicationsDriver.hpp:11
iv::comms::eResponse stop() override
Definition SerialCommunicationsDriver.cpp:93
bool isOnline() override
Definition SerialCommunicationsDriver.cpp:156
iv::comms::eResponse send(const std::vector< std::byte > &data) const
Definition SerialCommunicationsDriver.cpp:140
iv::comms::eResponse reconnect() override
Definition SerialCommunicationsDriver.cpp:44
std::unique_ptr< SerialPort > m_serialPort
Definition SerialCommunicationsDriver.hpp:37
iv::model::comms::serial::PortSettings m_serialPortSettings
Definition SerialCommunicationsDriver.hpp:36
iv::comms::eResponse end() override
Definition SerialCommunicationsDriver.cpp:31
void emptyInputBuffer() const
Definition SerialCommunicationsDriver.cpp:111
SerialCommunicationsDriver(SerialCommunicationsDriver &&other)=delete
SerialCommunicationsDriver(const SerialCommunicationsDriver &other)=delete
iv::comms::eResponse start() override
Definition SerialCommunicationsDriver.cpp:73
SerialCommunicationsDriver & operator=(SerialCommunicationsDriver &&other)=delete
SerialCommunicationsDriver()
Definition SerialCommunicationsDriver.cpp:11
void configure(const iv::model::comms::NetworkData &commConfig) override
Definition SerialCommunicationsDriver.cpp:18
iv::comms::eResponse init() override
Definition SerialCommunicationsDriver.cpp:23
iv::comms::eResponse receive(std::vector< std::byte > &buffer, bool stopOnNewLine=true) const
Definition SerialCommunicationsDriver.cpp:116
SerialCommunicationsDriver & operator=(const SerialCommunicationsDriver &other)=delete
Definition enums.hpp:11
eResponse
Definition enums.hpp:285
Definition NetworkData.hpp:18
Definition SerialPortSettings.hpp:92