High Performance OPC UA Server SDK  1.2.0.193
ua_monitoreditem Struct Reference

Structure to represent a monitoreditem in the server. More...

#include <monitoreditem.h>

Public Types

enum  ua_monitoreditem_type
 

Public Member Functions

int ua_monitoreditem_new_value (struct ua_monitoreditem *item, struct ua_datavalue *value)
 Add a new value to a monitoreditem. More...
 
struct uasession_sessionua_monitoreditem_get_session (struct ua_monitoreditem *item)
 Get the session belonging to a monitoreditem. More...
 
static enum ua_timestampstoreturn ua_monitoreditem_get_ts_to_return (struct ua_monitoreditem *item)
 
static uint32_t ua_monitoreditem_get_attributeid (struct ua_monitoreditem *item)
 
static bool ua_monitoreditem_has_indexrange (struct ua_monitoreditem *item)
 
static uint32_t ua_monitoreditem_get_num_ranges (struct ua_monitoreditem *item)
 
static struct ua_indexrangeua_monitoreditem_get_range (struct ua_monitoreditem *item)
 
static const struct ua_nodeidua_monitoreditem_get_nodeid (struct ua_monitoreditem *item)
 
static uint32_t ua_monitoreditem_get_sampling_interval (struct ua_monitoreditem *item)
 
static void ua_monitoreditem_set_sampling_interval (struct ua_monitoreditem *item, uint32_t sampling_interval)
 
static void ua_monitoreditem_set_operation_result (struct ua_monitoreditem *item, ua_statuscode operation_result)
 
static int ua_monitoreditem_set_user_data (struct ua_monitoreditem *item, int index, uint32_t value)
 
static uint32_t ua_monitoreditem_get_user_data (struct ua_monitoreditem *item, int index)
 
static enum ua_monitoreditem_type ua_monitoreditem_get_type (struct ua_monitoreditem *item)
 
static uint32_t ua_monitoreditem_get_id (struct ua_monitoreditem *item)
 
static uint32_t ua_monitoreditem_get_timeout_hint (struct ua_monitoreditem *item)
 
static enum ua_monitoringmode ua_monitoreditem_get_monitoring_mode (struct ua_monitoreditem *item)
 

Data Fields

enum ua_monitoreditem_type type
 
bool discard_oldest
 
uint32_t user_data [2]
 
uint32_t sampling_interval
 
uint32_t client_handle
 
uint32_t timeout_hint
 
uint32_t id
 
ua_statuscode operation_result
 
enum ua_monitoringmode monitoring_mode
 
struct util_ringqueue value_queue
 
struct ua_nodeid nodeid
 
struct ua_subscriptionsubscription
 
union ua_monitoreditem_fields fields
 

Detailed Description

Structure to represent a monitoreditem in the server.

The fields of this structure should not be accessed directly, but its getter/setter functions should be used. If a getter/setter does not exist for a field it most certainly should not be accessed at all.

Member Enumeration Documentation

Type of an item, either UA_MONITOREDITEM_TYPE_DATA or UA_MONITOREDITEM_TYPE_EVENT.

Member Function Documentation

static uint32_t ua_monitoreditem_get_attributeid ( struct ua_monitoreditem item)
inline

Get the attributeid for an item.

static uint32_t ua_monitoreditem_get_id ( struct ua_monitoreditem item)
inline

Get the server-assigned Id of an item. It is unique among all items from all subscriptions on the server. The Id is implemented as versioned handle, so it will take rather long until an Id is reused.

static enum ua_monitoringmode ua_monitoreditem_get_monitoring_mode ( struct ua_monitoreditem item)
inline

Get the monitoring mode for an item.

static const struct ua_nodeid * ua_monitoreditem_get_nodeid ( struct ua_monitoreditem item)

Get the nodeid an item is subscribed to.

static uint32_t ua_monitoreditem_get_num_ranges ( struct ua_monitoreditem item)
inline

Get the number of indexranges for an item.

static struct ua_indexrange * ua_monitoreditem_get_range ( struct ua_monitoreditem item)

Get the array of indexranges for an item, the length of the array can be retrieved with ua_monitoreditem_get_num_ranges.

static uint32_t ua_monitoreditem_get_sampling_interval ( struct ua_monitoreditem item)
inline

Get the sampling interval for an item.

struct uasession_session * ua_monitoreditem_get_session ( struct ua_monitoreditem item)

Get the session belonging to a monitoreditem.

Parameters
item
Returns
static uint32_t ua_monitoreditem_get_timeout_hint ( struct ua_monitoreditem item)
inline

Get the timeout hint for an item. This hint should be respected by the provider during the create, modifiy and delete operation. 0 means no timeout.

static enum ua_timestampstoreturn ua_monitoreditem_get_ts_to_return ( struct ua_monitoreditem item)
inline

Get the timestamps to return for an item.

static enum ua_monitoreditem_type ua_monitoreditem_get_type ( struct ua_monitoreditem item)
inline

Get the type of an item.

static uint32_t ua_monitoreditem_get_user_data ( struct ua_monitoreditem item,
int  index 
)
inline

Get user data set with ua_monitoreditem_set_user_data from an item.

Parameters
indexSelect the slot, either 0 or 1.
Returns
The user data or UINT32_MAX, if the index is wrong.
static bool ua_monitoreditem_has_indexrange ( struct ua_monitoreditem item)
inline

Returns true if the item has an indexrange set.

int ua_monitoreditem_new_value ( struct ua_monitoreditem item,
struct ua_datavalue value 
)

Add a new value to a monitoreditem.

Add a newly sampled value to the monitoreditem, the functions checks if the value changed and enqueues it if necessary.

In case of success the function takes ownership of the value and finally clears it and calls ipc_free on the pointer. In case of failure the caller is responsible for cleaning the value up.

Parameters
itemMonitoreditem to add a new value to.
valueThe new value.
Returns
Zero on success or errorcode on failure.
static void ua_monitoreditem_set_operation_result ( struct ua_monitoreditem item,
ua_statuscode  operation_result 
)
inline

Set the result of the create, modify or delete operation for an item.

static void ua_monitoreditem_set_sampling_interval ( struct ua_monitoreditem item,
uint32_t  sampling_interval 
)
inline

Set the sampling interval of an item. This might be done during creation or modification of the item, this will be returned to the client as revised sampling interval.

Parameters
sampling_intervalNew sampling interval in milliseconds.
static int ua_monitoreditem_set_user_data ( struct ua_monitoreditem item,
int  index,
uint32_t  value 
)
inline

Set user date for an item, this can be arbitrary data used by the provider. There are currently two slots for values of type uint32_t available.

Parameters
indexSelect the slot, either 0 or 1.
Returns
UA_EBADOUTOFRANGE if the the index is wrong, zero on success.

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