|
@@ -2,7 +2,7 @@
|
|
#include "ua_namespace_0.h"
|
|
#include "ua_namespace_0.h"
|
|
|
|
|
|
static INLINE UA_Boolean is_builtin(UA_NodeId *typeid) {
|
|
static INLINE UA_Boolean is_builtin(UA_NodeId *typeid) {
|
|
- return (typeid->ns == 0 && 1 <= typeid->identifier.numeric && typeid->identifier.numeric <= 25);
|
|
|
|
|
|
+ return (typeid->namespaceId == 0 && 1 <= typeid->identifier.numeric && typeid->identifier.numeric <= 25);
|
|
}
|
|
}
|
|
|
|
|
|
/*********/
|
|
/*********/
|
|
@@ -389,9 +389,9 @@ UA_Int32 UA_NodeId_calcSizeBinary(UA_NodeId const *p) {
|
|
else {
|
|
else {
|
|
switch(p->nodeIdType) {
|
|
switch(p->nodeIdType) {
|
|
case UA_NODEIDTYPE_NUMERIC:
|
|
case UA_NODEIDTYPE_NUMERIC:
|
|
- if(p->identifier.numeric > UA_UINT16_MAX || p->ns > UA_BYTE_MAX)
|
|
|
|
|
|
+ if(p->identifier.numeric > UA_UINT16_MAX || p->namespaceId > UA_BYTE_MAX)
|
|
length = sizeof(UA_Byte) + sizeof(UA_UInt16) + sizeof(UA_UInt32);
|
|
length = sizeof(UA_Byte) + sizeof(UA_UInt16) + sizeof(UA_UInt32);
|
|
- else if(p->identifier.numeric > UA_BYTE_MAX || p->ns > 0)
|
|
|
|
|
|
+ else if(p->identifier.numeric > UA_BYTE_MAX || p->namespaceId > 0)
|
|
length = 4; /* UA_NODEIDTYPE_FOURBYTE */
|
|
length = 4; /* UA_NODEIDTYPE_FOURBYTE */
|
|
else
|
|
else
|
|
length = 2; /* UA_NODEIDTYPE_TWOBYTE*/
|
|
length = 2; /* UA_NODEIDTYPE_TWOBYTE*/
|
|
@@ -424,15 +424,15 @@ UA_TYPE_ENCODEBINARY(UA_NodeId,
|
|
UA_Int32 retval = UA_SUCCESS;
|
|
UA_Int32 retval = UA_SUCCESS;
|
|
switch(src->nodeIdType) {
|
|
switch(src->nodeIdType) {
|
|
case UA_NODEIDTYPE_NUMERIC:
|
|
case UA_NODEIDTYPE_NUMERIC:
|
|
- if(src->identifier.numeric > UA_UINT16_MAX || src->ns > UA_BYTE_MAX) {
|
|
|
|
|
|
+ if(src->identifier.numeric > UA_UINT16_MAX || src->namespaceId > UA_BYTE_MAX) {
|
|
srcByte = UA_NODEIDTYPE_NUMERIC;
|
|
srcByte = UA_NODEIDTYPE_NUMERIC;
|
|
retval |= UA_Byte_encodeBinary(&srcByte, dst, offset);
|
|
retval |= UA_Byte_encodeBinary(&srcByte, dst, offset);
|
|
- retval |= UA_UInt16_encodeBinary(&src->ns, dst, offset);
|
|
|
|
|
|
+ retval |= UA_UInt16_encodeBinary(&src->namespaceId, dst, offset);
|
|
retval |= UA_UInt32_encodeBinary(&src->identifier.numeric, dst, offset);
|
|
retval |= UA_UInt32_encodeBinary(&src->identifier.numeric, dst, offset);
|
|
- } else if(src->identifier.numeric > UA_BYTE_MAX || src->ns > 0) { /* UA_NODEIDTYPE_FOURBYTE */
|
|
|
|
|
|
+ } else if(src->identifier.numeric > UA_BYTE_MAX || src->namespaceId > 0) { /* UA_NODEIDTYPE_FOURBYTE */
|
|
srcByte = UA_NODEIDTYPE_FOURBYTE;
|
|
srcByte = UA_NODEIDTYPE_FOURBYTE;
|
|
retval |= UA_Byte_encodeBinary(&srcByte, dst, offset);
|
|
retval |= UA_Byte_encodeBinary(&srcByte, dst, offset);
|
|
- srcByte = src->ns;
|
|
|
|
|
|
+ srcByte = src->namespaceId;
|
|
srcUInt16 = src->identifier.numeric;
|
|
srcUInt16 = src->identifier.numeric;
|
|
retval |= UA_Byte_encodeBinary(&srcByte, dst, offset);
|
|
retval |= UA_Byte_encodeBinary(&srcByte, dst, offset);
|
|
retval |= UA_UInt16_encodeBinary(&srcUInt16, dst, offset);
|
|
retval |= UA_UInt16_encodeBinary(&srcUInt16, dst, offset);
|
|
@@ -447,21 +447,21 @@ UA_TYPE_ENCODEBINARY(UA_NodeId,
|
|
case UA_NODEIDTYPE_STRING:
|
|
case UA_NODEIDTYPE_STRING:
|
|
srcByte = UA_NODEIDTYPE_STRING;
|
|
srcByte = UA_NODEIDTYPE_STRING;
|
|
retval |= UA_Byte_encodeBinary(&srcByte, dst, offset);
|
|
retval |= UA_Byte_encodeBinary(&srcByte, dst, offset);
|
|
- retval |= UA_UInt16_encodeBinary(&src->ns, dst, offset);
|
|
|
|
|
|
+ retval |= UA_UInt16_encodeBinary(&src->namespaceId, dst, offset);
|
|
retval |= UA_String_encodeBinary(&src->identifier.string, dst, offset);
|
|
retval |= UA_String_encodeBinary(&src->identifier.string, dst, offset);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_NODEIDTYPE_GUID:
|
|
case UA_NODEIDTYPE_GUID:
|
|
srcByte = UA_NODEIDTYPE_GUID;
|
|
srcByte = UA_NODEIDTYPE_GUID;
|
|
retval |= UA_Byte_encodeBinary(&srcByte, dst, offset);
|
|
retval |= UA_Byte_encodeBinary(&srcByte, dst, offset);
|
|
- retval |= UA_UInt16_encodeBinary(&src->ns, dst, offset);
|
|
|
|
|
|
+ retval |= UA_UInt16_encodeBinary(&src->namespaceId, dst, offset);
|
|
retval |= UA_Guid_encodeBinary(&src->identifier.guid, dst, offset);
|
|
retval |= UA_Guid_encodeBinary(&src->identifier.guid, dst, offset);
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_NODEIDTYPE_BYTESTRING:
|
|
case UA_NODEIDTYPE_BYTESTRING:
|
|
srcByte = UA_NODEIDTYPE_BYTESTRING;
|
|
srcByte = UA_NODEIDTYPE_BYTESTRING;
|
|
retval |= UA_Byte_encodeBinary(&srcByte, dst, offset);
|
|
retval |= UA_Byte_encodeBinary(&srcByte, dst, offset);
|
|
- retval |= UA_UInt16_encodeBinary(&src->ns, dst, offset);
|
|
|
|
|
|
+ retval |= UA_UInt16_encodeBinary(&src->namespaceId, dst, offset);
|
|
retval |= UA_ByteString_encodeBinary(&src->identifier.byteString, dst, offset);
|
|
retval |= UA_ByteString_encodeBinary(&src->identifier.byteString, dst, offset);
|
|
break;
|
|
break;
|
|
|
|
|
|
@@ -485,38 +485,38 @@ UA_Int32 UA_NodeId_decodeBinary(UA_ByteString const *src, UA_UInt32 *offset, UA_
|
|
dst->nodeIdType = UA_NODEIDTYPE_NUMERIC;
|
|
dst->nodeIdType = UA_NODEIDTYPE_NUMERIC;
|
|
CHECKED_DECODE(UA_Byte_decodeBinary(src, offset, &dstByte),; );
|
|
CHECKED_DECODE(UA_Byte_decodeBinary(src, offset, &dstByte),; );
|
|
dst->identifier.numeric = dstByte;
|
|
dst->identifier.numeric = dstByte;
|
|
- dst->ns = 0; // default namespace
|
|
|
|
|
|
+ dst->namespaceId = 0; // default namespace
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_NODEIDTYPE_FOURBYTE: // Table 8
|
|
case UA_NODEIDTYPE_FOURBYTE: // Table 8
|
|
dst->nodeIdType = UA_NODEIDTYPE_NUMERIC;
|
|
dst->nodeIdType = UA_NODEIDTYPE_NUMERIC;
|
|
CHECKED_DECODE(UA_Byte_decodeBinary(src, offset, &dstByte),; );
|
|
CHECKED_DECODE(UA_Byte_decodeBinary(src, offset, &dstByte),; );
|
|
- dst->ns = dstByte;
|
|
|
|
|
|
+ dst->namespaceId = dstByte;
|
|
CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dstUInt16),; );
|
|
CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dstUInt16),; );
|
|
dst->identifier.numeric = dstUInt16;
|
|
dst->identifier.numeric = dstUInt16;
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_NODEIDTYPE_NUMERIC: // Table 6, first entry
|
|
case UA_NODEIDTYPE_NUMERIC: // Table 6, first entry
|
|
dst->nodeIdType = UA_NODEIDTYPE_NUMERIC;
|
|
dst->nodeIdType = UA_NODEIDTYPE_NUMERIC;
|
|
- CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dst->ns),; );
|
|
|
|
|
|
+ CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dst->namespaceId),; );
|
|
CHECKED_DECODE(UA_UInt32_decodeBinary(src, offset, &dst->identifier.numeric),; );
|
|
CHECKED_DECODE(UA_UInt32_decodeBinary(src, offset, &dst->identifier.numeric),; );
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_NODEIDTYPE_STRING: // Table 6, second entry
|
|
case UA_NODEIDTYPE_STRING: // Table 6, second entry
|
|
dst->nodeIdType = UA_NODEIDTYPE_STRING;
|
|
dst->nodeIdType = UA_NODEIDTYPE_STRING;
|
|
- CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dst->ns),; );
|
|
|
|
|
|
+ CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dst->namespaceId),; );
|
|
CHECKED_DECODE(UA_String_decodeBinary(src, offset, &dst->identifier.string),; );
|
|
CHECKED_DECODE(UA_String_decodeBinary(src, offset, &dst->identifier.string),; );
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_NODEIDTYPE_GUID: // Table 6, third entry
|
|
case UA_NODEIDTYPE_GUID: // Table 6, third entry
|
|
dst->nodeIdType = UA_NODEIDTYPE_GUID;
|
|
dst->nodeIdType = UA_NODEIDTYPE_GUID;
|
|
- CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dst->ns),; );
|
|
|
|
|
|
+ CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dst->namespaceId),; );
|
|
CHECKED_DECODE(UA_Guid_decodeBinary(src, offset, &dst->identifier.guid),; );
|
|
CHECKED_DECODE(UA_Guid_decodeBinary(src, offset, &dst->identifier.guid),; );
|
|
break;
|
|
break;
|
|
|
|
|
|
case UA_NODEIDTYPE_BYTESTRING: // Table 6, "OPAQUE"
|
|
case UA_NODEIDTYPE_BYTESTRING: // Table 6, "OPAQUE"
|
|
dst->nodeIdType = UA_NODEIDTYPE_BYTESTRING;
|
|
dst->nodeIdType = UA_NODEIDTYPE_BYTESTRING;
|
|
- CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dst->ns),; );
|
|
|
|
|
|
+ CHECKED_DECODE(UA_UInt16_decodeBinary(src, offset, &dst->namespaceId),; );
|
|
CHECKED_DECODE(UA_ByteString_decodeBinary(src, offset, &dst->identifier.byteString),; );
|
|
CHECKED_DECODE(UA_ByteString_decodeBinary(src, offset, &dst->identifier.byteString),; );
|
|
break;
|
|
break;
|
|
|
|
|
|
@@ -573,7 +573,7 @@ UA_Int32 UA_ExpandedNodeId_decodeBinary(UA_ByteString const *src, UA_UInt32 *off
|
|
|
|
|
|
CHECKED_DECODE(UA_NodeId_decodeBinary(src, offset, &dst->nodeId), UA_ExpandedNodeId_deleteMembers(dst));
|
|
CHECKED_DECODE(UA_NodeId_decodeBinary(src, offset, &dst->nodeId), UA_ExpandedNodeId_deleteMembers(dst));
|
|
if(encodingByte & UA_EXPANDEDNODEID_NAMESPACEURI_FLAG) {
|
|
if(encodingByte & UA_EXPANDEDNODEID_NAMESPACEURI_FLAG) {
|
|
- dst->nodeId.ns = 0;
|
|
|
|
|
|
+ dst->nodeId.namespaceId = 0;
|
|
CHECKED_DECODE(UA_String_decodeBinary(src, offset, &dst->namespaceUri), UA_ExpandedNodeId_deleteMembers(dst));
|
|
CHECKED_DECODE(UA_String_decodeBinary(src, offset, &dst->namespaceUri), UA_ExpandedNodeId_deleteMembers(dst));
|
|
}
|
|
}
|
|
if(encodingByte & UA_EXPANDEDNODEID_SERVERINDEX_FLAG)
|
|
if(encodingByte & UA_EXPANDEDNODEID_SERVERINDEX_FLAG)
|
|
@@ -831,7 +831,7 @@ UA_TYPE_ENCODEBINARY(UA_Variant,
|
|
UA_Boolean hasDimensions;
|
|
UA_Boolean hasDimensions;
|
|
UA_Boolean isBuiltin;
|
|
UA_Boolean isBuiltin;
|
|
|
|
|
|
- if(src == UA_NULL || src->vt == UA_NULL || src->vt->typeId.ns != 0)
|
|
|
|
|
|
+ if(src == UA_NULL || src->vt == UA_NULL || src->vt->typeId.namespaceId != 0)
|
|
return UA_ERROR;
|
|
return UA_ERROR;
|
|
|
|
|
|
isArray = src->arrayLength != 1; // a single element is not an array
|
|
isArray = src->arrayLength != 1; // a single element is not an array
|
|
@@ -889,7 +889,7 @@ UA_Int32 UA_Variant_decodeBinary(UA_ByteString const *src, UA_UInt32 *offset, UA
|
|
UA_Boolean isArray = encodingByte & UA_VARIANT_ENCODINGMASKTYPE_ARRAY;
|
|
UA_Boolean isArray = encodingByte & UA_VARIANT_ENCODINGMASKTYPE_ARRAY;
|
|
UA_Boolean hasDimensions = isArray && (encodingByte & UA_VARIANT_ENCODINGMASKTYPE_DIMENSIONS);
|
|
UA_Boolean hasDimensions = isArray && (encodingByte & UA_VARIANT_ENCODINGMASKTYPE_DIMENSIONS);
|
|
|
|
|
|
- UA_NodeId typeid = { .ns= 0, .nodeIdType = UA_NODEIDTYPE_NUMERIC,
|
|
|
|
|
|
+ UA_NodeId typeid = { .namespaceId= 0, .nodeIdType = UA_NODEIDTYPE_NUMERIC,
|
|
.identifier.numeric = encodingByte & UA_VARIANT_ENCODINGMASKTYPE_TYPEID_MASK };
|
|
.identifier.numeric = encodingByte & UA_VARIANT_ENCODINGMASKTYPE_TYPEID_MASK };
|
|
UA_Int32 typeNs0Id = UA_ns0ToVTableIndex(&typeid );
|
|
UA_Int32 typeNs0Id = UA_ns0ToVTableIndex(&typeid );
|
|
dst->vt = &UA_.types[typeNs0Id];
|
|
dst->vt = &UA_.types[typeNs0Id];
|