open62541 1.3.12
Open source implementation of OPC UA
Loading...
Searching...
No Matches
history_data_gathering.h
Go to the documentation of this file.
1/** This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
4 *
5 * Copyright 2018 (c) basysKom GmbH <opensource@basyskom.com> (Author: Peter Rustler)
6 */
7
8#ifndef UA_PLUGIN_HISTORY_DATA_GATHERING_H_
9#define UA_PLUGIN_HISTORY_DATA_GATHERING_H_
10
12
14
15typedef enum {
16 UA_HISTORIZINGUPDATESTRATEGY_USER = 0x00, /* The user of the api stores the values to the database himself.
17 The api will not store any value to the database. */
18 UA_HISTORIZINGUPDATESTRATEGY_VALUESET = 0x01, /* Values will be stored when a node's value is set.
19 The values will be stored when a node is updated via write service.*/
20 UA_HISTORIZINGUPDATESTRATEGY_POLL = 0x02 /* The value of the node will be read periodically.
21 This is mainly relevant for datasource nodes which do
22 not use the write service.
23 Values will not be stored if the value is
24 equal to the old value. */
26
27typedef struct {
28 UA_HistoryDataBackend historizingBackend; /* The database backend used for this node. */
29 size_t maxHistoryDataResponseSize; /* The maximum number of values returned by the server in one response.
30 If the result has more values, continuation points will be used. */
31 UA_HistorizingUpdateStrategy historizingUpdateStrategy; /* Defines how the values in the database will be updated.
32 See UA_HistorizingUpdateStrategy for details. */
33 size_t pollingInterval; /* The polling interval for UA_HISTORIZINGUPDATESTRATEGY_POLL. */
34 void *userContext; /* A pointer to store your own settings. */
36
39 void *context;
40
41 void
43
44 /* This function registers a node for the gathering of historical data.
45 *
46 * server is the server the node lives in.
47 * hdgContext is the context of the UA_HistoryDataGathering.
48 * nodeId is the node id of the node to register.
49 * setting contains the gatering settings for the node to register. */
51 (*registerNodeId)(UA_Server *server,
52 void *hdgContext,
53 const UA_NodeId *nodeId,
54 const UA_HistorizingNodeIdSettings setting);
55
56 /* This function stops polling a node for value changes.
57 *
58 * server is the server the node lives in.
59 * hdgContext is the context of the UA_HistoryDataGathering.
60 * nodeId is id of the node for which polling shall be stopped.
61 * setting contains the gatering settings for the node. */
63 (*stopPoll)(UA_Server *server,
64 void *hdgContext,
65 const UA_NodeId *nodeId);
66
67 /* This function starts polling a node for value changes.
68 *
69 * server is the server the node lives in.
70 * hdgContext is the context of the UA_HistoryDataGathering.
71 * nodeId is the id of the node for which polling shall be started. */
73 (*startPoll)(UA_Server *server,
74 void *hdgContext,
75 const UA_NodeId *nodeId);
76
77 /* This function modifies the gathering settings for a node.
78 *
79 * server is the server the node lives in.
80 * hdgContext is the context of the UA_HistoryDataGathering.
81 * nodeId is the node id of the node for which gathering shall be modified.
82 * setting contains the new gatering settings for the node. */
85 void *hdgContext,
86 const UA_NodeId *nodeId,
87 const UA_HistorizingNodeIdSettings setting);
88
89 /* Returns the gathering settings for a node.
90 *
91 * server is the server the node lives in.
92 * hdgContext is the context of the UA_HistoryDataGathering.
93 * nodeId is the node id of the node for which the gathering settings shall
94 * be retrieved. */
96 (*getHistorizingSetting)(UA_Server *server,
97 void *hdgContext,
98 const UA_NodeId *nodeId);
99
100 /* Sets a DataValue for a node in the historical data storage.
101 *
102 * server is the server the node lives in.
103 * hdgContext is the context of the UA_HistoryDataGathering.
104 * sessionId and sessionContext identify the session which wants to set this value.
105 * nodeId is the node id of the node for which a value shall be set.
106 * historizing is the historizing flag of the node identified by nodeId.
107 * value is the value to set in the history data storage. */
108 void
109 (*setValue)(UA_Server *server,
110 void *hdgContext,
111 const UA_NodeId *sessionId,
112 void *sessionContext,
113 const UA_NodeId *nodeId,
114 UA_Boolean historizing,
115 const UA_DataValue *value);
116};
117
119
120#endif /* UA_PLUGIN_HISTORY_DATA_GATHERING_H_ */
#define _UA_BEGIN_DECLS
#undef UA_DEBUG_DUMP_PKGS
Definition config.h:89
#define _UA_END_DECLS
Definition config.h:96
UA_HistorizingUpdateStrategy
This Source Code Form is subject to the terms of the Mozilla Public License, v.
@ UA_HISTORIZINGUPDATESTRATEGY_USER
@ UA_HISTORIZINGUPDATESTRATEGY_VALUESET
@ UA_HISTORIZINGUPDATESTRATEGY_POLL
UA_HistorizingUpdateStrategy historizingUpdateStrategy
UA_HistoryDataBackend historizingBackend
void(* deleteMembers)(UA_HistoryDataGathering *gathering)
void(* setValue)(UA_Server *server, void *hdgContext, const UA_NodeId *sessionId, void *sessionContext, const UA_NodeId *nodeId, UA_Boolean historizing, const UA_DataValue *value)
UA_Boolean(* updateNodeIdSetting)(UA_Server *server, void *hdgContext, const UA_NodeId *nodeId, const UA_HistorizingNodeIdSettings setting)
UA_StatusCode(* startPoll)(UA_Server *server, void *hdgContext, const UA_NodeId *nodeId)
UA_StatusCode(* stopPoll)(UA_Server *server, void *hdgContext, const UA_NodeId *nodeId)
UA_StatusCode(* registerNodeId)(UA_Server *server, void *hdgContext, const UA_NodeId *nodeId, const UA_HistorizingNodeIdSettings setting)
_UA_BEGIN_DECLS typedef bool UA_Boolean
This Source Code Form is subject to the terms of the Mozilla Public License, v.
Definition types.h:26
uint32_t UA_StatusCode
Definition types.h:77