mirror of https://github.com/nymea/nymea.git
Merge PR #515: Allow modbus RTU plugins to request a connection reset
commit
dbcbbfcf97
|
|
@ -167,6 +167,12 @@ bool ModbusRtuMasterImpl::connected() const
|
|||
return m_connected;
|
||||
}
|
||||
|
||||
void ModbusRtuMasterImpl::requestReconnect()
|
||||
{
|
||||
disconnectDevice();
|
||||
connectDevice();
|
||||
}
|
||||
|
||||
bool ModbusRtuMasterImpl::connectDevice()
|
||||
{
|
||||
#ifdef WITH_QTSERIALBUS
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@ public:
|
|||
|
||||
bool connected() const override;
|
||||
|
||||
void requestReconnect() override;
|
||||
|
||||
bool connectDevice();
|
||||
void disconnectDevice();
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@ public:
|
|||
|
||||
virtual bool connected() const = 0;
|
||||
|
||||
virtual void requestReconnect() = 0;
|
||||
|
||||
// Requests
|
||||
virtual ModbusRtuReply *readCoil(int slaveAddress, int registerAddress, quint16 size = 1) = 0;
|
||||
virtual ModbusRtuReply *readDiscreteInput(int slaveAddress, int registerAddress, quint16 size = 1) = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue