1 #ifndef H_EXTENSIONS_CUTEHMI_MODBUS_2_INCLUDE_CUTEHMI_MODBUS_INTERNAL_QTSERVERBACKEND_HPP
2 #define H_EXTENSIONS_CUTEHMI_MODBUS_2_INCLUDE_CUTEHMI_MODBUS_INTERNAL_QTSERVERBACKEND_HPP
6 #include "AbstractServerBackend.hpp"
10 #include <QModbusServer>
29 void coilsWritten(quint16 address, quint16 amount);
31 void discreteInputsWritten(quint16 address, quint16 amount);
33 void holdingRegistersWritten(quint16 address, quint16 amount);
35 void inputRegistersWritten(quint16 address, quint16 amount);
40 virtual int slaveId()
const = 0;
42 virtual void configureConnection() = 0;
46 bool proceedRequest(
QUuid requestId)
override;
48 void readCoils(
QUuid requestId, quint16 startAddress, quint16 endAddress)
override;
50 void writeCoil(
QUuid requestId, quint16 address,
bool value)
override;
52 void writeMultipleCoils(
QUuid requestId, quint16 startAddress,
const QVector<quint16> & values)
override;
54 void readDiscreteInputs(
QUuid requestId, quint16 startAddress, quint16 endAddress)
override;
56 void writeDiscreteInput(
QUuid requestId, quint16 address,
bool value)
override;
58 void writeMultipleDiscreteInputs(
QUuid requestId, quint16 startAddress,
const QVector<quint16> & values)
override;
60 void readHoldingRegisters(
QUuid requestId, quint16 startAddress, quint16 endAddress)
override;
62 void writeHoldingRegister(
QUuid requestId, quint16 address, quint16 value)
override;
64 void writeMultipleHoldingRegisters(
QUuid requestId, quint16 startAddress,
const QVector<quint16> & values)
override;
66 void readInputRegisters(
QUuid requestId, quint16 startAddress, quint16 endAddress)
override;
68 void writeInputRegister(
QUuid requestId, quint16 address, quint16 value)
override;
70 void writeMultipleInputRegisters(
QUuid requestId, quint16 startAddress,
const QVector<quint16> & values)
override;
75 void close()
override;
77 void setBusy(
bool busy)
override;
85 void onDataWritten(QModbusDataUnit::RegisterType table,
int address,
int size);
87 void onStateChanged(QModbusDevice::State state);
89 void onErrorOccurred(QModbusDevice::Error error);