High Performance OPC UA Server SDK  1.2.0.193
ua_qualifiedname Struct Reference

Contains a qualified name. More...

#include <qualifiedname.h>

Public Member Functions

void ua_qualifiedname_init (struct ua_qualifiedname *qn)
 Initializes an ua_qualifiedname t with a null name and namespace index zero.
 
void ua_qualifiedname_clear (struct ua_qualifiedname *qn)
 Clears an ua_qualifiedname t and sets a null name and namespace index to zero.
 
int ua_qualifiedname_set (struct ua_qualifiedname *qn, uint16_t nsindex, const char *name)
 Set the namespace index and name of an ua_qualifiedname. More...
 
int ua_qualifiedname_compare (const struct ua_qualifiedname *a, const struct ua_qualifiedname *b)
 Compare two ua_qualifiednames. More...
 
int ua_qualifiedname_copy (struct ua_qualifiedname *dst, const struct ua_qualifiedname *src)
 Copy the ua_qualifiedname src to dst. More...
 
int ua_qualifiedname_to_string (const struct ua_qualifiedname *qn, struct ua_string *dst)
 Converts a UA qualified name into an UA string. More...
 
int ua_qualifiedname_snprintf (char *dst, size_t size, const struct ua_qualifiedname *qn)
 Converts the given UA qualifiedname parameter dt into a string. More...
 
int ua_qualifiedname_from_string (struct ua_qualifiedname *qn, const struct ua_string *src)
 Parses the given string and creates a qualified name from it. More...
 

Data Fields

struct ua_string name
 The text portion of the QualifiedName. More...
 
uint16_t nsindex
 Index that identifies the namespace that defines the name. More...
 

Related Functions

#define UA_QUALIFIEDNAME_INITIALIZER   { UA_STRING_INITIALIZER, 0 }
 Initializes ua_qualifiedname with namespace index zero and null name.
 

Detailed Description

Contains a qualified name.

It is, for example, used as BrowseName. The name part of the QualifiedName is restricted to 512 characters.

Member Function Documentation

int ua_qualifiedname_compare ( const struct ua_qualifiedname a,
const struct ua_qualifiedname b 
)

Compare two ua_qualifiednames.

Returns
Zero if both ua_qualifiednames are the same.
int ua_qualifiedname_copy ( struct ua_qualifiedname dst,
const struct ua_qualifiedname src 
)

Copy the ua_qualifiedname src to dst.

Returns
Zero on success or errorcode on failure.
int ua_qualifiedname_from_string ( struct ua_qualifiedname qn,
const struct ua_string src 
)

Parses the given string and creates a qualified name from it.

This is the reverse operation of ua_qualifiedname_to_string.

Parameters
qnPointer to qualfiedname which should be initialized. src The qualified name text input.
int ua_qualifiedname_set ( struct ua_qualifiedname qn,
uint16_t  nsindex,
const char *  name 
)

Set the namespace index and name of an ua_qualifiedname.

This function makes a copy of the name, so the ua_qualifiedname t must be cleared when no longer needed.

Parameters
tua_qualifiedname to set namespace index and name.
nsindexNamespace index to set.
nameName to set.
Returns
Zero on success or errorcode on failure.
int ua_qualifiedname_snprintf ( char *  dst,
size_t  size,
const struct ua_qualifiedname qn 
)

Converts the given UA qualifiedname parameter dt into a string.

This functions prints the qualifiedname string into the preallocated buffer dst. The qualifiedname format is "[<nsidx>:]<name>". The <nsidx> part is optional and is only printed if the nsidx is not zero.

Parameters
dstPointer of preallocated string buffer.
sizeLength of dst in bytes.
qnUA QualifiedName input parameter.
Returns
Zero on success. UA_EBADTRUNCATED if the provided buffer was too short.
int ua_qualifiedname_to_string ( const struct ua_qualifiedname qn,
struct ua_string dst 
)

Converts a UA qualified name into an UA string.

This function uses ua_qualifiedname_snprintf to write the formatted string into the UA string buffer. The parameter dst can be an uninitialized variable. It will be initialized using ua_string_allocate. You must call ua_string_clear to free this resources.

Example:

struct ua_qualifiedname *bn;
struct ua_string browsname;
if (ua_node_get_browsename(node, &bn) == 0) {
ua_qualifiedname_to_string(bn, &browsename);
printf("browsename = %s\n", ua_string_const_data(&browsename));
ua_string_clear(&browsename);
}
Parameters
qnThe UA datetime value
dstThe UA string which receives the result.
Returns
Zero on success, a negative error code on failure.

Field Documentation

struct ua_string name

The text portion of the QualifiedName.

uint16_t nsindex

Index that identifies the namespace that defines the name.

This index is the index of that namespace in the local Server’s NamespaceArray.

The Client may read the NamespaceArray Variable to access the string value of the namespace.


The documentation for this struct was generated from the following files: