2#ifndef ModbusRTUSlave_H_
3#define ModbusRTUSlave_H_
6#include <unordered_set>
9#include "Configuration.h"
10#include "PassiveTimer.h"
12#include "ModbusTypes.h"
13#include "ModbusServer.h"
30 ModbusRTUSlave(
const std::string&
dev,
bool use485 =
false,
bool tr_ctl =
false );
34 void setSpeed( ComPort::Speed s );
35 void setSpeed(
const std::string& s );
36 ComPort::Speed getSpeed();
38 void setParity( ComPort::Parity p );
39 void setParity(
const std::string& p );
41 void setStopBits( ComPort::StopBits b );
42 void setCharSize( ComPort::CharacterSize s );
44 virtual void cleanupChannel()
override
49 virtual void terminate()
override;
50 virtual bool isActive()
const override;
54 virtual ModbusRTU::mbErrCode
realReceive(
const std::unordered_set<ModbusRTU::ModbusAddr>& vmbaddr, timeout_t msecTimeout )
override;
57 virtual size_t getNextData(
unsigned char* buf,
int len )
override;
59 virtual ModbusRTU::mbErrCode sendData(
unsigned char* buf,
int len )
override;
Definition ModbusRTUSlave.h:28
virtual void setChannelTimeout(timeout_t msec) override
Definition ModbusRTUSlave.cc:138
std::string dev
Definition ModbusRTUSlave.h:61
ComPort * port
Definition ModbusRTUSlave.h:62
virtual size_t getNextData(unsigned char *buf, int len) override
Definition ModbusRTUSlave.cc:132
virtual ModbusRTU::mbErrCode realReceive(const std::unordered_set< ModbusRTU::ModbusAddr > &vmbaddr, timeout_t msecTimeout) override
Definition ModbusRTUSlave.cc:176
Definition ModbusServer.h:33
Definition Calibration.h:27