MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/driver/IModBus.hh
2024-06-07 11:12:56 +03:00

34 lines
757 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* 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_ */