Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
OpcUa::UaClient Class Reference

#include <client.h>

Public Member Functions

void Abort ()
 Abort server connection. More...
 
void Connect (const std::string &endpoint)
 connect to a server, specify endpoint as string More...
 
void Connect (const EndpointDescription &)
 connect to a server, specify endpoint as EndpointDesciption More...
 
ServerOperations CreateServerOperations ()
 Create a server operations object. More...
 
Subscription::SharedPtr CreateSubscription (unsigned int period, SubscriptionHandler &client)
 Create a subscription objects. More...
 
void DeleteNodes (std::vector< OpcUa::Node > &nodes, bool recursive=false)
 
void Disconnect ()
 Disconnect from server. More...
 
std::string GetApplicationURI () const
 set application description More...
 
std::string GetEndpoint () const
 
uint32_t GetNamespaceIndex (std::string uri)
 
Node GetNode (const NodeId &nodeid) const
 Get a specific node by nodeid. More...
 
Node GetNode (const std::string &nodeid) const
 
Node GetObjectsNode () const
 
std::string GetProductURI () const
 
Node GetRootNode () const
 helper methods for node you will probably want to access More...
 
std::string GetSecurityPolicy () const
 
std::vector< EndpointDescriptionGetServerEndpoints (const std::string &endpoint)
 Connect to server and get endpoints. More...
 
std::vector< EndpointDescriptionGetServerEndpoints ()
 get endpoints from server, assume we are already connected More...
 
std::vector< std::string > GetServerNamespaces ()
 Get namespaces used by server. More...
 
Node GetServerNode () const
 
std::string GetSessionName () const
 
UaClientoperator= (const UaClient &)=delete
 
EndpointDescription SelectEndpoint (const std::string &)
 Connect to server and select one endpoint. More...
 
void SetApplicationURI (std::string uri)
 
void SetProductURI (std::string uri)
 
void SetSecurityPolicy (std::string sec)
 set security policy More...
 
void SetSessionName (const std::string &str)
 set session name More...
 
 UaClient (bool debug=false)
 create high level client this class is meant to be used to quickly/easily connect to an OPCUA server it may not offer absolutely all features available in protocol you may want to look at code and implement your own client if you need debug argument will make freeopcua write A LOT to stdout set endpoint uri on wich server will listen. opc.tcp://localhost:4841/opcua/server opc.tcp://192.168.1.1:4840/opcua/server opc.tcp://server.freeopca.org:4841/opcua/server More...
 
 UaClient (std::shared_ptr< spdlog::logger > logger)
 
 UaClient (const UaClient &&)=delete
 
 UaClient (const UaClient &)=delete
 
virtual ~UaClient ()
 

Protected Member Functions

virtual void EncryptPassword (OpcUa::UserIdentifyToken &identity, const CreateSessionResponse &response)
 

Protected Attributes

std::string ApplicationUri = "urn:freeopcua:client"
 
uint32_t DefaultTimeout = 3600000
 
EndpointDescription Endpoint
 
KeepAliveThread KeepAlive
 
Common::Logger::SharedPtr Logger
 
std::string ProductUri = "urn:freeopcua.github.no:client"
 
uint32_t SecureChannelId
 
std::string SecurityPolicy = "none"
 
Services::SharedPtr Server
 
std::string SessionName = "Open source OPC-UA Client Session"
 

Private Member Functions

std::vector< OpcUa::NodeAddChilds (std::vector< OpcUa::Node > nodes)
 
void CloseSecureChannel ()
 
void OpenSecureChannel ()
 

Detailed Description

Definition at line 64 of file client.h.

Constructor & Destructor Documentation

OpcUa::UaClient::UaClient ( bool  debug = false)

create high level client this class is meant to be used to quickly/easily connect to an OPCUA server it may not offer absolutely all features available in protocol you may want to look at code and implement your own client if you need debug argument will make freeopcua write A LOT to stdout set endpoint uri on wich server will listen. opc.tcp://localhost:4841/opcua/server opc.tcp://192.168.1.1:4840/opcua/server opc.tcp://server.freeopca.org:4841/opcua/server

Definition at line 114 of file client.cpp.

OpcUa::UaClient::UaClient ( std::shared_ptr< spdlog::logger logger)
inline

Definition at line 77 of file client.h.

OpcUa::UaClient::~UaClient ( )
virtual

Definition at line 342 of file client.cpp.

OpcUa::UaClient::UaClient ( const UaClient &&  )
delete
OpcUa::UaClient::UaClient ( const UaClient )
delete

Member Function Documentation

void OpcUa::UaClient::Abort ( )

Abort server connection.

Definition at line 363 of file client.cpp.

std::vector< OpcUa::Node > OpcUa::UaClient::AddChilds ( std::vector< OpcUa::Node nodes)
private

Definition at line 458 of file client.cpp.

void OpcUa::UaClient::CloseSecureChannel ( )
private

Definition at line 337 of file client.cpp.

void OpcUa::UaClient::Connect ( const std::string &  endpoint)

connect to a server, specify endpoint as string

