High Performance OPC UA Server SDK
1.7.1.383
|
Utilitys for simplifying the call service implementation. More...
Data Structures | |
struct | uaserver_call_utility_arg |
Structure to describe a method input or output argument. More... | |
Macros | |
#define | uaserver_call_utility_clear_plain_array(structure) |
Clear a plain array with no further allocated data. More... | |
#define | uaserver_call_utility_clear_array(structure, structure_count, clear_fct) |
Clear each member of an array and the array itself. More... | |
Enumerations | |
enum | uaserver_call_utility_flag { UASERVER_CALL_UTILITY_FLAG_NONE = 0, UASERVER_CALL_UTILITY_FLAG_SKIP_TYPE_CHECK = 1, UASERVER_CALL_UTILITY_FLAG_ABSTRACT_TYPE = 2 } |
Flags to influence the behavior of functions. More... | |
Functions | |
SERVER_EXPORT ua_statuscode | uaserver_call_utility_check_arguments (const struct uaserver_call_utility_arg *types, int32_t num_types, const struct ua_callmethodrequest *req, struct ua_callmethodresult *res) |
Utility function to check the input arguments provided by a client for a method. More... | |
SERVER_EXPORT ua_statuscode | uaserver_call_utility_attach_arguments (struct ua_callmethodresult *res, const struct uaserver_call_utility_arg *types, int32_t num_types,...) |
Attach output arguments to the ua_callmethodresult. More... | |
SERVER_EXPORT ua_statuscode | uaserver_call_utility_check_permission (const struct uasession_session *session, const struct ua_nodeid *object_nodeid, const struct ua_nodeid *method_nodeid) |
This function evaluates the call permissions. More... | |
Utilitys for simplifying the call service implementation.
#define uaserver_call_utility_clear_array | ( | structure, | |
structure_count, | |||
clear_fct | |||
) |
Clear each member of an array and the array itself.
#define uaserver_call_utility_clear_plain_array | ( | structure | ) |
Clear a plain array with no further allocated data.
Flags to influence the behavior of functions.
SERVER_EXPORT ua_statuscode uaserver_call_utility_attach_arguments | ( | struct ua_callmethodresult * | res, |
const struct uaserver_call_utility_arg * | types, | ||
int32_t | num_types, | ||
... | |||
) |
Attach output arguments to the ua_callmethodresult.
Takes an array of output argument type descriptions and attaches values to the ua_callmethodresult according to the description. The function takes a variable number of arguments, so it works for any number and type of output arguments.
The values are attached to the ua_callmethodresult and detached values are set to NULL, in case of an error a partial number of values might be attached, so all values must be checked for NULL and cleared and the ua_callmethodresult must be cleared.
Example usage for different datatypes:
SERVER_EXPORT ua_statuscode uaserver_call_utility_check_arguments | ( | const struct uaserver_call_utility_arg * | types, |
int32_t | num_types, | ||
const struct ua_callmethodrequest * | req, | ||
struct ua_callmethodresult * | res | ||
) |
Utility function to check the input arguments provided by a client for a method.
Takes an array of input argument type descripitons and checks the values in a ua_callmethodrequest match the description. If it does returns a good statuscode, else the ua_callmethodresult is filled accordingly and a bad statuscode is returned.
SERVER_EXPORT ua_statuscode uaserver_call_utility_check_permission | ( | const struct uasession_session * | session, |
const struct ua_nodeid * | object_nodeid, | ||
const struct ua_nodeid * | method_nodeid | ||
) |
This function evaluates the call permissions.
The client may do the method call with the method from the object or the method from the typedefinition, but the permission must always be checked on the object's method. Additionally the object (or objecttype) must also have the permission.
session | The session of the client. |
object_nodeid | The object of the method call. |
method_nodeid | The method of the method call. |