builtin_server_test.h
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include "builtin_server_addon.h"
14 #include "builtin_server.h"
17 
18 namespace OpcUa
19 {
20 namespace Test
21 {
22 // This is a addon that emulates network connection and therefore no real tcp connection is required for testing.
23 // It provides communication between client and server in one process
24 // With exchanging data through memory.
25 
27 {
33 
34  Common::ParametersGroup application("application");
35  application.Parameters.push_back(Common::Parameter("application_name", "Test OPC UA Server"));
36  application.Parameters.push_back(Common::Parameter("application_uri", "opcua.treww.org"));
37  application.Parameters.push_back(Common::Parameter("application_type", "server"));
38 
39  Common::ParametersGroup userTokenPolicy("user_token_policy");
40  userTokenPolicy.Parameters.push_back(Common::Parameter("id", "anonymous"));
41  userTokenPolicy.Parameters.push_back(Common::Parameter("type", "anonymous"));
42  userTokenPolicy.Parameters.push_back(Common::Parameter("uri", "http://opcfoundation.org/UA/SecurityPolicy#None"));
43  application.Groups.push_back(userTokenPolicy);
44 
45  Common::ParametersGroup endpoint("endpoint");
46  endpoint.Parameters.push_back(Common::Parameter("url", "opc.tcp://localhost:4841"));
47  endpoint.Parameters.push_back(Common::Parameter("security_mode", "none"));
48  endpoint.Parameters.push_back(Common::Parameter("transport_profile_uri", "http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary"));
49  application.Groups.push_back(endpoint);
50 
51  opcTcp.Parameters.Groups.push_back(application);
52  opcTcp.Parameters.Parameters.push_back(Common::Parameter("debug", "0"));
53 
54  addons.Register(opcTcp);
55 
56 }
57 
58 } // namespace Test
59 } // namespace OpcUa
60 
61 
const char EndpointsRegistryAddonId[]
const char SubscriptionServiceAddonId[]
std::vector< Parameter > Parameters
std::vector< ParametersGroup > Groups
void RegisterBuiltinServerAddon(Common::AddonsManager &addons)
std::shared_ptr< AddonFactory > Factory
Definition: addon_manager.h:32
std::vector< AddonId > Dependencies
Definition: addon_manager.h:33
OPC UA Address space part. GNU LGPL.
AddonParameters Parameters
Definition: addon_manager.h:34
std::vector< ParametersGroup > Groups
virtual void Register(const AddonInformation &caddonConfiguration)=0
register new addon.
std::vector< Parameter > Parameters


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