diff --git a/src/modbustcp.cpp b/src/modbustcp.cpp index fdaffcf..5cdaa36 100644 --- a/src/modbustcp.cpp +++ b/src/modbustcp.cpp @@ -9,6 +9,7 @@ using namespace osdev::components::modbus; ModbusTcp::ModbusTcp(const ConnectionConfig &con_config) + { } diff --git a/src/modbustcp.h b/src/modbustcp.h index 243ad2c..f3b49bb 100644 --- a/src/modbustcp.h +++ b/src/modbustcp.h @@ -8,10 +8,19 @@ #include "imodbusport.h" +#include +#include +#include +#include + namespace osdev { namespace components { namespace modbus { +using X_SOCKET = int; +using SOCKADDR = struct sockaddr; +using SOCKADDR_IN = struct sockaddr_in; + class ModbusTcp : public IModbusPort { public: @@ -24,6 +33,13 @@ public: virtual bool Close() const override; virtual int Read(uint8_t *buffer) const override; virtual int Write(uint8_t *buffer, size_t length) const override; + +private: + uint16_t m_port {502}; + std::string m_host {}; + X_SOCKET m_socket {-1}; + SOCKADDR_IN m_server {}; + }; } /* End namespace modbus */