26#include <cvb/opcua/server.hpp>
36 auto nsIndex = server->AddNameSpace(
"TestNamespace");
48 server->AddNode(*folder);
54 server->AddNode(*node);
58 auto callbackCookie = node->RegisterWriteCallback([&]()
60 std::cout <<
"write was triggerd" << std::endl;
67 std::cout <<
"Press enter to stop the server" << std::endl;
72 node->UnregisterCallback(callbackCookie);
static FloatNodePtr Create(std::uint16_t namespaceIndex, const Cvb::String &name, const OpcUa::NodeID &parentNodeID, double value)
Creates an OPCUA Variable with the specified parameter, data type and set its value as double.
Definition: float_node.hpp:45
static NodeIDPtr Create(Namespace0NodeID id)
Creates an id based on a predefined Namespace0 node id.
Definition: node_id.hpp:48
static ObjectNodePtr CreateFromType(const std::uint16_t NameSpaceIndex, const Cvb::String &Name, const OpcUa::NodeID &Parent, const OpcUa::NodeID &TypeDefinition)
Creates a OPCUA object node with a given type definition.
Definition: object_node.hpp:49
Special runtime exception to carry a native error code.
Definition: exception.hpp:25
static ServerPtr Create(const std::uint16_t port)
Creates an OPCUA server with the specified port number.
Definition: detail_server.hpp:23