|
| ModbusTCPServerSlot (const std::string &ia, int port=502) |
|
virtual void | terminate () override |
|
void | connectReadCoil (ReadCoilSlot sl) |
|
void | connectReadInputStatus (ReadInputStatusSlot sl) |
|
void | connectReadOutput (ReadOutputSlot sl) |
|
void | connectReadInput (ReadInputSlot sl) |
|
void | connectForceSingleCoil (ForceSingleCoilSlot sl) |
|
void | connectWriteSingleOutput (WriteSingleOutputSlot sl) |
|
void | connectDiagnostics (DiagnosticsSlot sl) |
|
void | connectMEIRDI (MEIRDISlot sl) |
|
void | connectForceCoils (ForceCoilsSlot sl) |
|
void | connectWriteOutput (WriteOutputSlot sl) |
|
void | connectJournalCommand (JournalCommandSlot sl) |
|
void | connectSetDateTime (SetDateTimeSlot sl) |
|
void | connectRemoteService (RemoteServiceSlot sl) |
|
void | connectFileTransfer (FileTransferSlot sl) |
|
| ModbusTCPServer (const std::string &addr, int port=502) |
|
bool | run (const std::unordered_set< ModbusRTU::ModbusAddr > &vmbaddr) |
|
bool | async_run (const std::unordered_set< ModbusRTU::ModbusAddr > &vmbaddr) |
|
virtual bool | isActive () const override |
|
void | setMaxSessions (size_t num) |
|
size_t | getMaxSessions () const noexcept |
|
void | setSessionTimeout (timeout_t msec) |
|
timeout_t | getSessionTimeout () const noexcept |
|
size_t | getCountSessions () const noexcept |
|
void | getSessions (Sessions &lst) |
|
std::string | getInetAddress () const noexcept |
|
int | getInetPort () const noexcept |
|
size_t | getConnectionCount () const noexcept |
|
TimerSignal | signal_timer () |
|
void | setTimer (timeout_t msec) |
|
timeout_t | getTimer () const noexcept |
|
void | setSocketTimeout (timeout_t msec) |
|
timeout_t | getSocketTimeout () const noexcept |
|
bool | evIsActive () const noexcept |
|
void | initLog (uniset::Configuration *conf, const std::string &name, const std::string &logfile="") |
|
void | setLog (std::shared_ptr< DebugStream > dlog) |
|
std::shared_ptr< DebugStream > | log () |
|
ModbusRTU::mbErrCode | receive (const std::unordered_set< ModbusRTU::ModbusAddr > &vaddr, timeout_t msecTimeout) |
|
virtual ModbusRTU::mbErrCode | receive_one (const ModbusRTU::ModbusAddr addr, timeout_t msec) |
|
PreReceiveSignal | signal_pre_receive () |
|
PostReceiveSignal | signal_post_receive () |
|
timeout_t | setAfterSendPause (timeout_t msec) |
|
timeout_t | setReplyTimeout (timeout_t msec) |
|
void | setRecvTimeout (timeout_t msec) |
|
void | setSleepPause (timeout_t msec) |
|
void | setCRCNoCheckit (bool set) |
|
bool | isCRCNoCheckit () const |
|
void | setBroadcastMode (bool set) |
|
bool | getBroadcastMode () const |
|
void | setCleanBeforeSend (bool set) |
|
bool | getCleanBeforeSend () const |
|
virtual void | cleanupChannel () |
|
ExchangeErrorMap | getErrorMap () |
|
size_t | getErrCount (ModbusRTU::mbErrCode e) const |
|
size_t | resetErrCount (ModbusRTU::mbErrCode e, size_t set=0) |
|
size_t | getAskCount () const noexcept |
|
void | resetAskCounter () |
|
|
virtual ModbusRTU::mbErrCode | readCoilStatus (ModbusRTU::ReadCoilMessage &query, ModbusRTU::ReadCoilRetMessage &reply) override |
|
virtual ModbusRTU::mbErrCode | readInputStatus (ModbusRTU::ReadInputStatusMessage &query, ModbusRTU::ReadInputStatusRetMessage &reply) override |
|
virtual ModbusRTU::mbErrCode | readOutputRegisters (ModbusRTU::ReadOutputMessage &query, ModbusRTU::ReadOutputRetMessage &reply) override |
|
virtual ModbusRTU::mbErrCode | readInputRegisters (ModbusRTU::ReadInputMessage &query, ModbusRTU::ReadInputRetMessage &reply) override |
|
virtual ModbusRTU::mbErrCode | forceSingleCoil (ModbusRTU::ForceSingleCoilMessage &query, ModbusRTU::ForceSingleCoilRetMessage &reply) override |
|
virtual ModbusRTU::mbErrCode | writeOutputSingleRegister (ModbusRTU::WriteSingleOutputMessage &query, ModbusRTU::WriteSingleOutputRetMessage &reply) override |
|
virtual ModbusRTU::mbErrCode | forceMultipleCoils (ModbusRTU::ForceCoilsMessage &query, ModbusRTU::ForceCoilsRetMessage &reply) override |
|
virtual ModbusRTU::mbErrCode | writeOutputRegisters (ModbusRTU::WriteOutputMessage &query, ModbusRTU::WriteOutputRetMessage &reply) override |
|
virtual ModbusRTU::mbErrCode | diagnostics (ModbusRTU::DiagnosticMessage &query, ModbusRTU::DiagnosticRetMessage &reply) override |
|
virtual ModbusRTU::mbErrCode | read4314 (ModbusRTU::MEIMessageRDI &query, ModbusRTU::MEIMessageRetRDI &reply) override |
|
virtual ModbusRTU::mbErrCode | journalCommand (ModbusRTU::JournalCommandMessage &query, ModbusRTU::JournalCommandRetMessage &reply) override |
|
virtual ModbusRTU::mbErrCode | setDateTime (ModbusRTU::SetDateTimeMessage &query, ModbusRTU::SetDateTimeRetMessage &reply) override |
|
virtual ModbusRTU::mbErrCode | remoteService (ModbusRTU::RemoteServiceMessage &query, ModbusRTU::RemoteServiceRetMessage &reply) override |
|
virtual ModbusRTU::mbErrCode | fileTransfer (ModbusRTU::FileTransferMessage &query, ModbusRTU::FileTransferRetMessage &reply) override |
|
virtual void | iowait (timeout_t msec) override |
|
virtual ModbusRTU::mbErrCode | realReceive (const std::unordered_set< ModbusRTU::ModbusAddr > &vaddr, timeout_t msecTimeout) override |
|
virtual void | evprepare () override |
|
virtual void | evfinish () override |
|
virtual void | ioAccept (ev::io &watcher, int revents) |
|
void | onTimer (ev::timer &t, int revents) |
|
void | onSocketTimeout (ev::timer &t, int revents) |
|
void | onSocketResetTimeout (ev::async &watcher, int revents) noexcept |
|
void | sessionFinished (const ModbusTCPSession *s) |
|
virtual size_t | getNextData (unsigned char *buf, int len) override |
|
virtual ModbusRTU::mbErrCode | sendData (unsigned char *buf, int len) override |
|
virtual void | setChannelTimeout (timeout_t msec) override |
|
bool | async_evrun (size_t waitRunningTimeout_msec=60000) |
|
void | evstop () |
|
bool | evrun () |
|
virtual ModbusRTU::mbErrCode | send (ModbusRTU::ModbusMessage &buf) |
|
virtual ModbusRTU::mbErrCode | make_adu_header (ModbusRTU::ModbusMessage &request) |
|
virtual ModbusRTU::mbErrCode | post_send_request (ModbusRTU::ModbusMessage &request) |
|
virtual ModbusRTU::mbErrCode | processing (ModbusRTU::ModbusMessage &buf) |
|
ModbusRTU::mbErrCode | recv (const std::unordered_set< ModbusRTU::ModbusAddr > &vaddr, ModbusRTU::ModbusMessage &buf, timeout_t timeout) |
|
ModbusRTU::mbErrCode | recv_pdu (ModbusRTU::ModbusMessage &rbuf, timeout_t timeout) |
|
void | printProcessingTime () |
|
|
typedef sigc::slot< ModbusRTU::mbErrCode, ModbusRTU::ReadCoilMessage &, ModbusRTU::ReadCoilRetMessage & > | ReadCoilSlot |
|
typedef sigc::slot< ModbusRTU::mbErrCode, ModbusRTU::ReadInputStatusMessage &, ModbusRTU::ReadInputStatusRetMessage & > | ReadInputStatusSlot |
|
typedef sigc::slot< ModbusRTU::mbErrCode, ModbusRTU::ReadOutputMessage &, ModbusRTU::ReadOutputRetMessage & > | ReadOutputSlot |
|
typedef sigc::slot< ModbusRTU::mbErrCode, ModbusRTU::ReadInputMessage &, ModbusRTU::ReadInputRetMessage & > | ReadInputSlot |
|
typedef sigc::slot< ModbusRTU::mbErrCode, ModbusRTU::ForceSingleCoilMessage &, ModbusRTU::ForceSingleCoilRetMessage & > | ForceSingleCoilSlot |
|
typedef sigc::slot< ModbusRTU::mbErrCode, ModbusRTU::WriteSingleOutputMessage &, ModbusRTU::WriteSingleOutputRetMessage & > | WriteSingleOutputSlot |
|
typedef sigc::slot< ModbusRTU::mbErrCode, ModbusRTU::ForceCoilsMessage &, ModbusRTU::ForceCoilsRetMessage & > | ForceCoilsSlot |
|
typedef sigc::slot< ModbusRTU::mbErrCode, ModbusRTU::WriteOutputMessage &, ModbusRTU::WriteOutputRetMessage & > | WriteOutputSlot |
|
typedef sigc::slot< ModbusRTU::mbErrCode, ModbusRTU::DiagnosticMessage &, ModbusRTU::DiagnosticRetMessage & > | DiagnosticsSlot |
|
typedef sigc::slot< ModbusRTU::mbErrCode, ModbusRTU::MEIMessageRDI &, ModbusRTU::MEIMessageRetRDI & > | MEIRDISlot |
|
typedef sigc::slot< ModbusRTU::mbErrCode, ModbusRTU::JournalCommandMessage &, ModbusRTU::JournalCommandRetMessage & > | JournalCommandSlot |
|
typedef sigc::slot< ModbusRTU::mbErrCode, ModbusRTU::SetDateTimeMessage &, ModbusRTU::SetDateTimeRetMessage & > | SetDateTimeSlot |
|
typedef sigc::slot< ModbusRTU::mbErrCode, ModbusRTU::RemoteServiceMessage &, ModbusRTU::RemoteServiceRetMessage & > | RemoteServiceSlot |
|
typedef sigc::slot< ModbusRTU::mbErrCode, ModbusRTU::FileTransferMessage &, ModbusRTU::FileTransferRetMessage & > | FileTransferSlot |
|
typedef std::list< SessionInfo > | Sessions |
|
typedef sigc::signal< void > | TimerSignal |
|
typedef sigc::signal< ModbusRTU::mbErrCode, const std::unordered_set< ModbusRTU::ModbusAddr >, timeout_t > | PreReceiveSignal |
|
typedef sigc::signal< void, ModbusRTU::mbErrCode > | PostReceiveSignal |
|
typedef std::unordered_map< ModbusRTU::mbErrCode, size_t > | ExchangeErrorMap |
|
static std::unordered_set< ModbusRTU::ModbusAddr > | addr2vaddr (ModbusRTU::ModbusAddr &mbaddr) |
|
static bool | checkAddr (const std::unordered_set< ModbusRTU::ModbusAddr > &vaddr, const ModbusRTU::ModbusAddr addr) |
|
static std::string | vaddr2str (const std::unordered_set< ModbusRTU::ModbusAddr > &vaddr) |
|
static ModbusRTU::mbErrCode | replySetDateTime (ModbusRTU::SetDateTimeMessage &query, ModbusRTU::SetDateTimeRetMessage &reply, std::shared_ptr< DebugStream > dlog=nullptr) |
|
static ModbusRTU::mbErrCode | replyFileTransfer (const std::string &fname, ModbusRTU::FileTransferMessage &query, ModbusRTU::FileTransferRetMessage &reply, std::shared_ptr< DebugStream > dlog=nullptr) |
|
typedef std::list< std::shared_ptr< ModbusTCPSession > > | SessionList |
|
ReadCoilSlot | slReadCoil |
|
ReadInputStatusSlot | slReadInputStatus |
|
ReadOutputSlot | slReadOutputs |
|
ReadInputSlot | slReadInputs |
|
ForceCoilsSlot | slForceCoils |
|
WriteOutputSlot | slWriteOutputs |
|
ForceSingleCoilSlot | slForceSingleCoil |
|
WriteSingleOutputSlot | slWriteSingleOutputs |
|
DiagnosticsSlot | slDiagnostics |
|
MEIRDISlot | slMEIRDI |
|
JournalCommandSlot | slJournalCommand |
|
SetDateTimeSlot | slSetDateTime |
|
RemoteServiceSlot | slRemoteService |
|
FileTransferSlot | slFileTransfer |
|
int | port = { 0 } |
|
std::string | iaddr |
|
std::string | myname |
|
std::queue< unsigned char > | qrecv |
|
ModbusRTU::MBAPHeader | curQueryHeader |
|
std::mutex | sMutex |
|
SessionList | slist |
|
bool | ignoreAddr = { false } |
|
size_t | maxSessions = { 100 } |
|
size_t | sessCount = { 0 } |
|
size_t | connCount = { 0 } |
|
timeout_t | sessTimeout = { 10000 } |
|
ev::io | io |
|
ev::timer | ioTimer |
|
std::shared_ptr< UTCPSocket > | sock |
|
ev::timer | sockTimeout |
|
timeout_t | socketTimeout_msec = { UniSetTimer::WaitUpTime } |
|
double | tmSockTimeout = { 0.0 } |
|
ev::async | asyncResetSockTimeout |
|
std::unordered_set< ModbusRTU::ModbusAddr > | vmbaddr |
|
TimerSignal | m_timer_signal |
|
timeout_t | tmTime_msec = { UniSetTimer::WaitUpTime } |
|
double | tmTime = { 0.0 } |
|
PassiveTimer | ptWait |
|
ev::dynamic_loop | loop |
|
std::timed_mutex | recvMutex |
|
timeout_t | recvTimeOut_ms = { 50 } |
|
timeout_t | replyTimeout_ms = { 2000 } |
|
timeout_t | aftersend_msec = { 0 } |
|
timeout_t | sleepPause_msec = { 10 } |
|
bool | onBroadcast = { false } |
|
bool | crcNoCheckit = { false } |
|
bool | cleanBeforeSend = { false } |
|
PassiveTimer | tmProcessing |
|
std::shared_ptr< DebugStream > | dlog |
|
size_t | askCount = { 0 } |
|
ExchangeErrorMap | errmap |
|
PreReceiveSignal | m_pre_signal |
|
PostReceiveSignal | m_post_signal |
|
ModbusTCP server (slot version)