MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/driver/IModBus.hh

34 lines
757 B
C++
Raw Permalink Normal View History

2024-06-07 11:12:56 +03:00
/*
* IModBusRtu.hh
*
* Created on: 30 июн. 2020 г.
* Author: s.maksimenko
*/
#ifndef UMLIBRARY_DRIVER_IMODBUS_HH_
#define UMLIBRARY_DRIVER_IMODBUS_HH_
#include <stdint.h>
namespace driver {
namespace modbus {
struct IModBusDispatch {
enum Status { Done, Pending, Failure };
virtual Status read ( uint16_t & ) = 0;// Чтение значения DO, DI, AO, AI
virtual Status write ( uint16_t ) = 0;// Запись значения DO, AO
//virtual ~IModBusDispatch () = default;
};
struct IModBus {
virtual void add ( uint16_t nReg, IModBusDispatch & disp ) = 0;
virtual void del ( uint16_t nReg ) = 0;
//virtual ~IModBusRtu () = default;
};
}// namespace modbus
}// namespace driver
#endif /* UMLIBRARY_DRIVER_IMODBUS_HH_ */