1 #ifndef H_EXTENSIONS_CUTEHMI_MODBUS_2_INCLUDE_CUTEHMI_MODBUS_INTERNAL_TCPSERVERCONFIG_HPP
2 #define H_EXTENSIONS_CUTEHMI_MODBUS_2_INCLUDE_CUTEHMI_MODBUS_INTERNAL_TCPSERVERCONFIG_HPP
8 #include <QReadWriteLock>
22 static constexpr
int MIN_SLAVE_ADDRESS = 1;
23 static constexpr
int MAX_SLAVE_ADDRESS = 247;
25 static constexpr
int INITIAL_PORT = 502;
26 static constexpr
int INITIAL_SLAVE_ADDRESS = MIN_SLAVE_ADDRESS;
27 static constexpr quint16 INITIAL_COILS_ADDRESS_RANGE_MIN = 0;
28 static constexpr quint16 INITIAL_COILS_ADDRESS_RANGE_MAX = 65535;
29 static constexpr quint16 INITIAL_DISCRETE_INPUTS_ADDRESS_RANGE_MIN = 0;
30 static constexpr quint16 INITIAL_DISCRETE_INPUTS_ADDRESS_RANGE_MAX = 65535;
31 static constexpr quint16 INITIAL_HOLDING_REGISTERS_ADDRESS_RANGE_MIN = 0;
32 static constexpr quint16 INITIAL_HOLDING_REGISTERS_ADDRESS_RANGE_MAX = 65535;
33 static constexpr quint16 INITIAL_INPUT_REGISTERS_ADDRESS_RANGE_MIN = 0;
34 static constexpr quint16 INITIAL_INPUT_REGISTERS_ADDRESS_RANGE_MAX = 65535;
40 void setHost(
const QString & host);
44 void setPort(
int port);
46 int slaveAddress()
const;
48 void setSlaveAddress(
int address);
56 void setInputRegistersAddressRange(
AddressRange addressRange);
60 void setDiscreteInputsAddressRange(
AddressRange addressRange);
64 void setHoldingRegistersAddressRange(
AddressRange addressRange);
70 int port = INITIAL_PORT;
71 int slaveAddress = INITIAL_SLAVE_ADDRESS;
73 AddressRange discreteInputsAddressRange =
AddressRange(INITIAL_DISCRETE_INPUTS_ADDRESS_RANGE_MIN, INITIAL_DISCRETE_INPUTS_ADDRESS_RANGE_MAX);
74 AddressRange holdingRegistersAddressRange =
AddressRange(INITIAL_HOLDING_REGISTERS_ADDRESS_RANGE_MIN, INITIAL_HOLDING_REGISTERS_ADDRESS_RANGE_MAX);
75 AddressRange inputRegistersAddressRange =
AddressRange(INITIAL_INPUT_REGISTERS_ADDRESS_RANGE_MIN, INITIAL_INPUT_REGISTERS_ADDRESS_RANGE_MAX);