opcua_main.cpp
Go to the documentation of this file.
1 
11 
12 #include "opcua_options.h"
13 
14 #include <opc/ua/client/addon.h>
17 #include <opc/common/uri_facade.h>
18 #include <opc/ua/node.h>
22 
23 #include <algorithm>
24 #include <iostream>
25 #include <stdexcept>
26 
27 namespace
28 {
29 
30 using namespace OpcUa;
31 
32 struct Tabs
33 {
34  Tabs(unsigned num = 0)
35  : Num(num)
36  {
37  }
38  unsigned Num;
39 };
40 
41 std::ostream & operator <<(std::ostream & os, const Tabs & tabs)
42 {
43  for (unsigned i = 0; i < tabs.Num; ++i)
44  {
45  os << " ";
46  }
47 
48  return os;
49 }
50 
51 
53 {
54  switch (mode)
55  {
57  return "none";
58 
60  return "sign";
61 
63  return "sign and encrypt";
64 
65  default:
66  return "unknown";
67  }
68 }
69 
71 {
72  switch (type)
73  {
75  return "server";
76 
78  return "client";
79 
81  return "client and server";
82 
84  return "discovery server";
85 
86  default:
87  return "unknown";
88  }
89 }
90 
92 {
93  switch (type)
94  {
96  return "anonymous";
97 
99  return "username";
100 
102  return "x509v3 certificate";
103 
105  return "WS_Security token";
106 
107  default:
108  return "unknown";
109  }
110 }
111 
112 std::string GetNodeClassName(unsigned cls)
113 {
114  std::string result;
115  NodeClass nodeClass = static_cast<NodeClass>(cls);
116 
117  if (nodeClass == NodeClass::Object)
118  {
119  result += "object";
120  }
121 
122  if (nodeClass == NodeClass::Variable)
123  {
124  if (!result.empty())
125  {
126  result += ", ";
127  }
128 
129  result += "variable";
130  }
131 
132  if (nodeClass == NodeClass::Method)
133  {
134  if (!result.empty())
135  {
136  result += ", ";
137  }
138 
139  result += "method";
140  }
141 
142  if (nodeClass == NodeClass::ObjectType)
143  {
144  if (!result.empty())
145  {
146  result += ", ";
147  }
148 
149  result += "object type";
150  }
151 
152  if (nodeClass == NodeClass::VariableType)
153  {
154  if (!result.empty())
155  {
156  result += ", ";
157  }
158 
159  result += "variable type";
160  }
161 
162  if (nodeClass == NodeClass::ReferenceType)
163  {
164  if (!result.empty())
165  {
166  result += ", ";
167  }
168 
169  result += "reference type";
170  }
171 
172  if (nodeClass == NodeClass::DataType)
173  {
174  if (!result.empty())
175  {
176  result += ", ";
177  }
178 
179  result += "data type";
180  }
181 
182  if (nodeClass == NodeClass::View)
183  {
184  if (!result.empty())
185  {
186  result += ", ";
187  }
188 
189  result += "view";
190  }
191 
192  return result;
193 }
194 
195 
196 
197 
198 void Print(const OpcUa::NodeId & nodeId, const Tabs & tabs)
199 {
201 
202  const Tabs dataTabs(tabs.Num + 2);
203 
204  switch (encoding)
205  {
207  {
208  std::cout << tabs << "Two byte:" << std::endl;
209  std::cout << dataTabs << "Identifier:" << (unsigned)nodeId.TwoByteData.Identifier << std::endl;
210  break;
211  }
212 
214  {
215  std::cout << tabs << "Four byte:" << std::endl;
216  std::cout << dataTabs << "NamespaceIndex:" << (unsigned)nodeId.FourByteData.NamespaceIndex << std::endl;
217  std::cout << dataTabs << "Identifier" << (unsigned)nodeId.FourByteData.Identifier << std::endl;
218  break;
219  }
220 
222  {
223  std::cout << tabs << "Numeric:" << std::endl;
224  std::cout << dataTabs << "NamespaceIndex" << (unsigned)nodeId.NumericData.NamespaceIndex << std::endl;
225  std::cout << dataTabs << "Identifier" << (unsigned)nodeId.NumericData.Identifier << std::endl;
226  break;
227  }
228 
230  {
231  std::cout << tabs << "String: " << std::endl;
232  std::cout << dataTabs << "NamespaceIndex: " << (unsigned)nodeId.StringData.NamespaceIndex << std::endl;
233  std::cout << dataTabs << "Identifier: " << nodeId.StringData.Identifier << std::endl;
234  break;
235  }
236 
238  {
239  std::cout << tabs << "Binary: " << std::endl;
240  std::cout << dataTabs << "NamespaceIndex: " << (unsigned)nodeId.BinaryData.NamespaceIndex << std::endl;
241  std::cout << dataTabs << "Identifier: ";
242 
243  for (auto val : nodeId.BinaryData.Identifier) {std::cout << (unsigned)val; }
244 
245  std::cout << std::endl;
246  break;
247  }
248 
250  {
251  std::cout << tabs << "Guid: " << std::endl;
252  std::cout << dataTabs << "Namespace Index: " << (unsigned)nodeId.GuidData.NamespaceIndex << std::endl;
253  const OpcUa::Guid & guid = nodeId.GuidData.Identifier;
254  std::cout << dataTabs << "Identifier: " << std::hex << guid.Data1 << "-" << guid.Data2 << "-" << guid.Data3;
255 
256  for (auto val : guid.Data4) {std::cout << (unsigned)val; }
257 
258  break;
259  }
260 
261  default:
262  {
263  std::cout << tabs << "unknown id type:" << (unsigned)encoding << std::endl;
264  break;
265  }
266  }
267 
269  {
270  std::cout << tabs << "Namespace URI: " << nodeId.NamespaceURI << std::endl;
271  }
272 
274  {
275  std::cout << tabs << "Server index: " << nodeId.ServerIndex << std::endl;
276  }
277 }
278 
279 void Print(const OpcUa::UserTokenPolicy & policy, const Tabs & tabs)
280 {
281  std::cout << tabs << "Id: " << policy.PolicyId << std::endl;
282  std::cout << tabs << "TokenType: " << GetName(policy.TokenType) << std::endl;
283  std::cout << tabs << "IssuedTokenType: " << policy.IssuedTokenType << std::endl;
284  std::cout << tabs << "IssuerEndpointUrl: " << policy.IssuerEndpointUrl << std::endl;
285  std::cout << tabs << "SecurityPolicyUri: " << policy.SecurityPolicyUri << std::endl;
286 }
287 
288 
289 void Print(const OpcUa::ApplicationDescription & desc, const Tabs & tab)
290 {
291  std::cout << tab << "Name: " << desc.ApplicationName.Text << " (" << desc.ApplicationName.Locale << ")" << std::endl;
292  std::cout << tab << "Type: " << GetName(desc.ApplicationType) << std::endl;
293  std::cout << tab << "URI: " << desc.ApplicationUri << std::endl;
294  std::cout << tab << "ProductURI: " << desc.ProductUri << std::endl;
295  std::cout << tab << "GatewayServerURI: " << desc.GatewayServerUri << std::endl;
296  std::cout << tab << "DiscoveryProfileURI: " << desc.DiscoveryProfileUri << std::endl;
297 
298  if (!desc.DiscoveryUrls.empty())
299  {
300  std::cout << tab << "DiscoveryProfileURLs: ";
301 
302  for (auto it = desc.DiscoveryUrls.begin(); it != desc.DiscoveryUrls.end(); ++it)
303  {
304  std::cout << "'" << *it << "' ";
305  }
306 
307  std::cout << std::endl;
308  }
309 }
310 
311 void Print(const OpcUa::EndpointDescription & desc, const Tabs & tab)
312 {
313  std::cout << tab << "URL: " << desc.EndpointUrl << std::endl;
314  std::cout << tab << "SecurityPolicyUri: " << desc.SecurityPolicyUri << std::endl;
315  std::cout << tab << "SecurityLevel: " << GetName(desc.SecurityMode) << " (" << (int)desc.SecurityMode << ")" << std::endl;
316  std::cout << tab << "TransportProfileURI: " << desc.TransportProfileUri << std::endl;
317  std::cout << tab << "SecurityLevel: " << (int)desc.SecurityLevel << std::endl;
318  std::cout << tab << "Server description: " << std::endl;
319  Print(desc.Server, Tabs(tab.Num + 2));
320 
321  if (!desc.UserIdentityTokens.empty())
322  {
323  std::cout << tab << "User identify tokens: " << std::endl;
324 
325  for (auto it = desc.UserIdentityTokens.begin(); it != desc.UserIdentityTokens.end(); ++it)
326  {
327  std::cout << Tabs(tab.Num + 2) << "token: " << std::endl;
328  Print(*it, Tabs(tab.Num + 4));
329  }
330 
331  std::cout << std::endl;
332  }
333 
334 // CertificateData ServerCertificate;
335 // std::vector<UserTokenPolicy> ;
336 }
337 
338 void PrintEndpoints(OpcUa::Services & computer)
339 {
340  std::shared_ptr<OpcUa::EndpointServices> service = computer.Endpoints();
342  std::vector<OpcUa::EndpointDescription> endpoints = service->GetEndpoints(filter);
343 
344  for (auto it = endpoints.begin(); it != endpoints.end(); ++it)
345  {
346  std::cout << "endpoint:" << std::endl;
347  Print(*it, Tabs(2));
348  }
349 }
350 
351 void PrintServers(OpcUa::Services & computer)
352 {
353  std::shared_ptr<OpcUa::EndpointServices> service = computer.Endpoints();
355  std::vector<OpcUa::ApplicationDescription> applications = service->FindServers(filter);
356 
357  for (const OpcUa::ApplicationDescription & desc : applications)
358  {
359  std::cout << "Application:" << std::endl;
360  Print(desc, Tabs(2));
361  }
362 }
363 
364 inline void PrintReference(const OpcUa::ReferenceDescription & desc, const Tabs & tabs)
365 {
366  const Tabs tabs1(tabs.Num + 2);
367  std::cout << tabs << "DisplayName: " << desc.DisplayName.Text << std::endl;
368  std::cout << tabs << "Browse Name: " << desc.BrowseName.NamespaceIndex << ":" << desc.BrowseName.Name << std::endl;
369  std::cout << tabs << "Is Forward: " << desc.IsForward << std::endl;
370 
371  std::cout << tabs << "Target Node class: " << GetNodeClassName(static_cast<unsigned>(desc.TargetNodeClass)) << std::endl;
372  std::cout << tabs << "Target NodeId:" << std::endl;
373  Print(desc.TargetNodeId, tabs1);
374 
375  std::cout << tabs << "TypeId:" << std::endl;
376  Print(desc.ReferenceTypeId, tabs1);
377 
378  std::cout << tabs << "Type definition Id:" << std::endl;
379  Print(desc.TargetNodeTypeDefinition, tabs1);
380 }
381 
382 void Browse(OpcUa::ViewServices & view, OpcUa::NodeId nodeId)
383 {
385  description.NodeToBrowse = nodeId;
387  description.IncludeSubtypes = true;
390 
391  OpcUa::NodesQuery query;
393  query.NodesToBrowse.push_back(description);
394  query.MaxReferenciesPerNode = 100;
395 
396  std::vector<OpcUa::BrowseResult> results = view.Browse(query);
397 
398  while (true)
399  {
400  if (results.empty())
401  {
402  return;
403  }
404 
405  if (results[0].Referencies.empty())
406  {
407  break;
408  }
409 
410  for (auto refIt : results[0].Referencies)
411  {
412  std::cout << "reference:" << std::endl;
413  PrintReference(refIt, Tabs(2));
414  std::cout << std::endl;
415  }
416 
417  results = view.BrowseNext();
418  }
419 }
420 
421 
422 struct VariantPrinter
423 {
424  template <typename T>
425  void PrintValue(const T & val)
426  {
427  std::cout << val;
428  }
429 
430  void PrintValue(const OpcUa::DiagnosticInfo & info)
431  {
432  std::cout << "!!!TODO!!!";
433  }
434 
435  void PrintValue(const OpcUa::Variant & info)
436  {
437  std::cout << "!!!TODO!!!";
438  }
439 
440  void PrintValue(const OpcUa::LocalizedText & text)
441  {
442  std::cout << text.Text << std::endl;
443  }
444 
445  void PrintValue(const OpcUa::StatusCode & code)
446  {
447  std::cout << OpcUa::ToString(code) << std::endl;
448  }
449 
450  template <typename T>
451  void OnScalar(const T & val)
452  {
453  PrintValue(val);
454  std::cout << std::endl;
455  }
456 
457  template <typename T>
458  void OnContainer(const std::vector<T> & vals)
459  {
460  typedef typename std::vector<T>::const_iterator Iterator;
461 
462  for (Iterator it = vals.begin(); it != vals.end(); ++it)
463  {
464  PrintValue(*it);
465  std::cout << " ";
466  }
467 
468  std::cout << std::endl;
469  }
470 };
471 
472 void Print(const OpcUa::Variant & var, const Tabs & tabs)
473 {
474  VariantPrinter printer;
475  TypedVisitor<VariantPrinter> visitor(printer);
476 
477  switch (var.Type())
478  {
480  {
481  std::cout << tabs << "boolean: ";
482  break;
483  }
484 
485  case VariantType::SBYTE:
486  {
487  std::cout << tabs << "signed byte: ";
488  break;
489  }
490 
491  case VariantType::BYTE:
492  {
493  std::cout << tabs << "byte: ";
494  break;
495  }
496 
497  case VariantType::INT16:
498  {
499  std::cout << tabs << "int16: ";
500  break;
501  }
502 
503  case VariantType::UINT16:
504  {
505  std::cout << tabs << "unsigned int16: ";
506  break;
507  }
508 
509  case VariantType::INT32:
510  {
511  std::cout << tabs << "int32: ";
512  break;
513  }
514 
515  case VariantType::UINT32:
516  {
517  std::cout << tabs << "unsigned int32: ";
518  break;
519  }
520 
521  case VariantType::INT64:
522  {
523  std::cout << tabs << "int64: ";
524  break;
525  }
526 
527 
528  case VariantType::UINT64:
529  {
530  std::cout << tabs << "unsigned int64: ";
531  break;
532  }
533 
534 
535  case VariantType::FLOAT:
536  {
537  std::cout << tabs << "float: ";
538  break;
539  }
540 
541 
542  case VariantType::DOUBLE:
543  {
544  std::cout << tabs << "double: ";
545  break;
546  }
547 
548 
549  case VariantType::STRING:
550  {
551  std::cout << tabs << "string: ";
552  break;
553  }
554 
555 
558  {
559  std::cout << tabs << "NodeId: " << std::endl;
560  break;
561  }
562 
564  {
565  std::cout << tabs << "Name: ";
566  break;
567  }
568 
570  {
571  std::cout << tabs << "Text: ";
572  break;
573  }
574 
575 
577  {
578  std::cout << "DateTime: " << OpcUa::ToString(var.As<DateTime>()) << std::endl;
579  break;
580  }
581 
582  case VariantType::GUId:
589  case VariantType::NUL:
591  break;
592 
593  default:
594  throw std::logic_error("Unknown variant type.");
595  }
596 
597  var.Visit(visitor);
598  std::cout << std::endl;
599 }
600 
601 void Print(const DataValue & value, const Tabs & tabs)
602 {
603  const Tabs tabs1(tabs.Num + 2);
604 
605  if (value.Encoding & DATA_VALUE_STATUS_CODE)
606  {
607  std::cout << tabs << "Status code:" << std::endl;
608  std::cout << tabs1 << "0x" << std::hex << static_cast<uint32_t>(value.Status) << std::endl;
609  }
610 
611  if (value.Encoding & DATA_VALUE)
612  {
613  std::cout << tabs << "Value:" << std::endl;
614  Print(value.Value, tabs1);
615  }
616 }
617 
618 
619 void Read(OpcUa::AttributeServices & attributes, OpcUa::NodeId nodeId, OpcUa::AttributeId attributeId)
620 {
621  ReadParameters params;
622  ReadValueId attribute;
623  attribute.NodeId = nodeId;
624  attribute.AttributeId = attributeId;
625  params.AttributesToRead.push_back(attribute);
626  const std::vector<DataValue> values = attributes.Read(params);
627 
628  if (values.size() != 1)
629  {
630  std::cout << "Server returned " << values.size() << " instead of 1." << std::endl;
631  return;
632  }
633 
634  std::cout << "data value:" << std::endl;
635  Print(values.front(), Tabs(2));
636 }
637 
638 void Write(OpcUa::AttributeServices & attributes, OpcUa::NodeId nodeId, OpcUa::AttributeId attributeId, const OpcUa::Variant & value)
639 {
640  OpcUa::WriteValue attribute;
641  attribute.NodeId = nodeId;
642  attribute.AttributeId = attributeId;
643  attribute.Value = value;
644  std::vector<StatusCode> statuses = attributes.Write(std::vector<OpcUa::WriteValue>(1, attribute));
645 
646  for (OpcUa::StatusCode status : statuses)
647  {
648  std::cout << "Status code: 0x" << std::hex << static_cast<uint32_t>(status) << std::endl;
649  }
650 }
651 
652 void CreateSubscription(OpcUa::SubscriptionServices & subscriptions)
653 {
656  request.Parameters.Priority = 0;
657  request.Parameters.PublishingEnabled = false;
661  const OpcUa::SubscriptionData data = subscriptions.CreateSubscription(request, [](PublishResult) {});
662  std::cout << "Id: " << data.SubscriptionId << std::endl;
663  std::cout << "RevisedPublishingInterval: " << data.RevisedPublishingInterval << std::endl;
664  std::cout << "RevisedLifetimeCount: " << data.RevisedLifetimeCount << std::endl;
665  std::cout << "RevisedMaxKeepAliveCount: " << data.RevisedMaxKeepAliveCount << std::endl;
666 }
667 
668 void Process(OpcUa::CommandLine & cmd, const Common::AddonsManager & addons)
669 {
670  const std::string serverURI = cmd.GetServerURI();
671  const Common::Uri uri(serverURI);
672  OpcUa::Client::Addon::SharedPtr addon = addons.GetAddon<OpcUa::Client::Addon>(uri.Scheme());
673  std::shared_ptr<OpcUa::Services> computer = addon->Connect(serverURI);
674 
675  if (cmd.IsGetEndpointsOperation())
676  {
677  PrintEndpoints(*computer);
678  return;
679  }
680 
681  else if (cmd.IsFindServersOperation())
682  {
683  PrintServers(*computer);
684  }
685 
687  session.ClientDescription.ApplicationUri = "https://github.com/treww/opc_layer.git";
688  session.ClientDescription.ProductUri = "https://github.com/treww/opc_layer.git";
689  session.ClientDescription.ApplicationName.Text = "opcua client";
691  session.SessionName = "opua command line";
692  session.EndpointUrl = serverURI;
693  session.Timeout = 1200000;
694 
695  CreateSessionResponse resp = computer->CreateSession(session);
696  ActivateSessionParameters session_parameters;
697  computer->ActivateSession(session_parameters);
698 
699  if (cmd.IsBrowseOperation())
700  {
701  const OpcUa::NodeId nodeId = cmd.GetNodeId();
702  Print(nodeId, Tabs(0));
703  Browse(*computer->Views(), nodeId);
704  }
705 
706  else if (cmd.IsReadOperation())
707  {
708  const OpcUa::NodeId nodeId = cmd.GetNodeId();
709  const OpcUa::AttributeId attributeId = cmd.GetAttribute();
710  Read(*computer->Attributes(), nodeId, attributeId);
711  }
712 
713  else if (cmd.IsWriteOperation())
714  {
715  const OpcUa::NodeId nodeId = cmd.GetNodeId();
716  const OpcUa::AttributeId attributeId = cmd.GetAttribute();
717  const OpcUa::Variant value = cmd.GetValue();
718  Write(*computer->Attributes(), nodeId, attributeId, value);
719  }
720 
721  else if (cmd.IsCreateSubscriptionOperation())
722  {
723  CreateSubscription(*computer->Subscriptions());
724  }
725 
726  else
727  {
728  std::cout << "nothing to do" << std::endl;
729  }
730 
731 
732  computer->CloseSession();
733 }
734 
735 int RegisterNewModule(const OpcUa::CommandLine & cmd)
736 {
737  std::cout << "Registering new module." << std::endl;
738  const std::string & configDir = cmd.GetConfigDir();
739  const std::string & addonId = cmd.GetModuleId();
740  const std::string & modulePath = cmd.GetModulePath();
741 
742  std::cout << "Id: " << addonId << std::endl;
743  std::cout << "Path: " << modulePath << std::endl;
744  std::cout << "Configuration file: " << configDir << std::endl;
745 
747  const Common::ModulesConfiguration::const_iterator moduleIt = std::find_if(config.Modules.begin(), config.Modules.end(), [&addonId](const Common::ModuleConfiguration & config) {return config.Id == addonId;});
748 
749  if (moduleIt != config.Modules.end())
750  {
751  std::cerr << "Module already registered." << std::endl;
752  return -1;
753  }
754 
756  module.Id = addonId;
757  module.Path = modulePath;
758 
759  config.Modules.push_back(module);
760  Common::SaveConfiguration(config.Modules, configDir);
761  std::cout << "Successfully registered." << std::endl;
762  return 0;
763 }
764 
765 int UnregisterModule(const OpcUa::CommandLine & cmd)
766 {
767  const Common::AddonId addonId = cmd.GetModuleId();
768  const std::string & configDir = cmd.GetConfigDir();
769  std::cout << "Unregistering module." << std::endl;
770  std::cout << "Id: " << addonId << std::endl;
771  std::cout << "Configuration file: " << configDir << std::endl;
772 
774  Common::ModulesConfiguration::iterator moduleIt = std::find_if(config.Modules.begin(), config.Modules.end(), [&addonId](const Common::ModuleConfiguration & config) {return config.Id == addonId;});
775 
776  if (moduleIt == config.Modules.end())
777  {
778  std::cerr << "Module not found" << std::endl;
779  return -1;
780  }
781 
782  config.Modules.erase(moduleIt);
783  Common::SaveConfiguration(config.Modules, configDir);
784 
785  std::cout << "Successfully unregistered." << std::endl;
786  return 0;
787 }
788 }
789 
790 int main(int argc, char ** argv)
791 {
792  auto logger = spdlog::stderr_color_mt("client");
793  logger->set_level(spdlog::level::info);
794 
795  try
796  {
797  OpcUa::CommandLine cmd(argc, argv);
798 
799  if (cmd.IsHelpOperation())
800  {
801  return 0;
802  }
803 
804  if (cmd.IsRegisterModuleOperation())
805  {
806  return RegisterNewModule(cmd);
807  }
808 
809  if (cmd.IsUnregisterModuleOperation())
810  {
811  return UnregisterModule(cmd);
812  }
813 
814  const std::string configDir = cmd.GetConfigDir();
815  const Common::Configuration & config = Common::ParseConfigurationFiles(configDir);
816 
817  std::vector<Common::AddonInformation> infos(config.Modules.size());
818  std::transform(config.Modules.begin(), config.Modules.end(), infos.begin(), std::bind(&Common::GetAddonInfomation, std::placeholders::_1));
819 
820  Common::AddonsManager::UniquePtr manager = Common::CreateAddonsManager(logger);
821  std::for_each(infos.begin(), infos.end(), [&manager](const Common::AddonInformation & addon)
822  {
823  manager->Register(addon);
824  });
825  manager->Start();
826  Process(cmd, *manager);
827  manager->Stop();
828  return 0;
829  }
830 
831  catch (const std::exception & exc)
832  {
833  std::cout << exc.what() << std::endl;
834  }
835 
836  catch (...)
837  {
838  std::cout << "Unknown error." << std::endl;
839  }
840 
841  return -1;
842 }
843 
Configuration ParseConfigurationFiles(const std::string &directory)
void SaveConfiguration(const ModulesConfiguration &configuration, const std::string &configPath)
std::vector< OpcUa::ReadValueId > AttributesToRead
struct OpcUa::NodeId::NumericDataType NumericData
std::vector< OpcUa::UserTokenPolicy > UserIdentityTokens
std::string SecurityPolicyUri
Common::AddonInformation GetAddonInfomation(const ModuleConfiguration &config)
bool IsFindServersOperation() const
Definition: opcua_options.h:91
OpcUa::CreateSubscriptionParameters Parameters
virtual SubscriptionData CreateSubscription(const CreateSubscriptionRequest &, std::function< void(PublishResult)> callbackPublish)=0
ApplicationDescription ClientDescription
Definition: services.h:49
IntFormatSpec< int, TypeSpec<'x'> > hex(int value)
virtual std::shared_ptr< Addon > GetAddon(const AddonId &id) const =0
getting addon by id
bool IsGetEndpointsOperation() const
Definition: opcua_options.h:66
std::vector< BrowseDescription > NodesToBrowse
Definition: protocol/view.h:50
const uint8_t DATA_VALUE_STATUS_CODE
Definition: data_value.h:19
std::string IssuedTokenType
std::string GetModuleId() const
Definition: opcua_options.h:51
std::vector< T > Browse(const NodeId &node, NodeClass nodeClassMask, Services::SharedPtr services)
Definition: model_impl.h:31
uint16_t NamespaceIndex
Definition: types.h:73
const char * modulePath
struct OpcUa::NodeId::GuidDataType GuidData
bool IsHelpOperation() const
struct OpcUa::NodeId::TwoByteDataType TwoByteData
bool IsBrowseOperation() const
Definition: opcua_options.h:71
bool IsUnregisterModuleOperation() const
OpcUa::ApplicationDescription Server
description
Definition: setup.py:43
AttributeId GetAttribute() const
Definition: opcua_options.h:46
void Visit(VariantVisitor &visitor) const
struct OpcUa::NodeId::BinaryDataType BinaryData
OpcUa::ApplicationType ApplicationType
Tabs(unsigned num=0)
Definition: describe.h:22
bool IsReadOperation() const
Definition: opcua_options.h:76
Variant GetValue() const
Definition: opcua_options.h:41
virtual EndpointServices::SharedPtr Endpoints()=0
AddonsManager::UniquePtr CreateAddonsManager(const Common::Logger::SharedPtr &logger)
Get instance of addons core.
unsigned Num
Definition: describe.h:27
virtual std::vector< BrowseResult > Browse(const OpcUa::NodesQuery &query) const =0
MessageSecurityMode
Definition: enums.h:68
struct OpcUa::NodeId::FourByteDataType FourByteData
VariantType Type() const
OpcUa::MessageSecurityMode SecurityMode
OPC UA Address space part. GNU LGPL.
std::vector< uint8_t > Identifier
Definition: nodeid.h:101
UserTokenType
Definition: enums.h:80
string uri
Definition: client.py:31
std::string AddonId
Definition: addon_manager.h:24
virtual std::vector< StatusCode > Write(const std::vector< OpcUa::WriteValue > &filter)=0
int main(int argc, char **argv)
Definition: opcua_main.cpp:790
struct OpcUa::NodeId::StringDataType StringData
NodeIdEncoding
Definition: nodeid.h:27
std::string GetModulePath() const
Definition: opcua_options.h:56
OpcUa::LocalizedText ApplicationName
virtual std::vector< DataValue > Read(const OpcUa::ReadParameters &filter) const =0
BrowseResultMask ResultMask
Definition: protocol/view.h:41
NodeClass
Definition: enums.h:39
std::string Text
Definition: types.h:136
uint32_t ServerIndex
Definition: nodeid.h:48
std::string Name
Definition: types.h:74
NodeIdEncoding Encoding
Definition: nodeid.h:46
uint32_t MaxReferenciesPerNode
Definition: protocol/view.h:49
std::string ToString(const AttributeId &value)
NodeId GetNodeId() const
Definition: opcua_options.h:31
bool IsCreateSubscriptionOperation() const
Definition: opcua_options.h:86
static DateTime Current()
OpcUa::UserTokenType TokenType
std::vector< std::string > DiscoveryUrls
BrowseDirection Direction
Definition: protocol/view.h:37
std::ostream & operator<<(std::ostream &os, const Node &node)
Definition: node.cpp:566
OpcUa::AttributeId AttributeId
OpcUa::DataValue Value
bool IsRegisterModuleOperation() const
Definition: opcua_options.h:96
uint8_t Encoding
Definition: data_value.h:28
bool IsWriteOperation() const
Definition: opcua_options.h:81
T As() const
Definition: variant.h:271
virtual std::vector< BrowseResult > BrowseNext() const =0
OpcUa::NodeId NodeId
std::string GetServerURI() const
Definition: opcua_options.h:26
StatusCode Status
Definition: data_value.h:30
std::vector< ModuleConfiguration > Modules
Definition: config_file.h:32
std::string IssuerEndpointUrl
OpcUa::NodeId NodeId
std::string Locale
Definition: types.h:135
std::shared_ptr< logger > stderr_color_mt(const std::string &logger_name)
Definition: spdlog_impl.h:150
std::string NamespaceURI
Definition: nodeid.h:47
ApplicationType
Definition: enums.h:56
OpcUa::AttributeId AttributeId
ViewDescription View
Definition: protocol/view.h:48
computer
Definition: test.py:6
std::string GetConfigDir() const
Definition: opcua_options.h:61


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