summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Keller <Rainer.Keller@qt.io>2019-07-18 13:58:15 +0200
committerRainer Keller <Rainer.Keller@qt.io>2019-07-30 14:43:36 +0200
commit4e75905d01b6a8aac987613cd4798fff1126dd4a (patch)
tree63a9e631279a6a26212f2ed9e51603d856dd8029
parent90c961bd4506e3c08136595b7a92306ecc14f6f6 (diff)
open62541: Print warning when encoded data is ignored
Then the user provides encoded data but forgot to set any encoding type it will not be silently dropped anymore. Change-Id: I519d7442978773f864835385550c599b92975c04 Reviewed-by: Jannis Völker <jannis.voelker@basyskom.com>
-rw-r--r--src/plugins/opcua/open62541/qopen62541valueconverter.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/opcua/open62541/qopen62541valueconverter.cpp b/src/plugins/opcua/open62541/qopen62541valueconverter.cpp
index 15e5b91..d044c5c 100644
--- a/src/plugins/opcua/open62541/qopen62541valueconverter.cpp
+++ b/src/plugins/opcua/open62541/qopen62541valueconverter.cpp
@@ -661,6 +661,10 @@ void createExtensionObject(QByteArray &data, const UA_NodeId &typeEncodingId, UA
{
UA_ExtensionObject obj;
UA_ExtensionObject_init(&obj);
+
+ if (!data.isEmpty() && encoding == QOpcUaExtensionObject::Encoding::NoBody)
+ qCWarning(QT_OPCUA_PLUGINS_OPEN62541) << "Data for extension object provided but will not be encoded because encoding format is set to skip the body";
+
if (encoding != QOpcUaExtensionObject::Encoding::NoBody) {
obj.encoding = static_cast<UA_ExtensionObjectEncoding>(encoding);
obj.content.encoded.body.data = reinterpret_cast<UA_Byte *>(data.data());