24template <
typename Connection>
29struct ClientConnection;
71#ifdef UA_ENABLE_ENCRYPTION
162#ifdef UA_ENABLE_SUBSCRIPTIONS
197 std::unique_ptr<detail::ClientConnection> connection_;
201 return (lhs.handle() == rhs.handle());
205 return !(lhs == rhs);
UA_ApplicationDescription wrapper class.
UA_ByteString wrapper class.
Subscription< Client > createSubscription()
Create a subscription to monitor data changes and events (default subscription parameters).
Client(Logger logger=nullptr)
Create client with default configuration (no encryption).
UA_Client * handle() noexcept
Node< Client > getViewsNode()
std::vector< Subscription< Client > > getSubscriptions()
Get all active subscriptions.
Client(const Client &)=delete
void onConnected(StateCallback callback)
Set a state callback that will be called after the client is connected.
std::vector< std::string > getNamespaceArray()
Get all defined namespaces.
void connect(std::string_view endpointUrl)
Connect to the selected server.
void setCustomDataTypes(std::vector< DataType > dataTypes)
Set custom data types.
std::vector< EndpointDescription > getEndpoints(std::string_view serverUrl)
Gets a list of endpoints of a server.
void onDisconnected(StateCallback callback)
Set a state callback that will be called after the client is disconnected.
Node< Client > getNode(NodeId id)
void onSessionActivated(StateCallback callback)
Set a state callback that will be called after the session is activated.
void run()
Run the client's main loop by. This method will block until Client::stop is called.
void setSecurityMode(MessageSecurityMode mode)
Set message security mode.
void setLogger(Logger logger)
Set custom logging function.
friend detail::ClientConnection & detail::getConnection(Client &client) noexcept
Client(const ByteString &certificate, const ByteString &privateKey, Span< const ByteString > trustList, Span< const ByteString > revocationList={})
Create client with encryption enabled (PKI).
void onSessionClosed(StateCallback callback)
Set a state callback that will be called after the session is closed.
bool isConnected() noexcept
Check if client is connected (secure channel open).
Node< Client > getTypesNode()
Subscription< Client > createSubscription(SubscriptionParameters ¶meters)
Create a subscription to monitor data changes and events.
void runIterate(uint16_t timeoutMilliseconds=1000)
Run a single iteration of the client's main loop.
Node< Client > getObjectsNode()
std::vector< ApplicationDescription > findServers(std::string_view serverUrl)
Gets a list of all registered servers at the given server.
Client(Client &&) noexcept=default
void disconnect() noexcept
Disconnect and close a connection to the server (async, without blocking).
void setTimeout(uint32_t milliseconds)
Set response timeout in milliseconds.
void stop()
Stop the client's main loop.
Node< Client > getRootNode()
bool isRunning() const noexcept
Check if the client's main loop is running.
UA_DataType wrapper class.
UA_EndpointDescription wrapper class.
High-level node class to access node attribute, browse and populate address space.
View to a contiguous sequence of objects, similar to std::span in C++20.
High-level subscription class.
ClientContext * getContext(UA_Client *client) noexcept
UA_ClientConfig * getConfig(UA_Client *client) noexcept
Client * getWrapper(UA_Client *client) noexcept
ClientConnection * getConnection(UA_Client *client) noexcept
std::function< void(LogLevel, LogCategory, std::string_view msg)> Logger
Log function signature.
std::function< void()> StateCallback
bool operator!=(const Client &lhs, const Client &rhs) noexcept
@ DataType
The NodeId of the data type definition for the Value attribute.
MessageSecurityMode
Message security mode.
Internal storage for Client class.
Subscription parameters with default values from open62541.