1#ifndef H_EXTENSIONS_CUTEHMI_MODBUS_4_INCLUDE_CUTEHMI_MODBUS_RTUSERVER_HPP
2#define H_EXTENSIONS_CUTEHMI_MODBUS_4_INCLUDE_CUTEHMI_MODBUS_RTUSERVER_HPP
4#include "AbstractServer.hpp"
5#include "internal/RegisterTraits.hpp"
6#include "internal/QtRTUServerBackend.hpp"
8#include <cutehmi/macros.hpp>
11#include <QStateMachine>
41 Q_PROPERTY(
QString port READ port WRITE setPort NOTIFY portChanged)
42 Q_PROPERTY(QSerialPort::Parity parity READ parity WRITE setParity NOTIFY parityChanged)
43 Q_PROPERTY(QSerialPort::BaudRate baudRate READ baudRate WRITE setBaudRate NOTIFY baudRateChanged)
44 Q_PROPERTY(QSerialPort::DataBits dataBits READ dataBits WRITE setDataBits NOTIFY dataBitsChanged)
45 Q_PROPERTY(QSerialPort::StopBits stopBits READ stopBits WRITE setStopBits NOTIFY stopBitsChanged)
46 Q_PROPERTY(
int slaveAddress READ slaveAddress WRITE setSlaveAddress NOTIFY slaveAddressChanged)
54 void setPort(
const QString & port);
56 QSerialPort::Parity parity()
const;
58 void setParity(QSerialPort::Parity);
60 QSerialPort::BaudRate baudRate()
const;
62 void setBaudRate(QSerialPort::BaudRate baudRate);
64 QSerialPort::DataBits dataBits()
const;
66 void setDataBits(QSerialPort::DataBits dataBits);
68 QSerialPort::StopBits stopBits()
const;
70 void setStopBits(QSerialPort::StopBits stopBits);
72 int slaveAddress()
const;
74 void setSlaveAddress(
int slaveAddress);
76 void setBusy(
bool busy)
override;
81 void close()
override;
107 backend(& config, coilData, discreteInputData, holdingRegisterData, inputRegisterData)
Abstract server.
Definition: AbstractServer.hpp:19
Definition: RTUServer.hpp:19
static const char * INITIAL_PORT
Definition: RTUServer.hpp:26
void slaveAddressChanged()
TCP server backend.
Definition: QtRTUServerBackend.hpp:17
RegisterTraits< DiscreteInput >::Container DiscreteInputDataContainer
Definition: QtRTUServer.hpp:32
RegisterTraits< InputRegister >::Container InputRegisterDataContainer
Definition: QtRTUServer.hpp:34
RegisterTraits< HoldingRegister >::Container HoldingRegisterDataContainer
Definition: QtRTUServer.hpp:33
RegisterTraits< Coil >::Container CoilDataContainer
Definition: QtRTUServer.hpp:31
Definition: RTUServerConfig.hpp:17
static constexpr int MAX_SLAVE_ADDRESS
Definition: RTUServerConfig.hpp:24
static constexpr QSerialPort::Parity INITIAL_PARITY
Definition: RTUServerConfig.hpp:26
static constexpr int INITIAL_INPUT_REGISTERS_ADDRESS_RANGE_MAX
Definition: RTUServerConfig.hpp:38
static constexpr int INITIAL_COILS_ADDRESS_RANGE_MIN
Definition: RTUServerConfig.hpp:31
static constexpr int INITIAL_DISCRETE_INPUTS_ADDRESS_RANGE_MIN
Definition: RTUServerConfig.hpp:33
static constexpr int INITIAL_SLAVE_ADDRESS
Definition: RTUServerConfig.hpp:30
static constexpr QSerialPort::DataBits INITIAL_DATA_BITS
Definition: RTUServerConfig.hpp:28
static constexpr QSerialPort::StopBits INITIAL_STOP_BITS
Definition: RTUServerConfig.hpp:29
static constexpr QSerialPort::BaudRate INITIAL_BAUD_RATE
Definition: RTUServerConfig.hpp:27
static constexpr int INITIAL_HOLDING_REGISTERS_ADDRESS_RANGE_MIN
Definition: RTUServerConfig.hpp:35
static constexpr int INITIAL_HOLDING_REGISTERS_ADDRESS_RANGE_MAX
Definition: RTUServerConfig.hpp:36
static constexpr int INITIAL_DISCRETE_INPUTS_ADDRESS_RANGE_MAX
Definition: RTUServerConfig.hpp:34
static constexpr int INITIAL_COILS_ADDRESS_RANGE_MAX
Definition: RTUServerConfig.hpp:32
static constexpr int INITIAL_INPUT_REGISTERS_ADDRESS_RANGE_MIN
Definition: RTUServerConfig.hpp:37
static constexpr int MIN_SLAVE_ADDRESS
Definition: RTUServerConfig.hpp:23