class QOpcUaBinaryDataEncoding

QOpcUaBinaryDataEncoding is a partial implementation of the OPC UA binary data encoding described in OPC UA part 6. 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

It offers template functions for encoding and decoding data for reading and writing extension objects.

The following types are supported:

Qt type

OPC UA type

quint8

uint8

qint8

int8

quint16

uint16

qint16

int16

quint32

uint32

qint32

int32

quint64

uint64

qint64

int64

float

float

double

double

QString

String

QOpcUaQualifiedName

QualifiedName

QOpcUaLocalizedText

LocalizedText

QOpcUaEUInformation

EUInformation

QOpcUaRange

Range

QOpcUaComplexNumber

ComplexNumber

QOpcUaDoubleComplexNumber

DoubleComplexNumber

QOpcUaAxisInformation

AxisInformation

QOpcUaXValue

XV

QUuid

GUID

QString node id

NodeId

QByteArray

ByteString

QDateTime

DateTime

UaStatusCode

StatusCode

QOpcUaExpandedNodeId

ExpandedNodeId

QOpcUaExtensionObject

ExtensionObject

QOpcUaArgument

Argument

QOpcUaDiagnosticInfo (since Qt 6.7)

DiagnosticInfo

QOpcUaApplicationRecordDataType

ApplicationRecordDataType

QOpcUaStructureDefinition (since Qt 6.7)

StructureDefintion

QOpcUaStructureField (since Qt 6.7)

StructureField

QOpcUaEnumDefinition (since Qt 6.7)

EnumDefintion

QOpcUaEnumField (since Qt 6.7)

EnumField

QOpcUaVariant (since Qt 6.7)

Variant

QOpcUaDataValue (since Qt 6.7)

DataValue

__init__(buffer)
Parameters:

bufferQByteArray

Constructs a binary data encoding object for the data buffer buffer. buffer must not be deleted as long as this binary data encoding object is used.

__init__(object)
Parameters:

objectQOpcUaExtensionObject

Constructs a binary data encoding object using the encoded body of object as data buffer.

object must not be deleted as long as this binary data encoding object is used.

offset()
Return type:

int

Returns the current offset in the data buffer.

See also

setOffset()

setOffset(offset)
Parameters:

offset – int

Sets the current offset in the data buffer to offset. The first byte in the buffer has the offset 0.

See also

offset()

truncateBufferToOffset()

Truncates the data buffer to the current offset() . If the offset is behind the current buffer size, this method does nothing.

This method can be used to roll back after an unsuccessful encode by setting the old offset and calling truncateBufferToOffset().