diff --git a/include/open62541/util.h b/include/open62541/util.h index ac339f214be..ff5ce52de78 100644 --- a/include/open62541/util.h +++ b/include/open62541/util.h @@ -299,8 +299,9 @@ UA_RelativePath_print(const UA_RelativePath *rp, UA_String *out); * values reported for each event instance. * * The TypeDefinitionId is a NodeId and restricts the starting point for the - * lookup to instances of the TypeDefinitionNode or one of its subtypes. The - * NodeId defaults to the wildcard ns=0;i=0. The NodeId is extended-and-escaped. + * lookup to instances of the TypeDefinitionNode or one of its subtypes. If not + * defined, the NodeId defaults to the BaseEventType. The NodeId is + * extended-and-escaped. * * The BrowsePath is a list of BrowseNames (QualifiedName expression with * extended-and-escaping of the name) to be followed from the TypeDefinitionNode @@ -310,8 +311,10 @@ UA_RelativePath_print(const UA_RelativePath *rp, UA_String *out); * to only follow into Variable- and ObjectNodes. If the BrowsePath is empty, * the value is taken from the instance of the TypeDefinition itself. * - * The attribute is the textual name of the possible node attributes. - * For the index range, see the section on :ref:`numericrange`.:: + * The attribute is the textual name of the selected node attribute. + * If undefined, the attribute defaults to the Value attribute. + * For the index range, see the section on :ref:`numericrange`. + * The BNF definition of the SimpleAttributeOperand is as follows:: * * SimpleAttributeOperand := * TypeDefinitionId? SimpleBrowsePath ("#" Attribute)? ("[" IndexRange "]")? diff --git a/src/util/ua_types_lex.c b/src/util/ua_types_lex.c index 3976a29bd41..d233b218ca4 100644 --- a/src/util/ua_types_lex.c +++ b/src/util/ua_types_lex.c @@ -937,6 +937,9 @@ UA_SimpleAttributeOperand_parse(UA_SimpleAttributeOperand *sao, res = UA_NodeId_parse(&sao->typeDefinitionId, typeString); if(res != UA_STATUSCODE_GOOD) goto cleanup; + } else { + /* BaseEventType is the default */ + sao->typeDefinitionId = UA_NODEID_NUMERIC(0, UA_NS0ID_BASEEVENTTYPE); } /* Parse the BrowsePath */ @@ -994,6 +997,9 @@ UA_SimpleAttributeOperand_parse(UA_SimpleAttributeOperand *sao, res = UA_STATUSCODE_BADDECODINGERROR; goto cleanup; } + } else { + /* The value attribute is the default */ + sao->attributeId = UA_ATTRIBUTEID_VALUE; } /* Check whether the IndexRange can be parsed. diff --git a/src/util/ua_types_lex.re b/src/util/ua_types_lex.re index f9cd1fd0eb6..0a7ab36af8d 100644 --- a/src/util/ua_types_lex.re +++ b/src/util/ua_types_lex.re @@ -434,6 +434,9 @@ UA_SimpleAttributeOperand_parse(UA_SimpleAttributeOperand *sao, res = UA_NodeId_parse(&sao->typeDefinitionId, typeString); if(res != UA_STATUSCODE_GOOD) goto cleanup; + } else { + /* BaseEventType is the default */ + sao->typeDefinitionId = UA_NODEID_NUMERIC(0, UA_NS0ID_BASEEVENTTYPE); } /* Parse the BrowsePath */ @@ -491,6 +494,9 @@ UA_SimpleAttributeOperand_parse(UA_SimpleAttributeOperand *sao, res = UA_STATUSCODE_BADDECODINGERROR; goto cleanup; } + } else { + /* The value attribute is the default */ + sao->attributeId = UA_ATTRIBUTEID_VALUE; } /* Check whether the IndexRange can be parsed.