binary_client_addon.cpp
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 #include <opc/ua/client/addon.h>
00013 #include <opc/ua/client/binary_client.h>
00014 #include <opc/common/addons_core/addon_manager.h>
00015 
00016 #include <opc/common/uri_facade.h>
00017 #include <opc/ua/client/binary_client.h>
00018 #include <opc/ua/client/remote_connection.h>
00019 
00020 
00021 
00022 namespace
00023 {
00024   class BinaryClientAddon : public OpcUa::Client::Addon
00025   {
00026   public:
00027     virtual void Initialize(Common::AddonsManager& manager, const Common::AddonParameters& parameters)
00028     {
00029       for (auto param = parameters.Parameters.begin(); param != parameters.Parameters.begin(); ++param)
00030       {
00031         if (param->Name == "debug" && param->Value != "false" && param->Value != "0")
00032         {
00033           Debug = true;
00034         }
00035       }
00036     }
00037 
00038     virtual void Stop()
00039     {
00040     }
00041 
00042   public:
00043     virtual std::string GetProtocol() const
00044     {
00045       return "opc.tcp";
00046     }
00047 
00048     virtual OpcUa::Services::SharedPtr Connect(const std::string& url)
00049     {
00050       return OpcUa::CreateBinaryClient(url, Debug);
00051     }
00052 
00053   private:
00054     bool Debug = false;
00055   };
00056 }
00057 
00058 extern "C" Common::Addon* CreateAddon()
00059 {
00060   return new BinaryClientAddon();
00061 }


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