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

46 lines
1012 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.

/*
* ModbusAction.hh
*
* Created on: 18 мар. 2021 г.
* Author: titov
*/
#ifndef UMLIBRARY_DRIVER_MODBUSACTION_HH_
#define UMLIBRARY_DRIVER_MODBUSACTION_HH_
#include <stdint.h>
#include "../systemic/IFunctor.hh"
#include "IModBus.hh"
namespace driver {
namespace modbus {
//!Действия при обращении к катушке Modbus.
class ModbusAction : public IModBusDispatch {
typedef IModBusDispatch::Status Status;
systemic::IFunctor<void> & action_on;
systemic::IFunctor<void> & action_off;
const bool inversion; //!<Признак инверсии выхода.
bool coil_state; //!<Текущее состояние.
public:
ModbusAction( systemic::IFunctor<void> & action_on, systemic::IFunctor<void> & action_off, bool inversion );
//!Состояние катушки.
const bool & state() const;
Status read( uint16_t & reg );
Status write( uint16_t reg );
};
}
}
#endif /* UMLIBRARY_DRIVER_MODBUSACTION_HH_ */