diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1dfe0a6..dc15081 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,6 +14,10 @@ set(SRC_LIST ${CMAKE_CURRENT_SOURCE_DIR}/imodbusport.h ${CMAKE_CURRENT_SOURCE_DIR}/modbus.h ${CMAKE_CURRENT_SOURCE_DIR}/modbus.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/modbustcp.h + ${CMAKE_CURRENT_SOURCE_DIR}/modbustcp.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/modbusrtu.h + ${CMAKE_CURRENT_SOURCE_DIR}/modbusrtu.cpp ${CMAKE_CURRENT_SOURCE_DIR}/connectionconfig.h ${CMAKE_CURRENT_SOURCE_DIR}/connectionconfig.cpp ) diff --git a/src/modbusrtu.cpp b/src/modbusrtu.cpp index e69de29..46376c0 100644 --- a/src/modbusrtu.cpp +++ b/src/modbusrtu.cpp @@ -0,0 +1,6 @@ +/* + * Copyright (c) 2022 Peter M. Groen + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ diff --git a/src/modbusrtu.h b/src/modbusrtu.h index e69de29..3899eaf 100644 --- a/src/modbusrtu.h +++ b/src/modbusrtu.h @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2022 Peter M. Groen + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + diff --git a/src/modbustcp.cpp b/src/modbustcp.cpp index e69de29..fdaffcf 100644 --- a/src/modbustcp.cpp +++ b/src/modbustcp.cpp @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022 Peter M. Groen + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +#include "modbustcp.h" + +using namespace osdev::components::modbus; + +ModbusTcp::ModbusTcp(const ConnectionConfig &con_config) +{ + +} + +bool ModbusTcp::Open() const +{ + +} + +bool ModbusTcp::Close() const +{ + +} + +int ModbusTcp::Read(uint8_t *buffer) const +{ + +} + +int ModbusTcp::Write(uint8_t *buffer, size_t length) const +{ + +} diff --git a/src/modbustcp.h b/src/modbustcp.h index e69de29..243ad2c 100644 --- a/src/modbustcp.h +++ b/src/modbustcp.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2022 Peter M. Groen + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +#pragma once + +#include "imodbusport.h" + +namespace osdev { +namespace components { +namespace modbus { + +class ModbusTcp : public IModbusPort +{ +public: + explicit ModbusTcp(const ConnectionConfig &con_config); + virtual ~ModbusTcp() {} + + // The standard device interface. + // Implementation of IModbusPort + virtual bool Open() const override; + virtual bool Close() const override; + virtual int Read(uint8_t *buffer) const override; + virtual int Write(uint8_t *buffer, size_t length) const override; +}; + +} /* End namespace modbus */ +} /* End namespace components */ +} /* End namespace osdev */