class QOpcUaExtensionObject

The OPC UA ExtensionObject. More

Synopsis

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

This is the Qt OPC UA representation for an extension object. Extension objects are used as a container in OPC UA whenever a non-builtin type is stored in a Variant. It contains information about the type and encoding of the data as well as the data itself encoded with one of the encodings specified in OPC UA part 6. Decoders are supposed to decode extension objects if they can handle the type. If the type is not supported by the decoder, the extension object is not decoded and decoding is left to the user.

class Encoding

Enumerates the possible encodings of the body.

Constant

Description

QOpcUaExtensionObject.NoBody

QOpcUaExtensionObject.ByteString

QOpcUaExtensionObject.Xml

__init__()

Default constructs an extension object with no parameters set.

__init__(arg__1)
Parameters:

arg__1QOpcUaExtensionObject

Constructs an extension object from rhs.

encodedBody()
Return type:

QByteArray

Returns the body of this extension object. It contains the encoded data.

See also

setEncodedBody()

encodedBodyRef()
Return type:

QByteArray

Returns a reference to the body of this extension object.

encoding()
Return type:

Encoding

Returns the encoding of the body.

See also

setEncoding()

encodingTypeId()
Return type:

str

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 https://opcfoundation.org/UA/schemas/1.05/NodeIds.csv .

__eq__(rhs)
Parameters:

rhsQOpcUaExtensionObject

Return type:

bool

Returns true if this extension object has the same value as rhs.

setBinaryEncodedBody(encodedBody, typeId)
Parameters:

Sets the body of this extension object to encodedBody, sets the encoding of the body to ByteString and sets the type id of the encoded data to typeId.

setEncodedBody(encodedBody)
Parameters:

encodedBodyQByteArray

Sets the body of this extension object to encodedBody.

See also

encodedBody()

setEncoding(encoding)
Parameters:

encodingEncoding

Sets the encoding of the body to encoding.

See also

encoding()

setEncodingTypeId(encodingTypeId)
Parameters:

encodingTypeId – str

Sets the node id of the encoding for the type stored by this extension object to encodingTypeId.

See also

encodingTypeId()

setXmlEncodedBody(encodedBody, typeId)
Parameters:

Sets the body of this extension object to encodedBody, sets the encoding of the body to Xml and sets the type id of the encoded data to typeId.