diff options
author | Rainer Keller <Rainer.Keller@qt.io> | 2019-07-18 13:58:15 +0200 |
---|---|---|
committer | Rainer Keller <Rainer.Keller@qt.io> | 2019-07-23 13:37:39 +0200 |
commit | c417578bfb382919bdf8c3bc2855026b504d08bf (patch) | |
tree | 57dcc5cfde9900c752ea49f8883b830fc7c13cfe | |
parent | 52254ed121dde68293e99b96c4713d360ff6e90a (diff) |
open62541: Print warning when encoded data is ignored5.12.4
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.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/opcua/open62541/qopen62541valueconverter.cpp b/src/plugins/opcua/open62541/qopen62541valueconverter.cpp index f342a8e..8f670b3 100644 --- a/src/plugins/opcua/open62541/qopen62541valueconverter.cpp +++ b/src/plugins/opcua/open62541/qopen62541valueconverter.cpp @@ -699,6 +699,10 @@ void createExtensionObject(QByteArray &data, const UA_NodeId &typeEncodingId, UA { UA_ExtensionObject obj; UA_ExtensionObject_init(&obj); + + if (!data.isEmpty() && encoding == QOpcUa::QExtensionObject::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 != QOpcUa::QExtensionObject::Encoding::NoBody) { obj.encoding = static_cast<UA_ExtensionObjectEncoding>(encoding); obj.content.encoded.body.data = reinterpret_cast<UA_Byte *>(data.data()); |