I am trying to write a small server but I am a bit lost
when it comes to the general architecture so I am not sure
I am doing it in the right way.
So I have a class wrapper where inside I have a member variable
std::unique_ptr<UaApplication> m_application which I initialize
in the ctor.
I add variables to the application like this
Code: Select all
UaNodeId nodeId(itemPath.c_str(), GetNameSpaceIndex());
auto* pVariable = new OpcUa::BaseDataVariableType(
nodeId,
variableBrowseName,
GetNameSpaceIndex(), // browse
initialUaValue,
accessLevel,
nodeManagerConfig
);
pVariable->setValueHandling(UaVariable_Value_CacheIsSource); // needed?
if (auto const ret = nodeManagerConfig->addNodeAndReference(sourceNode, pVariable, OpcUaId_HasComponent);
ret.isGood())
{
m_itemPaths.insert(itemPath);
++successful;
}
in our case will be the nodeid together with a namespace index.
I seem to be able to read and write to the variables but when writing to a variable
I would like the client to get a datachange but it is not receiving that for some reason.
I write and read to the variables using serverManager->read/write from an update thread
that should simulate values changes so that the client gets datachange calls.
Am I on the right track or am I completely lost? :) I am using the default nodemanager and intenalsession.
How do I enable so that when values are changed by a write that client gets a data change?