Definition at line 213 of file client.cpp.

void OpcUa::UaClient::Connect ( const EndpointDescription endpoint)

connect to a server, specify endpoint as EndpointDesciption

Definition at line 220 of file client.cpp.

ServerOperations OpcUa::UaClient::CreateServerOperations ( )

Create a server operations object.

Definition at line 487 of file client.cpp.

Subscription::SharedPtr OpcUa::UaClient::CreateSubscription ( unsigned int  period,
SubscriptionHandler client 
)

Create a subscription objects.

Definition at line 479 of file client.cpp.

void OpcUa::UaClient::DeleteNodes ( std::vector< OpcUa::Node > &  nodes,
bool  recursive = false 
)

Definition at line 431 of file client.cpp.

void OpcUa::UaClient::Disconnect ( )

Disconnect from server.

Definition at line 347 of file client.cpp.

void OpcUa::UaClient::EncryptPassword ( OpcUa::UserIdentifyToken identity,
const CreateSessionResponse response 
)
protectedvirtual

Definition at line 492 of file client.cpp.

std::string OpcUa::UaClient::GetApplicationURI ( ) const
inline

set application description

Definition at line 118 of file client.h.

std::string OpcUa::UaClient::GetEndpoint ( ) const
inline

Definition at line 115 of file client.h.

uint32_t OpcUa::UaClient::GetNamespaceIndex ( std::string  uri)

Definition at line 378 of file client.cpp.

Node OpcUa::UaClient::GetNode ( const NodeId nodeid) const

Get a specific node by nodeid.

Definition at line 403 of file client.cpp.

Node OpcUa::UaClient::GetNode ( const std::string &  nodeid) const

Definition at line 398 of file client.cpp.

Node OpcUa::UaClient::GetObjectsNode ( ) const

Definition at line 417 of file client.cpp.

std::string OpcUa::UaClient::GetProductURI ( ) const
inline

Definition at line 120 of file client.h.

Node OpcUa::UaClient::GetRootNode ( ) const

helper methods for node you will probably want to access

Definition at line 410 of file client.cpp.

std::string OpcUa::UaClient::GetSecurityPolicy ( ) const
inline

Definition at line 126 of file client.h.

std::vector< EndpointDescription > OpcUa::UaClient::GetServerEndpoints ( const std::string &  endpoint)

Connect to server and get endpoints.

Definition at line 133 of file client.cpp.

std::vector< EndpointDescription > OpcUa::UaClient::GetServerEndpoints ( )

get endpoints from server, assume we are already connected

Definition at line 153 of file client.cpp.

std::vector< std::string > OpcUa::UaClient::GetServerNamespaces ( )

Get namespaces used by server.

Definition at line 370 of file client.cpp.

Node OpcUa::UaClient::GetServerNode ( ) const

Definition at line 424 of file client.cpp.

std::string OpcUa::UaClient::GetSessionName ( ) const
inline

Definition at line 86 of file client.h.

void OpcUa::UaClient::OpenSecureChannel ( )
private

Definition at line 317 of file client.cpp.

UaClient& OpcUa::UaClient::operator= ( const UaClient )
delete
EndpointDescription OpcUa::UaClient::SelectEndpoint ( const std::string &  endpoint)

Connect to server and select one endpoint.

Definition at line 164 of file client.cpp.

void OpcUa::UaClient::SetApplicationURI ( std::string  uri)
inline

Definition at line 119 of file client.h.

void OpcUa::UaClient::SetProductURI ( std::string  uri)
inline

Definition at line 121 of file client.h.

void OpcUa::UaClient::SetSecurityPolicy ( std::string  sec)
inline

set security policy

Definition at line 125 of file client.h.

void OpcUa::UaClient::SetSessionName ( const std::string &  str)
inline

set session name

Definition at line 85 of file client.h.

Member Data Documentation

std::string OpcUa::UaClient::ApplicationUri = "urn:freeopcua:client"
protected

Definition at line 169 of file client.h.

uint32_t OpcUa::UaClient::DefaultTimeout = 3600000
protected

Definition at line 175 of file client.h.

EndpointDescription OpcUa::UaClient::Endpoint
protected

Definition at line 166 of file client.h.

KeepAliveThread OpcUa::UaClient::KeepAlive
protected

Definition at line 172 of file client.h.

Common::Logger::SharedPtr OpcUa::UaClient::Logger
protected

Definition at line 174 of file client.h.

std::string OpcUa::UaClient::ProductUri = "urn:freeopcua.github.no:client"
protected

Definition at line 170 of file client.h.

uint32_t OpcUa::UaClient::SecureChannelId
protected

Definition at line 173 of file client.h.

std::string OpcUa::UaClient::SecurityPolicy = "none"
protected

Definition at line 171 of file client.h.

Services::SharedPtr OpcUa::UaClient::Server
protected

Definition at line 176 of file client.h.

std::string OpcUa::UaClient::SessionName = "Open source OPC-UA Client Session"
protected

Definition at line 168 of file client.h.


The documentation for this class was generated from the following files:


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Tue Jan 19 2021 03:12:10