summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-07-30 03:03:24 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-07-30 03:03:29 +0200
commitdf2f3de89a3659d767f93e98d0774e54845b8b46 (patch)
tree84aceb89cf4b6315e23ee08a9fc9894f11103c91
parent42980b31c57cf7a93c7015df5cd1820db0f4d08b (diff)
parent80b2392b6125b8e0d941063a360076f15bc93abd (diff)
Merge "Merge remote-tracking branch 'origin/5.13' into dev"
-rw-r--r--src/opcua/client/qopcuaapplicationidentity.cpp4
-rw-r--r--src/opcua/client/qopcuaextensionobject.cpp32
-rw-r--r--src/opcua/client/qopcuaextensionobject.h3
-rw-r--r--src/opcua/client/qopcuapkiconfiguration.cpp2
-rw-r--r--src/opcua/core/qopcuaprovider.cpp5
-rw-r--r--src/plugins/opcua/uacpp/quacppbackend.cpp2
-rw-r--r--src/plugins/opcua/uacpp/quacppclient.cpp8
-rw-r--r--tests/auto/declarative/SubscriptionsTest.qml6
8 files changed, 57 insertions, 5 deletions
diff --git a/src/opcua/client/qopcuaapplicationidentity.cpp b/src/opcua/client/qopcuaapplicationidentity.cpp
index 74b2bfe..bf76d7e 100644
--- a/src/opcua/client/qopcuaapplicationidentity.cpp
+++ b/src/opcua/client/qopcuaapplicationidentity.cpp
@@ -63,8 +63,8 @@ QT_BEGIN_NAMESPACE
.arg(QCoreApplication::organizationName())
.arg(QCoreApplication::applicationName());
- identity.setProductUri(QUrl::toPercentEncoding(productUri));
- identity.setApplicationUri(QUrl::toPercentEncoding(applicationUri));
+ identity.setProductUri(productUri);
+ identity.setApplicationUri(applicationUri);
identity.setApplicationName(QCoreApplication::applicationName());
identity.setApplicationType(QOpcUaApplicationDescription::Client);
diff --git a/src/opcua/client/qopcuaextensionobject.cpp b/src/opcua/client/qopcuaextensionobject.cpp
index fce6ab7..cb2d884 100644
--- a/src/opcua/client/qopcuaextensionobject.cpp
+++ b/src/opcua/client/qopcuaextensionobject.cpp
@@ -156,6 +156,38 @@ void QOpcUaExtensionObject::setEncodedBody(const QByteArray &encodedBody)
}
/*!
+ \since 5.13
+
+ Sets the body of this extension object to \a encodedBody,
+ sets the encoding of the body to \l Encoding::ByteString and
+ sets the type id of the encoded data to \a typeId.
+
+ \sa setEncodedBody() setEncoding() setEncodingTypeId()
+*/
+void QOpcUaExtensionObject::setBinaryEncodedBody(const QByteArray &encodedBody, const QString &typeId)
+{
+ setEncodedBody(encodedBody);
+ setEncoding(Encoding::ByteString);
+ setEncodingTypeId(typeId);
+}
+
+/*!
+ \since 5.13
+
+ Sets the body of this extension object to \a encodedBody,
+ sets the encoding of the body to \l Encoding::Xml and
+ sets the type id of the encoded data to \a typeId.
+
+ \sa setEncodedBody() setEncoding() setEncodingTypeId()
+*/
+void QOpcUaExtensionObject::setXmlEncodedBody(const QByteArray &encodedBody, const QString &typeId)
+{
+ setEncodedBody(encodedBody);
+ setEncoding(Encoding::Xml);
+ setEncodingTypeId(typeId);
+}
+
+/*!
Returns the node id of the encoding for the type stored by this extension object, for example ns=0;i=886 for
Range_Encoding_DefaultBinary. All encoding ids are listed in \l {https://opcfoundation.org/UA/schemas/1.03/NodeIds.csv}.
*/
diff --git a/src/opcua/client/qopcuaextensionobject.h b/src/opcua/client/qopcuaextensionobject.h
index 2d4a000..57b3e75 100644
--- a/src/opcua/client/qopcuaextensionobject.h
+++ b/src/opcua/client/qopcuaextensionobject.h
@@ -68,6 +68,9 @@ public:
QByteArray &encodedBodyRef();
void setEncodedBody(const QByteArray &encodedBody);
+ void setBinaryEncodedBody(const QByteArray &encodedBody, const QString &typeId);
+ void setXmlEncodedBody(const QByteArray &encodedBody, const QString &typeId);
+
QOpcUaExtensionObject::Encoding encoding() const;
void setEncoding(QOpcUaExtensionObject::Encoding encoding);
diff --git a/src/opcua/client/qopcuapkiconfiguration.cpp b/src/opcua/client/qopcuapkiconfiguration.cpp
index 5c92740..e0ae67e 100644
--- a/src/opcua/client/qopcuapkiconfiguration.cpp
+++ b/src/opcua/client/qopcuapkiconfiguration.cpp
@@ -264,7 +264,7 @@ bool QOpcUaPkiConfiguration::isPkiValid() const
return !issuerListDirectory().isEmpty() &&
!issuerRevocationListDirectory().isEmpty() &&
!revocationListDirectory().isEmpty() &&
- !trustListDirectory().isEmpty();
+ !trustListDirectory().isEmpty();
}
QT_END_NAMESPACE
diff --git a/src/opcua/core/qopcuaprovider.cpp b/src/opcua/core/qopcuaprovider.cpp
index f3dc589..3a474a6 100644
--- a/src/opcua/core/qopcuaprovider.cpp
+++ b/src/opcua/core/qopcuaprovider.cpp
@@ -229,6 +229,11 @@ static QOpcUaPlugin *loadPlugin(const QString &key)
\li Unified Automation
\li By default, the backend refuses to connect to endpoints without encryption to avoid
sending passwords in clear text. This parameter allows to disable this feature.
+ \row
+ \li enableVerboseDebugOutput
+ \li Unified Automation
+ \li Tells the backend to print additional output to the terminal. The backend specific logging
+ level is set to \c OPCUA_TRACE_OUTPUT_LEVEL_ALL.
\endtable
*/
QOpcUaClient *QOpcUaProvider::createClient(const QString &backend, const QVariantMap &backendProperties)
diff --git a/src/plugins/opcua/uacpp/quacppbackend.cpp b/src/plugins/opcua/uacpp/quacppbackend.cpp
index 318b2e2..bff66a8 100644
--- a/src/plugins/opcua/uacpp/quacppbackend.cpp
+++ b/src/plugins/opcua/uacpp/quacppbackend.cpp
@@ -333,7 +333,7 @@ void UACppAsyncBackend::connectToEndpoint(const QOpcUaEndpointDescription &endpo
if (result.isNotGood()) {
emit stateAndOrErrorChanged(QOpcUaClient::Disconnected, QOpcUaClient::AccessDenied);
- qCWarning(QT_OPCUA_PLUGINS_UACPP) << "Failed to connect: " << QString::fromUtf8(result.toString().toUtf8());
+ qCWarning(QT_OPCUA_PLUGINS_UACPP) << "Failed to connect:" << QString::fromUtf8(result.toString().toUtf8());
return;
}
}
diff --git a/src/plugins/opcua/uacpp/quacppclient.cpp b/src/plugins/opcua/uacpp/quacppclient.cpp
index dcf90a9..b453310 100644
--- a/src/plugins/opcua/uacpp/quacppclient.cpp
+++ b/src/plugins/opcua/uacpp/quacppclient.cpp
@@ -40,6 +40,8 @@
#include <QtCore/QUrl>
#include <QtCore/QUuid>
+#include <opcua_trace.h>
+
QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(QT_OPCUA_PLUGINS_UACPP)
@@ -53,6 +55,12 @@ QUACppClient::QUACppClient(const QVariantMap &backendProperties)
m_backend->m_disableEncryptedPasswordCheck = true;
}
+ if (backendProperties.value(QLatin1String("enableVerboseDebugOutput"), false).toBool()) {
+ OpcUa_Trace_Initialize();
+ OpcUa_Trace_ChangeTraceLevel(OPCUA_TRACE_OUTPUT_LEVEL_ALL);
+ OpcUa_Trace_Toggle(true);
+ }
+
m_thread = new QThread();
connectBackendWithClient(m_backend);
m_backend->moveToThread(m_thread);
diff --git a/tests/auto/declarative/SubscriptionsTest.qml b/tests/auto/declarative/SubscriptionsTest.qml
index cad8ff5..97de353 100644
--- a/tests/auto/declarative/SubscriptionsTest.qml
+++ b/tests/auto/declarative/SubscriptionsTest.qml
@@ -120,7 +120,11 @@ Item {
compare(node1IntervalSpy.count, 0);
compare(node1.monitored, true);
- // This needs to be reset to "Value" for follow up tests to succeed.
+ // Wait for values to settle
+ tryCompare(node1, "value", "bar");
+
+ // The value needs to be reset to "Value" for follow up tests to succeed.
+ node1ValueSpy.clear();
node2.value = "Value";
node1ValueSpy.wait();
compare(node1ValueSpy.count, 1);