open62541 1.3.12
Open source implementation of OPC UA
Loading...
Searching...
No Matches
historydatabase.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_HISTORYDATABASE_H_
9#define UA_PLUGIN_HISTORYDATABASE_H_
10
11#include <open62541/util.h>
12
14
16
18 void *context;
19
21
22 /* This function will be called when a nodes value is set.
23 * Use this to insert data into your database(s) if polling is not suitable
24 * and you need to get all data changes.
25 * Set it to NULL if you do not need it.
26 *
27 * server is the server this node lives in.
28 * hdbContext is the context of the UA_HistoryDatabase.
29 * sessionId and sessionContext identify the session which set this value.
30 * nodeId is the node id for which data was set.
31 * historizing is the nodes boolean flag for historizing
32 * value is the new value. */
33 void
34 (*setValue)(UA_Server *server,
35 void *hdbContext,
36 const UA_NodeId *sessionId,
37 void *sessionContext,
38 const UA_NodeId *nodeId,
39 UA_Boolean historizing,
40 const UA_DataValue *value);
41
42 /* This function will be called when an event is triggered.
43 * Use it to insert data into your event database.
44 * No default implementation is provided by UA_HistoryDatabase_default.
45 *
46 * server is the server this node lives in.
47 * hdbContext is the context of the UA_HistoryDatabase.
48 * originId is the node id of the event's origin.
49 * emitterId is the node id of the event emitter.
50 * historicalEventFilter is the value of the HistoricalEventFilter property of
51 * the emitter (OPC UA Part 11, 5.3.2), it is NULL if
52 * the property does not exist or is not set.
53 * fieldList is the event field list returned after application of
54 * historicalEventFilter to the event node. */
55 void
56 (*setEvent)(UA_Server *server,
57 void *hdbContext,
58 const UA_NodeId *originId,
59 const UA_NodeId *emitterId,
60 const UA_EventFilter *historicalEventFilter,
61 UA_EventFieldList *fieldList);
62
63 /* This function is called if a history read is requested with
64 * isRawReadModified set to false. Setting it to NULL will result in a
65 * response with statuscode UA_STATUSCODE_BADHISTORYOPERATIONUNSUPPORTED.
66 *
67 * server is the server this node lives in.
68 * hdbContext is the context of the UA_HistoryDatabase.
69 * sessionId and sessionContext identify the session which set this value.
70 * requestHeader, historyReadDetails, timestampsToReturn, releaseContinuationPoints
71 * nodesToReadSize and nodesToRead is the requested data from the client. It
72 * is from the request object.
73 * response the response to fill for the client. If the request is ok, there
74 * is no need to use it. Use this to set status codes other than
75 * "Good" or other data. You find an already allocated
76 * UA_HistoryReadResult array with an UA_HistoryData object in the
77 * extension object in the size of nodesToReadSize. If you are not
78 * willing to return data, you have to delete the results array,
79 * set it to NULL and set the resultsSize to 0. Do not access
80 * historyData after that.
81 * historyData is a proper typed pointer array pointing in the
82 * UA_HistoryReadResult extension object. use this to provide
83 * result data to the client. Index in the array is the same as
84 * in nodesToRead and the UA_HistoryReadResult array. */
85 void
86 (*readRaw)(UA_Server *server,
87 void *hdbContext,
88 const UA_NodeId *sessionId,
89 void *sessionContext,
90 const UA_RequestHeader *requestHeader,
91 const UA_ReadRawModifiedDetails *historyReadDetails,
92 UA_TimestampsToReturn timestampsToReturn,
93 UA_Boolean releaseContinuationPoints,
94 size_t nodesToReadSize,
95 const UA_HistoryReadValueId *nodesToRead,
96 UA_HistoryReadResponse *response,
97 UA_HistoryData * const * const historyData);
98
99 /* No default implementation is provided by UA_HistoryDatabase_default
100 * for the following function */
101 void
102 (*readModified)(UA_Server *server,
103 void *hdbContext,
104 const UA_NodeId *sessionId,
105 void *sessionContext,
106 const UA_RequestHeader *requestHeader,
107 const UA_ReadRawModifiedDetails *historyReadDetails,
108 UA_TimestampsToReturn timestampsToReturn,
109 UA_Boolean releaseContinuationPoints,
110 size_t nodesToReadSize,
111 const UA_HistoryReadValueId *nodesToRead,
112 UA_HistoryReadResponse *response,
113 UA_HistoryModifiedData * const * const historyData);
114
115 /* No default implementation is provided by UA_HistoryDatabase_default
116 * for the following function */
117 void
118 (*readEvent)(UA_Server *server,
119 void *hdbContext,
120 const UA_NodeId *sessionId,
121 void *sessionContext,
122 const UA_RequestHeader *requestHeader,
123 const UA_ReadEventDetails *historyReadDetails,
124 UA_TimestampsToReturn timestampsToReturn,
125 UA_Boolean releaseContinuationPoints,
126 size_t nodesToReadSize,
127 const UA_HistoryReadValueId *nodesToRead,
128 UA_HistoryReadResponse *response,
129 UA_HistoryEvent * const * const historyData);
130
131 /* No default implementation is provided by UA_HistoryDatabase_default
132 * for the following function */
133 void
134 (*readProcessed)(UA_Server *server,
135 void *hdbContext,
136 const UA_NodeId *sessionId,
137 void *sessionContext,
138 const UA_RequestHeader *requestHeader,
139 const UA_ReadProcessedDetails *historyReadDetails,
140 UA_TimestampsToReturn timestampsToReturn,
141 UA_Boolean releaseContinuationPoints,
142 size_t nodesToReadSize,
143 const UA_HistoryReadValueId *nodesToRead,
144 UA_HistoryReadResponse *response,
145 UA_HistoryData * const * const historyData);
146
147 /* No default implementation is provided by UA_HistoryDatabase_default
148 * for the following function */
149 void
150 (*readAtTime)(UA_Server *server,
151 void *hdbContext,
152 const UA_NodeId *sessionId,
153 void *sessionContext,
154 const UA_RequestHeader *requestHeader,
155 const UA_ReadAtTimeDetails *historyReadDetails,
156 UA_TimestampsToReturn timestampsToReturn,
157 UA_Boolean releaseContinuationPoints,
158 size_t nodesToReadSize,
159 const UA_HistoryReadValueId *nodesToRead,
160 UA_HistoryReadResponse *response,
161 UA_HistoryData * const * const historyData);
162
163 void
164 (*updateData)(UA_Server *server,
165 void *hdbContext,
166 const UA_NodeId *sessionId,
167 void *sessionContext,
168 const UA_RequestHeader *requestHeader,
169 const UA_UpdateDataDetails *details,
170 UA_HistoryUpdateResult *result);
171
172 void
173 (*deleteRawModified)(UA_Server *server,
174 void *hdbContext,
175 const UA_NodeId *sessionId,
176 void *sessionContext,
177 const UA_RequestHeader *requestHeader,
178 const UA_DeleteRawModifiedDetails *details,
179 UA_HistoryUpdateResult *result);
180
181 /* Add more function pointer here.
182 * For example for read_event, read_annotation, update_details */
183};
184
186
187#endif /* UA_PLUGIN_HISTORYDATABASE_H_ */
#define _UA_BEGIN_DECLS
#undef UA_DEBUG_DUMP_PKGS
Definition config.h:89
#define _UA_END_DECLS
Definition config.h:96
void(* updateData)(UA_Server *server, void *hdbContext, const UA_NodeId *sessionId, void *sessionContext, const UA_RequestHeader *requestHeader, const UA_UpdateDataDetails *details, UA_HistoryUpdateResult *result)
void(* clear)(UA_HistoryDatabase *hdb)
void(* setEvent)(UA_Server *server, void *hdbContext, const UA_NodeId *originId, const UA_NodeId *emitterId, const UA_EventFilter *historicalEventFilter, UA_EventFieldList *fieldList)
void(* readAtTime)(UA_Server *server, void *hdbContext, const UA_NodeId *sessionId, void *sessionContext, const UA_RequestHeader *requestHeader, const UA_ReadAtTimeDetails *historyReadDetails, UA_TimestampsToReturn timestampsToReturn, UA_Boolean releaseContinuationPoints, size_t nodesToReadSize, const UA_HistoryReadValueId *nodesToRead, UA_HistoryReadResponse *response, UA_HistoryData *const *const historyData)
void(* setValue)(UA_Server *server, void *hdbContext, const UA_NodeId *sessionId, void *sessionContext, const UA_NodeId *nodeId, UA_Boolean historizing, const UA_DataValue *value)
void(* readEvent)(UA_Server *server, void *hdbContext, const UA_NodeId *sessionId, void *sessionContext, const UA_RequestHeader *requestHeader, const UA_ReadEventDetails *historyReadDetails, UA_TimestampsToReturn timestampsToReturn, UA_Boolean releaseContinuationPoints, size_t nodesToReadSize, const UA_HistoryReadValueId *nodesToRead, UA_HistoryReadResponse *response, UA_HistoryEvent *const *const historyData)
void(* readProcessed)(UA_Server *server, void *hdbContext, const UA_NodeId *sessionId, void *sessionContext, const UA_RequestHeader *requestHeader, const UA_ReadProcessedDetails *historyReadDetails, UA_TimestampsToReturn timestampsToReturn, UA_Boolean releaseContinuationPoints, size_t nodesToReadSize, const UA_HistoryReadValueId *nodesToRead, UA_HistoryReadResponse *response, UA_HistoryData *const *const historyData)
void(* deleteRawModified)(UA_Server *server, void *hdbContext, const UA_NodeId *sessionId, void *sessionContext, const UA_RequestHeader *requestHeader, const UA_DeleteRawModifiedDetails *details, UA_HistoryUpdateResult *result)
void(* readRaw)(UA_Server *server, void *hdbContext, const UA_NodeId *sessionId, void *sessionContext, const UA_RequestHeader *requestHeader, const UA_ReadRawModifiedDetails *historyReadDetails, UA_TimestampsToReturn timestampsToReturn, UA_Boolean releaseContinuationPoints, size_t nodesToReadSize, const UA_HistoryReadValueId *nodesToRead, UA_HistoryReadResponse *response, UA_HistoryData *const *const historyData)
void(* readModified)(UA_Server *server, void *hdbContext, const UA_NodeId *sessionId, void *sessionContext, const UA_RequestHeader *requestHeader, const UA_ReadRawModifiedDetails *historyReadDetails, UA_TimestampsToReturn timestampsToReturn, UA_Boolean releaseContinuationPoints, size_t nodesToReadSize, const UA_HistoryReadValueId *nodesToRead, UA_HistoryReadResponse *response, UA_HistoryModifiedData *const *const historyData)
_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
UA_TimestampsToReturn