4#include <unordered_set>
7#include "modbus/ModbusTCPServerSlot.h"
14 MBTCPServer(
const std::unordered_set<uniset::ModbusRTU::ModbusAddr>& myaddr,
const std::string& inetaddr,
int port = 502,
bool verbose =
false );
17 inline void setVerbose(
bool state )
22 inline void setReply(
long val )
27 void setRandomReply(
long min,
long max );
29 inline uniset::timeout_t setAfterSendPause( uniset::timeout_t msec )
35 void setLog( std::shared_ptr<DebugStream>& dlog );
37 void setMaxSessions(
size_t max );
41 void sigterm(
int signo );
100 std::unordered_set<uniset::ModbusRTU::ModbusAddr>
vaddr;
102 bool verbose = {
false };
103 long replyVal = { -1 };
104 std::random_device rnd;
105 std::unique_ptr<std::mt19937> gen = {
nullptr };
106 std::unique_ptr<std::uniform_int_distribution<>> rndgen = {
nullptr };
108 typedef std::unordered_map<uniset::ModbusRTU::mbErrCode, unsigned int> ExchangeErrorMap;
109 ExchangeErrorMap errmap;
110 uniset::ModbusRTU::mbErrCode prev;
118 typedef std::unordered_map<int, std::string> FileList;
Definition MBTCPServer.h:12
uniset::ModbusRTU::mbErrCode readOutputRegisters(uniset::ModbusRTU::ReadOutputMessage &query, uniset::ModbusRTU::ReadOutputRetMessage &reply)
Definition MBTester/mbtcpserver.cc:229
uniset::ModbusRTU::mbErrCode readCoilStatus(uniset::ModbusRTU::ReadCoilMessage &query, uniset::ModbusRTU::ReadCoilRetMessage &reply)
Definition MBTester/mbtcpserver.cc:91
uniset::ModbusRTU::mbErrCode writeOutputRegisters(uniset::ModbusRTU::WriteOutputMessage &query, uniset::ModbusRTU::WriteOutputRetMessage &reply)
Definition MBTester/mbtcpserver.cc:284
uniset::ModbusRTU::mbErrCode remoteService(uniset::ModbusRTU::RemoteServiceMessage &query, uniset::ModbusRTU::RemoteServiceRetMessage &reply)
Definition MBTester/mbtcpserver.cc:368
uniset::ModbusRTU::mbErrCode setDateTime(uniset::ModbusRTU::SetDateTimeMessage &query, uniset::ModbusRTU::SetDateTimeRetMessage &reply)
Definition MBTester/mbtcpserver.cc:356
void execute()
Definition MBTester/mbtcpserver.cc:82
uniset::ModbusRTU::mbErrCode journalCommand(uniset::ModbusRTU::JournalCommandMessage &query, uniset::ModbusRTU::JournalCommandRetMessage &reply)
Definition MBTester/mbtcpserver.cc:319
uniset::ModbusRTU::mbErrCode writeOutputSingleRegister(uniset::ModbusRTU::WriteSingleOutputMessage &query, uniset::ModbusRTU::WriteSingleOutputRetMessage &reply)
Definition MBTester/mbtcpserver.cc:296
uniset::ModbusRTU::mbErrCode readInputRegisters(uniset::ModbusRTU::ReadInputMessage &query, uniset::ModbusRTU::ReadInputRetMessage &reply)
Definition MBTester/mbtcpserver.cc:183
uniset::ModbusRTU::mbErrCode forceSingleCoil(uniset::ModbusRTU::ForceSingleCoilMessage &query, uniset::ModbusRTU::ForceSingleCoilRetMessage &reply)
Definition MBTester/mbtcpserver.cc:307
uniset::ModbusRTU::mbErrCode forceMultipleCoils(uniset::ModbusRTU::ForceCoilsMessage &query, uniset::ModbusRTU::ForceCoilsRetMessage &reply)
Definition MBTester/mbtcpserver.cc:273
std::unordered_set< uniset::ModbusRTU::ModbusAddr > vaddr
Definition MBTCPServer.h:100
uniset::ModbusRTU::mbErrCode readInputStatus(uniset::ModbusRTU::ReadInputStatusMessage &query, uniset::ModbusRTU::ReadInputStatusRetMessage &reply)
Definition MBTester/mbtcpserver.cc:140
uniset::ModbusTCPServerSlot * sslot
Definition MBTCPServer.h:99
timeout_t setAfterSendPause(timeout_t msec)
Definition ModbusServer.cc:115
Definition ModbusTCPServerSlot.h:16
Definition ModbusTypes.h:1118
Definition ModbusTypes.h:1176
Definition ModbusTypes.h:1575
Definition ModbusTypes.h:1603
Definition ModbusTypes.h:727
Definition ModbusTypes.h:804
Definition ModbusTypes.h:937
Definition ModbusTypes.h:988
Definition ModbusTypes.h:1310
Definition ModbusTypes.h:1333
Definition ModbusTypes.h:1188
Definition ModbusTypes.h:1243
Definition ModbusTypes.h:347
Definition ModbusTypes.h:378
Definition ModbusTypes.h:548
Definition ModbusTypes.h:577
Definition ModbusTypes.h:1456
Definition ModbusTypes.h:1489
Definition ModbusTypes.h:1398
Definition ModbusTypes.h:1436
Definition ModbusTypes.h:844
Definition ModbusTypes.h:898
Definition ModbusTypes.h:1033
Definition ModbusTypes.h:1079