1 | // Copyright (C) 2017 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QMODBUSRTUSERIALSERVER_H |
5 | #define QMODBUSRTUSERIALSERVER_H |
6 | |
7 | // The pragma is required to generate proper headers for source compatibility. |
8 | #if 0 |
9 | #pragma qt_deprecates(QModbusRtuSerialSlave) |
10 | #endif |
11 | |
12 | #include <QtSerialBus/qmodbusserver.h> |
13 | |
14 | QT_BEGIN_NAMESPACE |
15 | |
16 | class QModbusRtuSerialServerPrivate; |
17 | |
18 | class Q_SERIALBUS_EXPORT QModbusRtuSerialServer : public QModbusServer |
19 | { |
20 | Q_OBJECT |
21 | Q_DECLARE_PRIVATE(QModbusRtuSerialServer) |
22 | |
23 | public: |
24 | explicit QModbusRtuSerialServer(QObject *parent = nullptr); |
25 | ~QModbusRtuSerialServer(); |
26 | |
27 | bool processesBroadcast() const override; |
28 | |
29 | int interFrameDelay() const; |
30 | void setInterFrameDelay(int microseconds); |
31 | |
32 | protected: |
33 | QModbusRtuSerialServer(QModbusRtuSerialServerPrivate &dd, QObject *parent = nullptr); |
34 | |
35 | bool open() override; |
36 | void close() override; |
37 | |
38 | QModbusResponse processRequest(const QModbusPdu &request) override; |
39 | }; |
40 | |
41 | #if QT_DEPRECATED_SINCE(6, 2) |
42 | QT_WARNING_PUSH |
43 | QT_WARNING_DISABLE_GCC("-Wattributes" ) |
44 | using QModbusRtuSerialSlave |
45 | Q_DECL_DEPRECATED_X("Please port your application to QModbusRtuSerialServer." ) = QModbusRtuSerialServer; |
46 | #endif |
47 | QT_WARNING_POP |
48 | QT_END_NAMESPACE |
49 | |
50 | #endif // QMODBUSRTUSERIALSERVER_H |
51 | |