1 #ifndef H_EXTENSIONS_CUTEHMI_MODBUS_2_INCLUDE_CUTEHMI_MODBUS_INTERNAL_ABSTRACTDEVICEBACKEND_HPP
2 #define H_EXTENSIONS_CUTEHMI_MODBUS_2_INCLUDE_CUTEHMI_MODBUS_INTERNAL_ABSTRACTDEVICEBACKEND_HPP
5 #include "RegisterTraits.hpp"
7 #include <cutehmi/InplaceError.hpp>
8 #include <cutehmi/modbus/AbstractClient.hpp>
11 #include <QJsonObject>
40 void closeRequested();
45 virtual bool proceedRequest(
QUuid requestId) = 0;
47 virtual void readCoils(
QUuid requestId, quint16 startAddress, quint16 endAddress);
49 virtual void writeCoil(
QUuid requestId, quint16 address,
bool value);
51 virtual void writeMultipleCoils(
QUuid requestId, quint16 startAddress,
const QVector<quint16> & values);
53 virtual void readDiscreteInputs(
QUuid requestId, quint16 startAddress, quint16 endAddress);
55 virtual void writeDiscreteInput(
QUuid requestId, quint16 address,
bool value);
57 virtual void writeMultipleDiscreteInputs(
QUuid requestId, quint16 startAddress,
const QVector<quint16> & values);
59 virtual void readHoldingRegisters(
QUuid requestId, quint16 startAddress, quint16 endAddress);
61 virtual void writeHoldingRegister(
QUuid requestId, quint16 address, quint16 value);
63 virtual void writeMultipleHoldingRegisters(
QUuid requestId, quint16 startAddress,
const QVector<quint16> & values);
65 virtual void readInputRegisters(
QUuid requestId, quint16 startAddress, quint16 endAddress);
67 virtual void writeInputRegister(
QUuid requestId, quint16 address, quint16 value);
69 virtual void writeMultipleInputRegisters(
QUuid requestId, quint16 startAddress,
const QVector<quint16> & values);
71 virtual void readExceptionStatus(
QUuid requestId);
75 virtual void fetchCommEventCounter(
QUuid requestId);
77 virtual void fetchCommEventLog(
QUuid requestId);
79 virtual void reportSlaveId(
QUuid requestId);
81 virtual void readFileRecord(
QUuid requestId, quint8 byteCount,
QJsonArray subrequests);
83 virtual void writeFileRecord(
QUuid requestId, quint8 byteCount,
QJsonArray subrequests);
85 virtual void maskWriteHoldingRegister(
QUuid requestId, quint16 address, quint16 andMask, quint16 orMask);
87 virtual void readWriteMultipleHoldingRegisters(
QUuid requestId, quint16 readStartAddress, quint16 readEndAddress, quint16 writeAddress,
const QVector<quint16> & values);
89 virtual void readFIFOQueue(
QUuid requestId, quint16 address);
92 virtual void open() = 0;
94 virtual void close() = 0;
97 void replyIllegalFunction(
QUuid requestId);