open62541 1.3.12
Open source implementation of OPC UA
Loading...
Searching...
No Matches
ua_types_encoding_binary.h File Reference
#include <open62541/types.h>

Go to the source code of this file.

Functions

UA_StatusCode UA_encodeBinaryInternal (const void *src, const UA_DataType *type, UA_Byte **bufPos, const UA_Byte **bufEnd, UA_exchangeEncodeBuffer exchangeCallback, void *exchangeHandle)
 
UA_StatusCode UA_decodeBinaryInternal (const UA_ByteString *src, size_t *offset, void *dst, const UA_DataType *type, const UA_DataTypeArray *customTypes)
 
const UA_DataTypeUA_findDataTypeByBinary (const UA_NodeId *typeId)
 

Variables

_UA_BEGIN_DECLS typedef UA_StatusCode(* UA_exchangeEncodeBuffer )(void *handle, UA_Byte **bufPos, const UA_Byte **bufEnd)
 

Function Documentation

◆ UA_encodeBinaryInternal()

UA_StatusCode UA_encodeBinaryInternal ( const void * src,
const UA_DataType * type,
UA_Byte ** bufPos,
const UA_Byte ** bufEnd,
UA_exchangeEncodeBuffer exchangeCallback,
void * exchangeHandle )

Encodes the scalar value described by type in the binary encoding.

Encoding is thread-safe if thread-local variables are enabled. Encoding is also reentrant and can be safely called from signal handlers or interrupts.

Parameters
srcThe value. Must not be NULL.
typeThe value type. Must not be NULL.
bufPosPoints to a pointer to the current position in the encoding buffer. Must not be NULL. The pointer is advanced by the number of encoded bytes, or, if the buffer is exchanged, to the position in the new buffer.
bufEndPoints to a pointer to the end of the encoding buffer (encoding always stops before *buf_end). Must not be NULL. The pointer is changed when the buffer is exchanged.
exchangeCallbackCalled when the end of the buffer is reached. This is used to send out a message chunk before continuing with the encoding. Is ignored if NULL.
exchangeHandleCustom data passed into the exchangeCallback.
Returns
Returns a statuscode whether encoding succeeded.

◆ UA_decodeBinaryInternal()

UA_StatusCode UA_decodeBinaryInternal ( const UA_ByteString * src,
size_t * offset,
void * dst,
const UA_DataType * type,
const UA_DataTypeArray * customTypes )

Decodes a scalar value described by type from binary encoding.

Decoding is thread-safe if thread-local variables are enabled. Decoding is also reentrant and can be safely called from signal handlers or interrupts.

Parameters
srcThe buffer with the binary encoded value. Must not be NULL.
offsetThe current position in the buffer. Must not be NULL. The value is advanced as decoding progresses.
dstThe target value. Must not be NULL. The target is assumed to have size type->memSize. The value is reset to zero before decoding. If decoding fails, members are deleted and the value is reset (zeroed) again.
typeThe value type. Must not be NULL.
customTypesSizeThe number of non-standard datatypes contained in the customTypes array.
customTypesAn array of non-standard datatypes (not included in UA_TYPES). Can be NULL if customTypesSize is zero.
Returns
Returns a statuscode whether decoding succeeded.

◆ UA_findDataTypeByBinary()

const UA_DataType * UA_findDataTypeByBinary ( const UA_NodeId * typeId)

Variable Documentation

◆ UA_exchangeEncodeBuffer

_UA_BEGIN_DECLS typedef UA_StatusCode(* UA_exchangeEncodeBuffer) (void *handle, UA_Byte **bufPos, const UA_Byte **bufEnd) ( void * handle,
UA_Byte ** bufPos,
const UA_Byte ** bufEnd )

This Source Code Form is subject to the terms of the Mozilla Public License, v.

2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Copyright 2014-2017 (c) Fraunhofer IOSB (Author: Julius Pfrommer) Copyright 2015 (c) Sten GrĂ¼ner Copyright 2014, 2017 (c) Florian Palm Copyright 2017 (c) Stefan Profanter, fortiss GmbH Copyright 2017 (c) Mark Giraud, Fraunhofer IOSB

Definition at line 19 of file ua_types_encoding_binary.h.