|
@@ -34,12 +34,14 @@ int main(int argc, char** argv) {
|
|
|
UA_Variant *myIntegerVariant = UA_Variant_new();
|
|
|
UA_Int32 myInteger = 42;
|
|
|
UA_Variant_setScalarCopy(myIntegerVariant, &myInteger, &UA_TYPES[UA_TYPES_INT32]);
|
|
|
+ //NOTE: the link between myInteger and the value of the node is lost here, you can safely reuse myInteger
|
|
|
UA_QualifiedName myIntegerName = UA_QUALIFIEDNAME(1, "the answer");
|
|
|
UA_NodeId myIntegerNodeId = UA_NODEID_STRING(1, "the.answer"); /* UA_NODEID_NULL would assign a random free nodeid */
|
|
|
+ UA_LocalizedText myIntegerBrowseName = UA_LOCALIZEDTEXT("en_US","the answer");
|
|
|
UA_NodeId parentNodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER);
|
|
|
UA_NodeId parentReferenceNodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES);
|
|
|
|
|
|
- UA_Server_addVariableNode(server, myIntegerNodeId, myIntegerName, UA_LOCALIZEDTEXT("en_US",""), UA_LOCALIZEDTEXT("en_US",""),
|
|
|
+ UA_Server_addVariableNode(server, myIntegerNodeId, myIntegerName, myIntegerBrowseName, myIntegerBrowseName,
|
|
|
parentNodeId, parentReferenceNodeId, 0, 0, myIntegerVariant, NULL);
|
|
|
|
|
|
UA_StatusCode retval = UA_Server_run(server, 1, &running);
|