|
| 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 void | terminate () override |
|
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 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 | readCoilStatus (ModbusRTU::ReadCoilMessage &query, ModbusRTU::ReadCoilRetMessage &reply)=0 |
|
virtual ModbusRTU::mbErrCode | readInputStatus (ModbusRTU::ReadInputStatusMessage &query, ModbusRTU::ReadInputStatusRetMessage &reply)=0 |
|
virtual ModbusRTU::mbErrCode | readOutputRegisters (ModbusRTU::ReadOutputMessage &query, ModbusRTU::ReadOutputRetMessage &reply)=0 |
|
virtual ModbusRTU::mbErrCode | readInputRegisters (ModbusRTU::ReadInputMessage &query, ModbusRTU::ReadInputRetMessage &reply)=0 |
|
virtual ModbusRTU::mbErrCode | forceSingleCoil (ModbusRTU::ForceSingleCoilMessage &query, ModbusRTU::ForceSingleCoilRetMessage &reply)=0 |
|
virtual ModbusRTU::mbErrCode | writeOutputSingleRegister (ModbusRTU::WriteSingleOutputMessage &query, ModbusRTU::WriteSingleOutputRetMessage &reply)=0 |
|
virtual ModbusRTU::mbErrCode | forceMultipleCoils (ModbusRTU::ForceCoilsMessage &query, ModbusRTU::ForceCoilsRetMessage &reply)=0 |
|
virtual ModbusRTU::mbErrCode | writeOutputRegisters (ModbusRTU::WriteOutputMessage &query, ModbusRTU::WriteOutputRetMessage &reply)=0 |
|
virtual ModbusRTU::mbErrCode | diagnostics (ModbusRTU::DiagnosticMessage &query, ModbusRTU::DiagnosticRetMessage &reply)=0 |
|
virtual ModbusRTU::mbErrCode | read4314 (ModbusRTU::MEIMessageRDI &query, ModbusRTU::MEIMessageRetRDI &reply)=0 |
|
virtual ModbusRTU::mbErrCode | journalCommand (ModbusRTU::JournalCommandMessage &query, ModbusRTU::JournalCommandRetMessage &reply)=0 |
|
virtual ModbusRTU::mbErrCode | setDateTime (ModbusRTU::SetDateTimeMessage &query, ModbusRTU::SetDateTimeRetMessage &reply)=0 |
|
virtual ModbusRTU::mbErrCode | remoteService (ModbusRTU::RemoteServiceMessage &query, ModbusRTU::RemoteServiceRetMessage &reply)=0 |
|
virtual ModbusRTU::mbErrCode | fileTransfer (ModbusRTU::FileTransferMessage &query, ModbusRTU::FileTransferRetMessage &reply)=0 |
|
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 () |
|
ModbusTCPServer Реализация сервера на основе libev. Поддерживается "много" соединений (постоянных). Хоть класс и наследуется от ModbusServer на самом деле он не реализует его функции, каждое соединение обслуживается классом ModbusTCPSession. Но собственно реализация функций одна на всех, это следует учитывать при реализации обработчиков, т.к.из многих "соединений" будут вызываться одни и те же обработчики.