High Performance OPC UA Server SDK  1.1.0.158
ua_statuscode

A numerical value that is used to report the outcome of an operation performed by an OPC UA Server. More...

Typedefs

typedef uint32_t ua_statuscode
 A numerical value indicating outcome of an UA server operation, possible values are listed in ua_statuscodes.
 

Functions

static void ua_statuscode_init (ua_statuscode *dt)
 Initialize statuscode with good.
 
static void ua_statuscode_clear (ua_statuscode *dt)
 Clear statuscode and write good.
 
static int ua_statuscode_compare (const ua_statuscode *a, const ua_statuscode *b)
 Compare two statuscodes. More...
 
static int ua_statuscode_copy (ua_statuscode *dst, const ua_statuscode *src)
 Copy statuscode from src to dst. More...
 
static bool ua_statuscode_is_good (ua_statuscode status)
 Test if a statuscode is good.
 
static bool ua_statuscode_is_uncertain (ua_statuscode status)
 Test if a statuscode is uncertain.
 
static bool ua_statuscode_is_bad (ua_statuscode status)
 Test if a statuscode is bad.
 

Detailed Description

A numerical value that is used to report the outcome of an operation performed by an OPC UA Server.

This code may have associated diagnostic information that describes the status in more detail; however, the code by itself is intended to provide Client applications with enough information to make decisions on how to process the results of an OPC UA Service.

The StatusCode is a 32-bit unsigned integer. The top 16 bits represent the numeric value of the code that shall be used for detecting specific errors or conditions. The bottom 16 bits are bit flags that contain additional information but do not affect the meaning of the StatusCode.

All OPC UA Clients shall always check the StatusCode associated with a result before using it. Results that have an uncertain/warning status associated with them shall be used with care since these results might not be valid in all situations. Results with a bad/failed status shall never be used.

OPC UA Servers should return good/success StatusCodes if the operation completed normally and the result is always valid. Different StatusCode values can provide additional information to the Client.

OPC UA Servers should use uncertain/warning StatusCodes if they could not complete the operation in the manner requested by the Client, however, the operation did not fail entirely.

The list of StatusCodes is managed by OPC UA. The complete list of StatusCodes is defined in Part 6 of the OPC UA Specification. Servers shall not define their own StatusCodes. OPC UA companion working groups may request additional StatusCodes from the OPC Foundation to be added to the list in Part 6.

Function Documentation

static int ua_statuscode_compare ( const ua_statuscode a,
const ua_statuscode b 
)
inlinestatic

Compare two statuscodes.

Returns
Zero if both statuscodes are the same.
static int ua_statuscode_copy ( ua_statuscode dst,
const ua_statuscode src 
)
inlinestatic

Copy statuscode from src to dst.

Returns
Zero on success.