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 QOPEN62541CLIENT_H |
5 | #define QOPEN62541CLIENT_H |
6 | |
7 | #include "qopen62541.h" |
8 | #include <private/qopcuaclientimpl_p.h> |
9 | |
10 | #include <QtCore/qtimer.h> |
11 | |
12 | QT_BEGIN_NAMESPACE |
13 | |
14 | class Open62541AsyncBackend; |
15 | |
16 | class QOpen62541Client : public QOpcUaClientImpl |
17 | { |
18 | Q_OBJECT |
19 | |
20 | public: |
21 | explicit QOpen62541Client(const QVariantMap &backendProperties); |
22 | ~QOpen62541Client(); |
23 | |
24 | void connectToEndpoint(const QOpcUaEndpointDescription &endpoint) override; |
25 | void disconnectFromEndpoint() override; |
26 | |
27 | QOpcUaNode *node(const QString &nodeId) override; |
28 | |
29 | QString backend() const override; |
30 | |
31 | bool requestEndpoints(const QUrl &url) override; |
32 | |
33 | bool findServers(const QUrl &url, const QStringList &localeIds, const QStringList &serverUris) override; |
34 | |
35 | bool readNodeAttributes(const QList<QOpcUaReadItem> &nodesToRead) override; |
36 | bool writeNodeAttributes(const QList<QOpcUaWriteItem> &nodesToWrite) override; |
37 | |
38 | QOpcUaHistoryReadResponse *readHistoryData(const QOpcUaHistoryReadRawRequest &request) override; |
39 | QOpcUaHistoryReadResponse *readHistoryEvents(const QOpcUaHistoryReadEventRequest &request) override; |
40 | |
41 | bool addNode(const QOpcUaAddNodeItem &nodeToAdd) override; |
42 | bool deleteNode(const QString &nodeId, bool deleteTargetReferences) override; |
43 | |
44 | bool addReference(const QOpcUaAddReferenceItem &referenceToAdd) override; |
45 | bool deleteReference(const QOpcUaDeleteReferenceItem &referenceToDelete) override; |
46 | |
47 | QStringList supportedSecurityPolicies() const override; |
48 | QList<QOpcUaUserTokenPolicy::TokenType> supportedUserTokenTypes() const override; |
49 | |
50 | Q_INVOKABLE bool handleHistoryReadRawRequested(const QOpcUaHistoryReadRawRequest &request, const QList<QByteArray> &continuationPoints, |
51 | bool releaseContinuationPoints, quint64 handle); |
52 | |
53 | bool registerNodes(const QStringList &nodesToRegister) override; |
54 | bool unregisterNodes(const QStringList &nodesToUnregister) override; |
55 | |
56 | bool handleHistoryReadEventsRequested(const QOpcUaHistoryReadEventRequest &request, const QList<QByteArray> &continuationPoints, |
57 | bool releaseContinuationPoints, quint64 handle); |
58 | |
59 | signals: |
60 | void historyReadRequestError(quint64 handle); |
61 | |
62 | private slots: |
63 | |
64 | private: |
65 | friend class QOpen62541Node; |
66 | QThread *m_thread; |
67 | Open62541AsyncBackend *m_backend; |
68 | |
69 | #ifdef UA_ENABLE_ENCRYPTION |
70 | bool m_hasSha1SignatureSupport = false; |
71 | #endif |
72 | }; |
73 | |
74 | QT_END_NAMESPACE |
75 | |
76 | #endif // QOPEN62541CLIENT_H |
77 |
Definitions
Learn Advanced QML with KDAB
Find out more