ChimeraTK-ControlSystemAdapter-OPCUAAdapter  04.00.01
ua_typeconversion.h File Reference
#include <open62541/server.h>
#include <string>
+ Include dependency graph for ua_typeconversion.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define UA_STRING_TO_CPPSTRING_COPY(_p_uastring, _p_cppstring)
 
#define UASTRING_AS_CSTRING(_p_uastring, _p_strbuffer)
 
#define UASTRING_TO_CPPSTRING(_p_uastring, _p_cppstring)
 
#define NODE_BROWSENAME_AS_STRING(_p_server, _p_nodeid, _p_strbuffer)
 
#define NODE_DISPLAYNAME_AS_STRING(_p_server, _p_nodeid, _p_strbuffer)
 
#define NODE_DESCRIPTION_AS_STRING(_p_server, _p_nodeid, _p_strbuffer)
 

Macro Definition Documentation

◆ NODE_BROWSENAME_AS_STRING

#define NODE_BROWSENAME_AS_STRING (   _p_server,
  _p_nodeid,
  _p_strbuffer 
)
Value:
{ \
UA_QualifiedName _p_tmpName; \
UA_Server_readBrowseName(_p_server, _p_nodeid, &_p_tmpName); \
UASTRING_AS_STRING(_p_tmpName.name, _p_strbuffer); \
}

Definition at line 61 of file ua_typeconversion.h.

◆ NODE_DESCRIPTION_AS_STRING

#define NODE_DESCRIPTION_AS_STRING (   _p_server,
  _p_nodeid,
  _p_strbuffer 
)
Value:
{ \
UA_LocalizedText _p_tmpName; \
UA_Server_readDisplayName(_p_server, _p_nodeid, &_p_tmpName); \
UASTRING_AS_STRING(_p_tmpName.text, _p_strbuffer); \
}

Definition at line 75 of file ua_typeconversion.h.

◆ NODE_DISPLAYNAME_AS_STRING

#define NODE_DISPLAYNAME_AS_STRING (   _p_server,
  _p_nodeid,
  _p_strbuffer 
)
Value:
{ \
UA_LocalizedText _p_tmpName; \
UA_Server_readDisplayName(_p_server, _p_nodeid, &_p_tmpName); \
UASTRING_AS_STRING(_p_tmpName.text, _p_strbuffer); \
}

Definition at line 68 of file ua_typeconversion.h.

◆ UA_STRING_TO_CPPSTRING_COPY

#define UA_STRING_TO_CPPSTRING_COPY (   _p_uastring,
  _p_cppstring 
)
Value:
do { \
UA_String* ua_url = (UA_String*)_p_uastring; \
char* ua_str_tmp = (char*)malloc(ua_url->length + 1); \
memset(ua_str_tmp, 0, ua_url->length + 1); \
strncpy(ua_str_tmp, (char*)ua_url->data, ua_url->length); \
*(_p_cppstring) = ua_str_tmp; \
free(ua_str_tmp); \
} while(0);

Definition at line 28 of file ua_typeconversion.h.

◆ UASTRING_AS_CSTRING

#define UASTRING_AS_CSTRING (   _p_uastring,
  _p_strbuffer 
)
Value:
{ \
_p_strbuffer = (char*)malloc(_p_uastring.length + 1); \
memset(_p_strbuffer, 0, _p_uastring.length + 1); \
memcpy(_p_strbuffer, _p_uastring.data, _p_uastring.length); \
}

Definition at line 42 of file ua_typeconversion.h.

◆ UASTRING_TO_CPPSTRING

#define UASTRING_TO_CPPSTRING (   _p_uastring,
  _p_cppstring 
)
Value:
do { \
char* s; \
UASTRING_AS_CSTRING(_p_uastring, s) \
_p_cppstring.assign(s, _p_uastring.length); \
free(s); \
} while(0);

Definition at line 53 of file ua_typeconversion.h.