builtin_server_test.h
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 #pragma once
00012 
00013 #include "builtin_server_addon.h"
00014 #include "builtin_server.h"
00015 #include <opc/common/addons_core/addon_manager.h>
00016 #include <opc/ua/server/addons/subscription_service.h>
00017 
00018 namespace OpcUa
00019 {
00020   namespace Test
00021   {
00022     // This is a addon that emulates network connection and therefore no real tcp connection is required for testing.
00023     // It provides communication between client and server in one process
00024     // With exchanging data through memory.
00025 
00026     void RegisterBuiltinServerAddon(Common::AddonsManager& addons)
00027     {
00028       Common::AddonInformation opcTcp;
00029       opcTcp.Factory.reset(new OpcUa::Server::BuiltingServerFactory());
00030       opcTcp.Id = OpcUa::Server::OpcUaProtocolAddonId;
00031       opcTcp.Dependencies.push_back(OpcUa::Server::EndpointsRegistryAddonId);
00032       opcTcp.Dependencies.push_back(OpcUa::Server::SubscriptionServiceAddonId);
00033 
00034       Common::ParametersGroup application("application");
00035       application.Parameters.push_back(Common::Parameter("application_name","Test OPC UA Server"));
00036       application.Parameters.push_back(Common::Parameter("application_uri","opcua.treww.org"));
00037       application.Parameters.push_back(Common::Parameter("application_type","server"));
00038 
00039       Common::ParametersGroup userTokenPolicy("user_token_policy");
00040       userTokenPolicy.Parameters.push_back(Common::Parameter("id", "anonymous"));
00041       userTokenPolicy.Parameters.push_back(Common::Parameter("type", "anonymous"));
00042       userTokenPolicy.Parameters.push_back(Common::Parameter("uri", "http://opcfoundation.org/UA/SecurityPolicy#None"));
00043       application.Groups.push_back(userTokenPolicy);
00044 
00045       Common::ParametersGroup endpoint("endpoint");
00046       endpoint.Parameters.push_back(Common::Parameter("url", "opc.tcp://localhost:4841"));
00047       endpoint.Parameters.push_back(Common::Parameter("security_mode","none"));
00048       endpoint.Parameters.push_back(Common::Parameter("transport_profile_uri","http://opcfoundation.org/UA-Profile/Transport/uatcp-uasc-uabinary"));
00049       application.Groups.push_back(endpoint);
00050 
00051       opcTcp.Parameters.Groups.push_back(application);
00052       opcTcp.Parameters.Parameters.push_back(Common::Parameter("debug", "0"));
00053 
00054       addons.Register(opcTcp);
00055 
00056     }
00057 
00058   } // namespace Test
00059 } // namespace OpcUa
00060 
00061 


ros_opcua_impl_freeopcua
Author(s): Denis Štogl
autogenerated on Sat Jun 8 2019 18:24:40