28#define UA_TRUE true UA_INTERNAL_DEPRECATED
29#define UA_FALSE false UA_INTERNAL_DEPRECATED
33#define UA_SBYTE_MIN (-128)
34#define UA_SBYTE_MAX 127
39#define UA_BYTE_MAX 255
43#define UA_INT16_MIN (-32768)
44#define UA_INT16_MAX 32767
48#define UA_UINT16_MIN 0
49#define UA_UINT16_MAX 65535
53#define UA_INT32_MIN ((int32_t)-2147483648LL)
54#define UA_INT32_MAX 2147483647L
58#define UA_UINT32_MIN 0
59#define UA_UINT32_MAX 4294967295UL
63#define UA_INT64_MAX (int64_t)9223372036854775807LL
64#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
68#define UA_UINT64_MIN 0
69#define UA_UINT64_MAX (uint64_t)18446744073709551615ULL
73#define UA_FLOAT_MIN FLT_MIN
74#define UA_FLOAT_MAX FLT_MAX
78#define UA_DOUBLE_MIN DBL_MIN
79#define UA_DOUBLE_MAX DBL_MAX
96 return ((code >> 30) >= 0x02);
101 return ((code >> 30) == 0x01);
106 return ((code >> 30) == 0x00);
115 return ((s1 & 0xFFFF0000) == (
s2 & 0xFFFF0000));
135 UA_STRING(
char *
chars), {
137 memset(&s, 0,
sizeof(s));
147#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
151typedef int64_t UA_DateTime;
154#define UA_DATETIME_USEC 10LL
155#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
156#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
190#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
193 UA_DateTime_toUnixTime(UA_DateTime date), {
198 UA_DateTime_fromUnixTime(
UA_Int64 unixDate), {
224#ifdef UA_ENABLE_PARSING
229 UA_GUID(
const char *
chars), {
231 UA_Guid_parse(&
guid, UA_STRING((
char*)(uintptr_t)
chars));
256#define UA_BYTESTRING(chars) UA_STRING(chars)
257#define UA_BYTESTRING_ALLOC(chars) UA_STRING_ALLOC(chars)
262 const UA_Byte *data,
size_t size);
310#ifdef UA_ENABLE_PARSING
315 UA_NODEID(
const char *
chars), {
317 UA_NodeId_parse(&
id, UA_STRING((
char*)(uintptr_t)
chars));
328 id.namespaceIndex = nsIndex;
330 id.identifier.numeric = identifier;
338 id.namespaceIndex = nsIndex;
340 id.identifier.string = UA_STRING(
chars);
345 UA_NODEID_STRING_ALLOC(
UA_UInt16 nsIndex,
346 const char *
chars), {
349 id.namespaceIndex = nsIndex;
359 id.namespaceIndex = nsIndex;
361 id.identifier.guid =
guid;
369 id.namespaceIndex = nsIndex;
376 UA_NODEID_BYTESTRING_ALLOC(
UA_UInt16 nsIndex,
377 const char *
chars), {
380 id.namespaceIndex = nsIndex;
419#ifdef UA_ENABLE_PARSING
424 UA_EXPANDEDNODEID(
const char *
chars), {
426 UA_ExpandedNodeId_parse(&
id, UA_STRING((
char*)(uintptr_t)
chars));
445 UA_EXPANDEDNODEID_STRING_ALLOC(
UA_UInt16 nsIndex,
const char *
chars), {
463 UA_EXPANDEDNODEID_BYTESTRING_ALLOC(
UA_UInt16 nsIndex,
const char *
chars), {
531 lt.text = UA_STRING(
text);
536 UA_LOCALIZEDTEXT_ALLOC(
const char *
locale,
const char *
text), {
558 UA_NUMERICRANGE(
const char *s), {
560 memset(&nr, 0,
sizeof(nr));
570#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
595 return v->
type == NULL;
616 return UA_Variant_isScalar(v) &&
type == v->
type;
627 return (!UA_Variant_isScalar(v)) &&
type == v->
type;
806#ifdef UA_ENABLE_TYPEDESCRIPTION
824#define UA_DATATYPEKINDS 31
860#ifdef UA_ENABLE_TYPEDESCRIPTION
892#ifdef UA_ENABLE_TYPEDESCRIPTION
895 const char *memberName,
959#define UA_deleteMembers(p, type) UA_clear(p, type)
978#ifdef UA_ENABLE_JSON_ENCODING
1044#ifdef UA_ENABLE_JSON_ENCODING
1048 size_t namespacesSize;
1050 size_t serverUrisSize;
1061} UA_EncodeJsonOptions;
1067 const UA_EncodeJsonOptions *options);
1078 const UA_EncodeJsonOptions *options);
1085 size_t namespacesSize;
1087 size_t serverUrisSize;
1090} UA_DecodeJsonOptions;
1104 const UA_DecodeJsonOptions *options);
1110#ifdef UA_ENABLE_XML_ENCODING
1114} UA_EncodeXmlOptions;
1120 const UA_EncodeXmlOptions *options);
1131 const UA_EncodeXmlOptions *options);
1139} UA_DecodeXmlOptions;
1153 const UA_DecodeXmlOptions *options);
1237#ifdef UA_ENABLE_TYPEDESCRIPTION
1238# define UA_TYPENAME(name) name,
1240# define UA_TYPENAME(name)
#define UA_INLINABLE(decl, impl)
An inlinable method is typically defined as "static inline".
#define _UA_BEGIN_DECLS
#undef UA_DEBUG_DUMP_PKGS
Datatype arrays with custom type definitions can be added in a linked list to the client or server co...
const UA_DataType * types
const struct UA_DataTypeArray * next
const UA_DataType * memberType
UA_DataTypeMember * members
UA_NodeId binaryEncodingId
UA_Boolean hasSourcePicoseconds
UA_Boolean hasServerTimestamp
UA_UInt16 serverPicoseconds
UA_DateTime serverTimestamp
UA_UInt16 sourcePicoseconds
UA_DateTime sourceTimestamp
UA_Boolean hasSourceTimestamp
UA_Boolean hasServerPicoseconds
Represents a Datetime as a structure.
The structure with the decoding options may be extended in the future.
const UA_DataTypeArray * customTypes
UA_Boolean hasNamespaceUri
UA_Boolean hasInnerDiagnosticInfo
struct UA_DiagnosticInfo * innerDiagnosticInfo
UA_Boolean hasLocalizedText
UA_Boolean hasInnerStatusCode
UA_StatusCode innerStatusCode
UA_Boolean hasAdditionalInfo
UA_ExtensionObjectEncoding encoding
enum UA_NodeIdType identifierType
UA_NumericRangeDimension * dimensions
UA_VariantStorageType storageType
UA_UInt32 * arrayDimensions
size_t arrayDimensionsSize
@ UA_NODEIDTYPE_BYTESTRING
void UA_ExtensionObject_setValue(UA_ExtensionObject *eo, void *p, const UA_DataType *type)
Initialize the ExtensionObject and set the "decoded" value to the given pointer.
void UA_Array_delete(void *p, size_t size, const UA_DataType *type)
Deletes an array.
_UA_BEGIN_DECLS typedef bool UA_Boolean
This Source Code Form is subject to the terms of the Mozilla Public License, v.
UA_StatusCode UA_Variant_setRange(UA_Variant *v, void *array, size_t arraySize, const UA_NumericRange range)
Insert a range of data into an existing variant.
UA_UInt32 UA_NodeId_hash(const UA_NodeId *n)
Returns a non-cryptographic hash for NodeId.
#define UA_BYTESTRING_ALLOC(chars)
UA_StatusCode UA_ExtensionObject_setValueCopy(UA_ExtensionObject *eo, void *p, const UA_DataType *type)
Initialize the ExtensionObject and set the "decoded" value to a fresh copy of the given value pointer...
UA_ExtensionObjectEncoding
@ UA_EXTENSIONOBJECT_ENCODED_XML
@ UA_EXTENSIONOBJECT_ENCODED_BYTESTRING
@ UA_EXTENSIONOBJECT_ENCODED_NOBODY
@ UA_EXTENSIONOBJECT_DECODED
@ UA_EXTENSIONOBJECT_DECODED_NODELETE
UA_EXPORT const UA_Guid UA_GUID_NULL
UA_StatusCode UA_ExpandedNodeId_print(const UA_ExpandedNodeId *id, UA_String *output)
Print the ExpandedNodeId in the humand-readable format defined in Part 6, 5.3.1.11:
#define UA_EMPTY_ARRAY_SENTINEL
UA_StatusCode UA_Array_resize(void **p, size_t *size, size_t newSize, const UA_DataType *type)
Resizes (and reallocates) an array.
const UA_DataType void UA_Variant_setScalar(UA_Variant *v, void *p, const UA_DataType *type)
Set the variant to a scalar value that already resides in memory.
UA_StatusCode UA_Variant_setRangeCopy(UA_Variant *v, const void *array, size_t arraySize, const UA_NumericRange range)
Deep-copy a range of data into an existing variant.
UA_UInt32 UA_ExpandedNodeId_hash(const UA_ExpandedNodeId *n)
Returns a non-cryptographic hash for ExpandedNodeId.
UA_EXPORT const UA_NodeId UA_NODEID_NULL
UA_Order UA_NodeId_order(const UA_NodeId *n1, const UA_NodeId *n2)
Total ordering of NodeId.
UA_DateTime UA_DateTime_fromStruct(UA_DateTimeStruct ts)
UA_StatusCode UA_Guid_print(const UA_Guid *guid, UA_String *output)
Print a Guid in the human-readable format defined in Part 6, 5.1.3.
#define UA_DATETIME_UNIX_EPOCH
The C99 standard (7.23.1) says: "The range and precision of times representable in clock_t and time_t...
UA_DateTimeStruct UA_DateTime_toStruct(UA_DateTime t)
UA_Order UA_order(const void *p1, const void *p2, const UA_DataType *type)
Pretty-print the value from the datatype.
UA_StatusCode UA_ByteString_fromBase64(UA_ByteString *bs, const UA_String *input)
Parse a ByteString from a base64 representation.
UA_Boolean UA_NodeId_isNull(const UA_NodeId *p)
UA_StatusCode UA_NodeId_print(const UA_NodeId *id, UA_String *output)
Print the NodeId in the human-readable format defined in Part 6, 5.3.1.10.
void UA_ExtensionObject_setValueNoDelete(UA_ExtensionObject *eo, void *p, const UA_DataType *type)
Initialize the ExtensionObject and set the "decoded" value to the given pointer.
UA_StatusCode UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length)
Allocates memory of size length for the bytestring.
void UA_Variant_setArray(UA_Variant *v, void *array, size_t arraySize, const UA_DataType *type)
Set the variant to an array that already resides in memory.
UA_Boolean UA_DataType_getStructMember(const UA_DataType *type, const char *memberName, size_t *outOffset, const UA_DataType **outMemberType, UA_Boolean *outIsArray)
Returns the offset and type of a structure member.
UA_EXPORT const char * UA_StatusCode_name(UA_StatusCode code)
Returns the human-readable name of the StatusCode.
@ UA_DATATYPEKIND_STATUSCODE
@ UA_DATATYPEKIND_BOOLEAN
@ UA_DATATYPEKIND_EXPANDEDNODEID
@ UA_DATATYPEKIND_DATETIME
@ UA_DATATYPEKIND_QUALIFIEDNAME
@ UA_DATATYPEKIND_VARIANT
@ UA_DATATYPEKIND_DATAVALUE
@ UA_DATATYPEKIND_OPTSTRUCT
@ UA_DATATYPEKIND_LOCALIZEDTEXT
@ UA_DATATYPEKIND_XMLELEMENT
@ UA_DATATYPEKIND_DECIMAL
@ UA_DATATYPEKIND_STRUCTURE
@ UA_DATATYPEKIND_BYTESTRING
@ UA_DATATYPEKIND_BITFIELDCLUSTER
@ UA_DATATYPEKIND_DIAGNOSTICINFO
@ UA_DATATYPEKIND_EXTENSIONOBJECT
UA_StatusCode UA_ByteString_toBase64(const UA_ByteString *bs, UA_String *output)
Converts a ByteString to the corresponding base64 representation.
const UA_DataType * UA_findDataTypeWithCustom(const UA_NodeId *typeId, const UA_DataTypeArray *customTypes)
UA_StatusCode UA_Array_appendCopy(void **p, size_t *size, const void *newElem, const UA_DataType *type)
Append a copy of the given element at the end of the array.
void * UA_new(const UA_DataType *type)
Allocates and initializes a variable of type dataType.
UA_EXPORT const UA_ExpandedNodeId UA_EXPANDEDNODEID_NULL
@ UA_VARIANT_DATA_NODELETE
#define UA_BYTESTRING(chars)
UA_StatusCode UA_NumericRange_parse(UA_NumericRange *range, const UA_String str)
UA_StatusCode UA_Variant_setScalarCopy(UA_Variant *v, const void *p, const UA_DataType *type)
Set the variant to a scalar value that is copied from an existing variable.
void * UA_Array_new(size_t size, const UA_DataType *type)
Allocates and initializes an array of variables of a specific type.
void UA_clear(void *p, const UA_DataType *type)
Deletes the dynamically allocated content of a variable (e.g.
UA_EXPORT UA_StatusCode UA_decodeBinary(const UA_ByteString *inBuf, void *p, const UA_DataType *type, const UA_DecodeBinaryOptions *options)
Decodes a data structure from the input buffer in the binary format.
UA_Boolean UA_DataType_isNumeric(const UA_DataType *type)
Test if the data type is a numeric builtin data type (via the typeKind field of UA_DataType).
UA_StatusCode UA_DataValue_copyVariantRange(const UA_DataValue *src, UA_DataValue *dst, const UA_NumericRange range)
Copy the DataValue, but use only a subset of the (multidimensional) array of of the variant of the so...
UA_UInt32 UA_ByteString_hash(UA_UInt32 initialHashValue, const UA_Byte *data, size_t size)
Returns a non-cryptographic hash of a bytestring.
void UA_delete(void *p, const UA_DataType *type)
Frees a variable and all of its content.
UA_StatusCode UA_Array_append(void **p, size_t *size, void *newElem, const UA_DataType *type)
Append the given element at the end of the array.
#define UA_STRING_ALLOC(CHARS)
UA_Order UA_ExpandedNodeId_order(const UA_ExpandedNodeId *n1, const UA_ExpandedNodeId *n2)
Total ordering of ExpandedNodeId.
UA_EXPORT UA_StatusCode UA_encodeBinary(const void *p, const UA_DataType *type, UA_ByteString *outBuf)
Encodes a data-structure in the binary format.
UA_EXPORT const UA_String UA_STRING_NULL
UA_DateTime UA_DateTime_nowMonotonic(void)
CPU clock invariant to system time changes.
UA_DateTime UA_DateTime_now(void)
The current time in UTC time.
UA_String UA_String_fromChars(const char *src)
Copies the content on the heap.
UA_StatusCode UA_Variant_setArrayCopy(UA_Variant *v, const void *array, size_t arraySize, const UA_DataType *type)
Set the variant to an array that is copied from an existing array.
const UA_DataType * UA_findDataType(const UA_NodeId *typeId)
Returns the data type description for the type's identifier or NULL if no matching data type was foun...
UA_StatusCode UA_Array_copy(const void *src, size_t size, void **dst, const UA_DataType *type)
Allocates and copies an array.
UA_Boolean UA_String_isEmpty(const UA_String *s)
UA_Int64 UA_DateTime_localTimeUtcOffset(void)
Offset between local time and UTC time.
UA_EXPORT const UA_ByteString UA_BYTESTRING_NULL
UA_StatusCode UA_Variant_copyRange(const UA_Variant *src, UA_Variant *dst, const UA_NumericRange range)
Copy the variant, but use only a subset of the (multidimensional) array into a variant.