High Performance OPC UA Server SDK  1.7.1.383
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...
 
int ua_monitoreditem_node_read_eurange (ua_node_t node, double *low, double *high, uint32_t *access_level)
 
int ua_monitoreditem_node_is_numeric (ua_node_t node, bool *is_numeric)
 
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, uintptr_t userdata)
 
static int ua_monitoreditem_get_user_data (struct ua_monitoreditem *item, int index, uintptr_t *userdata)
 
static int ua_monitoreditem_set_eurange (struct ua_monitoreditem *item, double low, double high)
 
static enum ua_deadbandtype ua_monitoreditem_get_deadband_type (struct ua_monitoreditem *item)
 
static enum ua_datachangetrigger ua_monitoreditem_get_datachange_trigger (struct ua_monitoreditem *item)
 
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
 
bool triggered
 
uint16_t num_triggering_links
 
uintptr_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
 
uint32_t * triggering_links
 
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

◆ ua_monitoreditem_type

Type of an item, either UA_MONITOREDITEM_TYPE_DATA or UA_MONITOREDITEM_TYPE_EVENT.

Member Function Documentation

◆ ua_monitoreditem_get_attributeid()

static uint32_t ua_monitoreditem_get_attributeid ( struct ua_monitoreditem item)
inline

Get the attributeid for an item.

◆ ua_monitoreditem_get_datachange_trigger()

static enum ua_datachangetrigger ua_monitoreditem_get_datachange_trigger ( struct ua_monitoreditem item)
inline

Get the datachange trigger of the data monitored item item.

◆ ua_monitoreditem_get_deadband_type()

static enum ua_deadbandtype ua_monitoreditem_get_deadband_type ( struct ua_monitoreditem item)
inline

Get the deadband type of the data monitored item item.

◆ ua_monitoreditem_get_id()

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.

◆ ua_monitoreditem_get_monitoring_mode()

static enum ua_monitoringmode ua_monitoreditem_get_monitoring_mode ( struct ua_monitoreditem item)
inline

Get the monitoring mode for an item.

◆ ua_monitoreditem_get_nodeid()

static const struct ua_nodeid * ua_monitoreditem_get_nodeid ( struct ua_monitoreditem item)

Get the nodeid an item is subscribed to.

◆ ua_monitoreditem_get_num_ranges()

static uint32_t ua_monitoreditem_get_num_ranges ( struct ua_monitoreditem item)
inline

Get the number of indexranges for an item.

◆ ua_monitoreditem_get_range()

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.

◆ ua_monitoreditem_get_sampling_interval()

static uint32_t ua_monitoreditem_get_sampling_interval ( struct ua_monitoreditem item)
inline

Get the sampling interval for an item.

◆ ua_monitoreditem_get_session()

struct uasession_session * ua_monitoreditem_get_session ( struct ua_monitoreditem item)

Get the session belonging to a monitoreditem.

Parameters
item
Returns

◆ ua_monitoreditem_get_timeout_hint()

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.

◆ ua_monitoreditem_get_ts_to_return()

static enum ua_timestampstoreturn ua_monitoreditem_get_ts_to_return ( struct ua_monitoreditem item)
inline

Get the timestamps to return for an item.

◆ ua_monitoreditem_get_type()

static enum ua_monitoreditem_type ua_monitoreditem_get_type ( struct ua_monitoreditem item)
inline

Get the type of an item.

◆ ua_monitoreditem_get_user_data()

static int ua_monitoreditem_get_user_data ( struct ua_monitoreditem item,
int  index,
uintptr_t *  userdata 
)
inline

Get user data set with ua_monitoreditem_set_user_data from an item.

See also
ua_monitoreditem_set_user_data
Parameters
itemMonitoredItem.
indexSelect the slot, either 0 or 1.
userdataReturns stored user data.
Returns
UA_EBADOUTOFRANGE if the index is wrong, zero on success.

◆ ua_monitoreditem_has_indexrange()

static bool ua_monitoreditem_has_indexrange ( struct ua_monitoreditem item)
inline

Returns true if the item has an indexrange set.

◆ ua_monitoreditem_new_value()

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.

◆ ua_monitoreditem_node_is_numeric()

int ua_monitoreditem_node_is_numeric ( ua_node_t  node,
bool *  is_numeric 
)

Check if the datatype of a node's value is numeric.

Helper function to use when deadband filter is requested to check if the datatype of the node's value is a subtype of Number (ns=0;i=26). If this is not the case the monitored item must be rejected.

Returns
Zero on success or errorcode on failure, e.g. the node has the wrong nodeclass.

◆ ua_monitoreditem_node_read_eurange()

int ua_monitoreditem_node_read_eurange ( ua_node_t  node,
double *  low,
double *  high,
uint32_t *  access_level 
)

Read the EURange of a node from the local address space.

Helper function to use when percent deadband filter is requested to read the EURange low and high. These can be set at the monitored item with ua_monitoreditem_set_eurange.

Optionally allows to also read the access_level of the EURange property.

Returns
Zero on success or errorcode on failure, e.g. an error during reading or the EURange property does not exist.

◆ ua_monitoreditem_set_eurange()

static int ua_monitoreditem_set_eurange ( struct ua_monitoreditem item,
double  low,
double  high 
)
inline

Set the EURange for the item's value. This must be called when the deadband type is UA_DEADBANDTYPE_PERCENT and the item is created or the EURange changes.

◆ ua_monitoreditem_set_operation_result()

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.

◆ ua_monitoreditem_set_sampling_interval()

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
itemMonitoredItem.
sampling_intervalNew sampling interval in milliseconds.

◆ ua_monitoreditem_set_user_data()

static int ua_monitoreditem_set_user_data ( struct ua_monitoreditem item,
int  index,
uintptr_t  userdata 
)
inline

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

See also
ua_monitoreditem_get_user_data
Parameters
itemMonitoredItem.
indexSelect the slot, either 0 or 1.
userdataUser data to set.
Returns
UA_EBADOUTOFRANGE if the index is wrong, zero on success.

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