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
12QT_BEGIN_NAMESPACE
13
14class Open62541AsyncBackend;
15
16class QOpen62541Client : public QOpcUaClientImpl
17{
18 Q_OBJECT
19
20public:
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
40 bool addNode(const QOpcUaAddNodeItem &nodeToAdd) override;
41 bool deleteNode(const QString &nodeId, bool deleteTargetReferences) override;
42
43 bool addReference(const QOpcUaAddReferenceItem &referenceToAdd) override;
44 bool deleteReference(const QOpcUaDeleteReferenceItem &referenceToDelete) override;
45
46 QStringList supportedSecurityPolicies() const override;
47 QList<QOpcUaUserTokenPolicy::TokenType> supportedUserTokenTypes() const override;
48
49 Q_INVOKABLE bool handleHistoryReadRawRequested(const QOpcUaHistoryReadRawRequest &request, const QList<QByteArray> &continuationPoints,
50 bool releaseContinuationPoints, quint64 handle);
51
52signals:
53 void historyReadRequestError(quint64 handle);
54
55private slots:
56
57private:
58 friend class QOpen62541Node;
59 QThread *m_thread;
60 Open62541AsyncBackend *m_backend;
61
62#ifdef UA_ENABLE_ENCRYPTION
63 bool m_hasSha1SignatureSupport = false;
64#endif
65};
66
67QT_END_NAMESPACE
68
69#endif // QOPEN62541CLIENT_H
70

source code of qtopcua/src/plugins/opcua/open62541/qopen62541client.h