#include <Client.h>
◆ Client() [1/4]
opcua::Client::Client |
( |
Logger | logger = nullptr | ) |
|
|
explicit |
Create client with default configuration (no encryption).
Security policies:
- None
- Parameters
-
logger | Custom log function. If the passed function is empty, the default logger is used. |
◆ Client() [2/4]
◆ ~Client()
opcua::Client::~Client |
( |
| ) |
|
◆ Client() [3/4]
opcua::Client::Client |
( |
const Client & | | ) |
|
|
delete |
◆ Client() [4/4]
opcua::Client::Client |
( |
Client && | | ) |
|
|
defaultnoexcept |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ findServers()
Gets a list of all registered servers at the given server.
- Parameters
-
serverUrl | Server URL (for example opc.tcp://localhost:4840 ) |
- Note
- Client must be disconnected.
- Examples
- client_find_servers.cpp.
◆ getEndpoints()
Gets a list of endpoints of a server.
- Parameters
-
serverUrl | Server URL (for example opc.tcp://localhost:4840 ) |
- Note
- Client must be disconnected.
◆ setLogger()
void opcua::Client::setLogger |
( |
Logger | logger | ) |
|
Set custom logging function.
Does nothing if the passed function is empty or a nullptr.
- Examples
- client_find_servers.cpp.
◆ setTimeout()
void opcua::Client::setTimeout |
( |
uint32_t | milliseconds | ) |
|
Set response timeout in milliseconds.
◆ setSecurityMode()
Set message security mode.
◆ setCustomDataTypes()
void opcua::Client::setCustomDataTypes |
( |
std::vector< DataType > | dataTypes | ) |
|
◆ onConnected()
Set a state callback that will be called after the client is connected.
◆ onDisconnected()
Set a state callback that will be called after the client is disconnected.
◆ onSessionActivated()
◆ onSessionClosed()
Set a state callback that will be called after the session is closed.
◆ connect() [1/2]
void opcua::Client::connect |
( |
std::string_view | endpointUrl | ) |
|
◆ connect() [2/2]
void opcua::Client::connect |
( |
std::string_view | endpointUrl, |
|
|
const Login & | login ) |
Connect to the selected server with the given username and password.
- Parameters
-
endpointUrl | Endpoint URL (for example opc.tcp://localhost:4840/open62541/server/ ) |
login | Login credentials with username and password |
◆ disconnect()
void opcua::Client::disconnect |
( |
| ) |
|
|
noexcept |
◆ isConnected()
bool opcua::Client::isConnected |
( |
| ) |
|
|
noexcept |
Check if client is connected (secure channel open).
◆ getNamespaceArray()
std::vector< std::string > opcua::Client::getNamespaceArray |
( |
| ) |
|
Get all defined namespaces.
◆ createSubscription() [1/2]
◆ createSubscription() [2/2]
Create a subscription to monitor data changes and events.
◆ getSubscriptions()
Get all active subscriptions.
◆ runIterate()
void opcua::Client::runIterate |
( |
uint16_t | timeoutMilliseconds = 1000 | ) |
|
Run a single iteration of the client's main loop.
Listen on the network and process arriving asynchronous responses in the background. Internal housekeeping, renewal of SecureChannels and subscription management is done as well.
- Parameters
-
timeoutMilliseconds | Timeout in milliseconds |
◆ run()
void opcua::Client::run |
( |
| ) |
|
◆ stop()
void opcua::Client::stop |
( |
| ) |
|
◆ isRunning()
bool opcua::Client::isRunning |
( |
| ) |
const |
|
noexcept |
Check if the client's main loop is running.
◆ getNode()
◆ getRootNode()
◆ getObjectsNode()
◆ getTypesNode()
◆ getViewsNode()
◆ handle() [1/2]
◆ handle() [2/2]
const UA_Client * opcua::Client::handle |
( |
| ) |
const |
|
noexcept |
◆ detail::getConnection