1#ifndef H_EXTENSIONS_CUTEHMI_MODBUS_4_INCLUDE_CUTEHMI_MODBUS_INTERNAL_RTUCLIENTCONFIG_HPP
2#define H_EXTENSIONS_CUTEHMI_MODBUS_4_INCLUDE_CUTEHMI_MODBUS_INTERNAL_RTUCLIENTCONFIG_HPP
8#include <QModbusDevice>
9#include <QReadWriteLock>
22 static constexpr int MIN_SLAVE_ADDRESS = 1;
23 static constexpr int MAX_SLAVE_ADDRESS = 247;
25 static constexpr QSerialPort::Parity INITIAL_PARITY = QSerialPort::NoParity;
26 static constexpr QSerialPort::BaudRate INITIAL_BAUD_RATE = QSerialPort::Baud19200;
27 static constexpr QSerialPort::DataBits INITIAL_DATA_BITS = QSerialPort::Data8;
28 static constexpr QSerialPort::StopBits INITIAL_STOP_BITS = QSerialPort::OneStop;
29 static constexpr int INITIAL_SLAVE_ADDRESS = MIN_SLAVE_ADDRESS;
30 static constexpr int INITIAL_TIMEOUT = 1000;
36 void setPort(
const QString & port);
38 QSerialPort::Parity parity()
const;
40 void setParity(QSerialPort::Parity parity);
42 QSerialPort::BaudRate baudRate()
const;
44 void setBaudRate(QSerialPort::BaudRate baudRate);
46 QSerialPort::DataBits dataBits()
const;
48 void setDataBits(QSerialPort::DataBits dataBits);
50 QSerialPort::StopBits stopBits()
const;
52 void setStopBits(QSerialPort::StopBits stopBits);
54 int slaveAddress()
const;
56 void setSlaveAddress(
int slaveAddress);
60 void setTimeout(
int timeout);
66 QSerialPort::Parity parity = INITIAL_PARITY;
67 QSerialPort::BaudRate baudRate = INITIAL_BAUD_RATE;
68 QSerialPort::DataBits dataBits = INITIAL_DATA_BITS;
69 QSerialPort::StopBits stopBits = INITIAL_STOP_BITS;
70 int slaveAddress = INITIAL_SLAVE_ADDRESS;
71 int timeout = INITIAL_TIMEOUT;
Definition: Config.hpp:12
Definition: RTUClientConfig.hpp:18
static const char * INITIAL_PORT
Definition: RTUClientConfig.hpp:24