#ifndef OPCUA_CLIENT_H #define OPCUA_CLIENT_H #include #include #include #include #include // Structure for storing node information for the browser struct OpcNodeInfo { std::string name; uint16_t nsIndex; uint32_t numericId; std::string stringId; bool isStringId; uint32_t nodeClass; // e.g. UA_NODECLASS_VARIABLE or UA_NODECLASS_OBJECT }; class OPCUAClient { public: OPCUAClient(); ~OPCUAClient(); // Establishes a connection to the server bool Connect(const std::string& endpointUrl); // Lists the child nodes of a specific node (default: Objects folder) std::vector GenList(uint16_t namespaceIndex = 0, uint32_t numericNodeId = 85); // Reads the value of a string-based node std::string ReadString(uint16_t namespaceIndex, const std::string& stringNodeId); // Reads the value of a numeric node (new for the browser) std::string ReadNumeric(uint16_t namespaceIndex, uint32_t numericNodeId); // Closes the connection void Close(); private: UA_Client* client; bool isConnected; }; #endif // OPCUA_CLIENT_H