Understanding of File Type implementation (PR #4436 github)

88 views
Skip to first unread message

Joanna J.

unread,
Sep 22, 2021, 5:18:02 AM9/22/21
to open62541

Dear Community,

there is already a great implementation example for the filetype in open62541 waiting in  PR 4436 to be pushed into master:

Considering this implementation I got a genereal question regarding the server and nodes.

In ua_server_internal.h the a list of fileobjects is added to the UA_Server. Why is this necessary? In the method UA_server_addFile in  ua_file.c the method
UA_StatusCode result = UA_Server_addObjectNode(server, requestedNewNodeId,
                            parentNodeId, referenceTypeId, browseName,
                            UA_NODEID_NUMERIC(0, UA_NS0ID_FILETYPE),
                            attr, nodeContext, outNewNodeId);
is called. I thought that this method is creating an object of a filetype. Why is it necessary to call malloc for a filetypeobject in
UA_StatusCode
setFileTypeInfo(UA_Server *server, const UA_NodeId fileTypeObjectNodeId,
                          UA_String filePath) ?


Cheers,
Joanna
Reply all
Reply to author
Forward
0 new messages