1// Copyright (C) 2015 basysKom GmbH, opensource@basyskom.com
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QOPCUATYPE
5#define QOPCUATYPE
6
7#include <QtOpcUa/qopcuaglobal.h>
8#include <QtOpcUa/qopcuanodeids.h>
9
10#include <QtCore/qmetatype.h>
11#include <QtCore/qpair.h>
12#include <QtCore/qvariant.h>
13
14QT_BEGIN_NAMESPACE
15
16namespace QOpcUa {
17Q_OPCUA_EXPORT Q_NAMESPACE
18Q_CLASSINFO("RegisterEnumClassesUnscoped", "false")
19
20// see OPC UA 1.05 Part 3, 5.2.3 & 8.29
21enum class NodeClass {
22 Undefined = 0,
23 Object = 1,
24 Variable = 2,
25 Method = 4,
26 ObjectType = 8,
27 VariableType = 16,
28 ReferenceType = 32,
29 DataType = 64,
30 View = 128,
31};
32Q_ENUM_NS(NodeClass)
33Q_DECLARE_FLAGS(NodeClasses, NodeClass)
34
35enum class NodeAttribute {
36 None = 0,
37 NodeId = (1 << 0),
38 NodeClass = (1 << 1),
39 BrowseName = (1 << 2),
40 DisplayName = (1 << 3),
41 Description = (1 << 4),
42 WriteMask = (1 << 5),
43 UserWriteMask = (1 << 6), // Base attributes, see OPC UA 1.05 part 3, 5.2.1
44 IsAbstract = (1 << 7),
45 Symmetric = (1 << 8),
46 InverseName = (1 << 9), // Reference attributes, see OPC UA 1.05 part 3, 5.3.1
47 ContainsNoLoops = (1 << 10),
48 EventNotifier = (1 << 11), // View attributes, see OPC UA 1.05 part 3, 5.4
49 // Objects also add the EventNotifier attribute, see OPC UA 1.05 part 3, 5.5.1
50 // ObjectType also add the IsAbstract attribute, see OPC UA 1.05 part 3, 5.5.2
51 Value = (1 << 12),
52 DataType = (1 << 13),
53 ValueRank = (1 << 14),
54 ArrayDimensions = (1 << 15),
55 AccessLevel = (1 << 16),
56 UserAccessLevel = (1 << 17),
57 MinimumSamplingInterval = (1 << 18),
58 Historizing = (1 << 19), // Value attributes, see OPC UA 1.05 part 3, 5.6.2
59 // VariableType also adds the Value, DataType, ValueRank, ArrayDimensions
60 // and isAbstract attributes, see OPC UA 1.05 part 3, 5.6.5
61 Executable = (1 << 20),
62 UserExecutable = (1 << 21), // Method attributes, see OPC UA 1.05 part 3, 5.7
63 // Data type attributes
64 DataTypeDefinition = (1 << 22),
65};
66Q_ENUM_NS(NodeAttribute)
67Q_DECLARE_FLAGS(NodeAttributes, NodeAttribute)
68
69// Defined in OPC UA 1.05 part 3, 8.60.
70enum class WriteMaskBit : quint32 {
71 None = 0,
72 AccessLevel = (1 << 0),
73 ArrayDimensions = (1 << 1),
74 BrowseName = (1 << 2),
75 ContainsNoLoops = (1 << 3),
76 DataType = (1 << 4),
77 Description = (1 << 5),
78 DisplayName = (1 << 6),
79 EventNotifier = (1 << 7),
80 Executable = (1 << 8),
81 Historizing = (1 << 9),
82 InverseName = (1 << 10),
83 IsAbstract = (1 << 11),
84 MinimumSamplingInterval = (1 << 12),
85 NodeClass = (1 << 13),
86 NodeId = (1 << 14),
87 Symmetric = (1 << 15),
88 UserAccessLevel = (1 << 16),
89 UserExecutable = (1 << 17),
90 UserWriteMask = (1 << 18),
91 ValueRank = (1 << 19),
92 WriteMask = (1 << 20),
93 ValueForVariableType = (1 << 21),
94};
95Q_ENUM_NS(WriteMaskBit)
96Q_DECLARE_FLAGS(WriteMask, WriteMaskBit)
97
98// Defined in OPC UA 1.05 part 3, 8.57.
99enum class AccessLevelBit : quint8 {
100 None = 0,
101 CurrentRead = (1 << 0),
102 CurrentWrite = (1 << 1),
103 HistoryRead = (1 << 2),
104 HistoryWrite = (1 << 3),
105 SemanticChange = (1 << 4),
106 StatusWrite = (1 << 5),
107 TimestampWrite = (1 << 6),
108};
109Q_ENUM_NS(AccessLevelBit)
110Q_DECLARE_FLAGS(AccessLevel, AccessLevelBit)
111
112// Defined in OPC UA 1.05 part 3, 8.59.
113enum class EventNotifierBit : quint8 {
114 None = 0,
115 SubscribeToEvents = (1 << 0),
116 HistoryRead = (1 << 2),
117 HistoryWrite = (1 << 3),
118};
119Q_ENUM_NS(EventNotifierBit)
120Q_DECLARE_FLAGS(EventNotifier, EventNotifierBit)
121
122enum class TimestampsToReturn {
123 Source = 0,
124 Server = 1,
125 Both = 2,
126 Neither = 4,
127 Invalid = 5,
128};
129Q_ENUM_NS(TimestampsToReturn)
130
131#if QT_VERSION >= 0x060000
132inline size_t qHash(const QOpcUa::NodeAttribute& attr)
133#else
134inline uint qHash(const QOpcUa::NodeAttribute& attr)
135#endif
136{
137 return ::qHash(key: static_cast<uint>(attr));
138}
139
140// The reference types are nodes in namespace 0, the enum value is their numeric identifier.
141// Identifiers are specified in https://opcfoundation.org/UA/schemas/1.05/NodeIds.csv
142enum class ReferenceTypeId : quint32 {
143 Unspecified = 0,
144 References = 31,
145 NonHierarchicalReferences = 32,
146 HierarchicalReferences = 33,
147 HasChild = 34,
148 Organizes = 35,
149 HasEventSource = 36,
150 HasModellingRule = 37,
151 HasEncoding = 38,
152 HasDescription = 39,
153 HasTypeDefinition = 40,
154 GeneratesEvent = 41,
155 Aggregates = 44,
156 HasSubtype = 45,
157 HasProperty = 46,
158 HasComponent = 47,
159 HasNotifier = 48,
160 HasOrderedComponent = 49,
161 FromState = 51,
162 ToState = 52,
163 HasCause = 53,
164 HasEffect = 54,
165 HasHistoricalConfiguration = 56,
166 HasSubStateMachine = 117,
167 HasArgumentDescription = 129,
168 HasOptionalInputArgumentDescription = 131,
169 AlwaysGeneratesEvent = 3065,
170 HasTrueSubState = 9004,
171 HasFalseSubState = 9005,
172 HasCondition = 9006,
173 HasPubSubConnection = 14476,
174 DataSetToWriter = 14936,
175 HasGuard = 15112,
176 HasDataSetWriter = 15296,
177 HasDataSetReader = 15297,
178 HasAlarmSuppressionGroup = 16361,
179 AlarmGroupMember = 16362,
180 HasEffectDisable = 17276,
181 HasDictionaryEntry = 17597,
182 HasInterface = 17603,
183 HasAddIn = 17604,
184 HasEffectEnable = 17983,
185 HasEffectSuppressed = 17984,
186 HasEffectUnsuppressed = 17985,
187 HasWriterGroup = 18804,
188 HasReaderGroup = 18805,
189 AliasFor = 23469,
190 IsDeprecated = 23562,
191 HasStructuredComponent = 24136,
192 AssociatedWith = 24137,
193 UsesPriorityMappingTable = 25237,
194 HasLowerLayerInterface = 25238,
195 IsExecutableOn = 25253,
196 Controls = 25254,
197 Utilizes = 25255,
198 Requires = 25256,
199 IsPhysicallyConnectedTo = 25257,
200 RepresentsSameEntityAs = 25258,
201 RepresentsSameHardwareAs = 25259,
202 RepresentsSameFunctionalityAs = 25260,
203 IsHostedBy = 25261,
204 HasPhysicalComponent = 25262,
205 HasContainedComponent = 25263,
206 HasAttachedComponent = 25264,
207 IsExecutingOn = 25265,
208 HasPushedSecurityGroup = 25345,
209};
210Q_ENUM_NS(ReferenceTypeId)
211
212enum Types
213{
214 Boolean = 0,
215 Int32 = 1,
216 UInt32 = 2,
217 Double = 3,
218 Float = 4,
219 String = 5,
220 LocalizedText = 6,
221 DateTime = 7,
222 UInt16 = 8,
223 Int16 = 9,
224 UInt64 = 10,
225 Int64 = 11,
226 Byte = 12,
227 SByte = 13,
228 ByteString = 14,
229 XmlElement = 15,
230 NodeId = 16,
231 Guid = 17,
232 QualifiedName = 18,
233 StatusCode = 19,
234 ExtensionObject = 20,
235 Range = 21,
236 EUInformation = 22,
237 ComplexNumber = 23,
238 DoubleComplexNumber = 24,
239 AxisInformation = 25,
240 XV = 26,
241 ExpandedNodeId = 27,
242 Argument = 28,
243 StructureDefinition = 29,
244 StructureField = 30,
245 EnumDefinition = 31,
246 EnumField = 32,
247 DiagnosticInfo = 33,
248 SimpleAttributeOperand = 34,
249 AttributeOperand = 35,
250 LiteralOperand = 36,
251 ElementOperand = 37,
252 RelativePathElement = 38,
253 ContentFilterElement = 39,
254 EventFilter = 40,
255 Undefined = 0xFFFFFFFF,
256};
257Q_ENUM_NS(Types)
258
259// OpcUa Specification 1.05 Part 4, Chapter 7.39 "Status Code"
260// OpcUa Specification 1.05 Part 6, Annex A.2 "Status Codes
261enum UaStatusCode : quint32
262{
263 Good = 0x00000000,
264 Uncertain = 0x40000000,
265 Bad = 0x80000000,
266 BadUnexpectedError = 0x80010000,
267 BadInternalError = 0x80020000,
268 BadOutOfMemory = 0x80030000,
269 BadResourceUnavailable = 0x80040000,
270 BadCommunicationError = 0x80050000,
271 BadEncodingError = 0x80060000,
272 BadDecodingError = 0x80070000,
273 BadEncodingLimitsExceeded = 0x80080000,
274 BadRequestTooLarge = 0x80B80000,
275 BadResponseTooLarge = 0x80B90000,
276 BadUnknownResponse = 0x80090000,
277 BadTimeout = 0x800A0000,
278 BadServiceUnsupported = 0x800B0000,
279 BadShutdown = 0x800C0000,
280 BadServerNotConnected = 0x800D0000,
281 BadServerHalted = 0x800E0000,
282 BadNothingToDo = 0x800F0000,
283 BadTooManyOperations = 0x80100000,
284 BadTooManyMonitoredItems = 0x80DB0000,
285 BadDataTypeIdUnknown = 0x80110000,
286 BadCertificateInvalid = 0x80120000,
287 BadSecurityChecksFailed = 0x80130000,
288 BadCertificatePolicyCheckFailed = 0x81140000,
289 BadCertificateTimeInvalid = 0x80140000,
290 BadCertificateIssuerTimeInvalid = 0x80150000,
291 BadCertificateHostNameInvalid = 0x80160000,
292 BadCertificateUriInvalid = 0x80170000,
293 BadCertificateUseNotAllowed = 0x80180000,
294 BadCertificateIssuerUseNotAllowed = 0x80190000,
295 BadCertificateUntrusted = 0x801A0000,
296 BadCertificateRevocationUnknown = 0x801B0000,
297 BadCertificateIssuerRevocationUnknown = 0x801C0000,
298 BadCertificateRevoked = 0x801D0000,
299 BadCertificateIssuerRevoked = 0x801E0000,
300 BadCertificateChainIncomplete = 0x810D0000,
301 BadUserAccessDenied = 0x801F0000,
302 BadIdentityTokenInvalid = 0x80200000,
303 BadIdentityTokenRejected = 0x80210000,
304 BadSecureChannelIdInvalid = 0x80220000,
305 BadInvalidTimestamp = 0x80230000,
306 BadNonceInvalid = 0x80240000,
307 BadSessionIdInvalid = 0x80250000,
308 BadSessionClosed = 0x80260000,
309 BadSessionNotActivated = 0x80270000,
310 BadSubscriptionIdInvalid = 0x80280000,
311 BadRequestHeaderInvalid = 0x802A0000,
312 BadTimestampsToReturnInvalid = 0x802B0000,
313 BadRequestCancelledByClient = 0x802C0000,
314 BadTooManyArguments = 0x80E50000,
315 BadLicenseExpired = 0x810E0000,
316 BadLicenseLimitsExceeded = 0x810F0000,
317 BadLicenseNotAvailable = 0x81100000,
318 GoodSubscriptionTransferred = 0x002D0000,
319 GoodCompletesAsynchronously = 0x002E0000,
320 GoodOverload = 0x002F0000,
321 GoodClamped = 0x00300000,
322 BadNoCommunication = 0x80310000,
323 BadWaitingForInitialData = 0x80320000,
324 BadNodeIdInvalid = 0x80330000,
325 BadNodeIdUnknown = 0x80340000,
326 BadAttributeIdInvalid = 0x80350000,
327 BadIndexRangeInvalid = 0x80360000,
328 BadIndexRangeNoData = 0x80370000,
329 BadDataEncodingInvalid = 0x80380000,
330 BadDataEncodingUnsupported = 0x80390000,
331 BadNotReadable = 0x803A0000,
332 BadNotWritable = 0x803B0000,
333 BadOutOfRange = 0x803C0000,
334 BadNotSupported = 0x803D0000,
335 BadNotFound = 0x803E0000,
336 BadObjectDeleted = 0x803F0000,
337 BadNotImplemented = 0x80400000,
338 BadMonitoringModeInvalid = 0x80410000,
339 BadMonitoredItemIdInvalid = 0x80420000,
340 BadMonitoredItemFilterInvalid = 0x80430000,
341 BadMonitoredItemFilterUnsupported = 0x80440000,
342 BadFilterNotAllowed = 0x80450000,
343 BadStructureMissing = 0x80460000,
344 BadEventFilterInvalid = 0x80470000,
345 BadContentFilterInvalid = 0x80480000,
346 BadFilterOperatorInvalid = 0x80C10000,
347 BadFilterOperatorUnsupported = 0x80C20000,
348 BadFilterOperandCountMismatch = 0x80C30000,
349 BadFilterOperandInvalid = 0x80490000,
350 BadFilterElementInvalid = 0x80C40000,
351 BadFilterLiteralInvalid = 0x80C50000,
352 BadContinuationPointInvalid = 0x804A0000,
353 BadNoContinuationPoints = 0x804B0000,
354 BadReferenceTypeIdInvalid = 0x804C0000,
355 BadBrowseDirectionInvalid = 0x804D0000,
356 BadNodeNotInView = 0x804E0000,
357 BadNumericOverflow = 0x81120000,
358 BadServerUriInvalid = 0x804F0000,
359 BadServerNameMissing = 0x80500000,
360 BadDiscoveryUrlMissing = 0x80510000,
361 BadSempahoreFileMissing = 0x80520000,
362 BadRequestTypeInvalid = 0x80530000,
363 BadSecurityModeRejected = 0x80540000,
364 BadSecurityPolicyRejected = 0x80550000,
365 BadTooManySessions = 0x80560000,
366 BadUserSignatureInvalid = 0x80570000,
367 BadApplicationSignatureInvalid = 0x80580000,
368 BadNoValidCertificates = 0x80590000,
369 BadIdentityChangeNotSupported = 0x80C60000,
370 BadRequestCancelledByRequest = 0x805A0000,
371 BadParentNodeIdInvalid = 0x805B0000,
372 BadReferenceNotAllowed = 0x805C0000,
373 BadNodeIdRejected = 0x805D0000,
374 BadNodeIdExists = 0x805E0000,
375 BadNodeClassInvalid = 0x805F0000,
376 BadBrowseNameInvalid = 0x80600000,
377 BadBrowseNameDuplicated = 0x80610000,
378 BadNodeAttributesInvalid = 0x80620000,
379 BadTypeDefinitionInvalid = 0x80630000,
380 BadSourceNodeIdInvalid = 0x80640000,
381 BadTargetNodeIdInvalid = 0x80650000,
382 BadDuplicateReferenceNotAllowed = 0x80660000,
383 BadInvalidSelfReference = 0x80670000,
384 BadReferenceLocalOnly = 0x80680000,
385 BadNoDeleteRights = 0x80690000,
386 UncertainReferenceNotDeleted = 0x40BC0000,
387 BadServerIndexInvalid = 0x806A0000,
388 BadViewIdUnknown = 0x806B0000,
389 BadViewTimestampInvalid = 0x80C90000,
390 BadViewParameterMismatch = 0x80CA0000,
391 BadViewVersionInvalid = 0x80CB0000,
392 UncertainNotAllNodesAvailable = 0x40C00000,
393 GoodResultsMayBeIncomplete = 0x00BA0000,
394 BadNotTypeDefinition = 0x80C80000,
395 UncertainReferenceOutOfServer = 0x406C0000,
396 BadTooManyMatches = 0x806D0000,
397 BadQueryTooComplex = 0x806E0000,
398 BadNoMatch = 0x806F0000,
399 BadMaxAgeInvalid = 0x80700000,
400 BadSecurityModeInsufficient = 0x80E60000,
401 BadHistoryOperationInvalid = 0x80710000,
402 BadHistoryOperationUnsupported = 0x80720000,
403 BadInvalidTimestampArgument = 0x80BD0000,
404 BadWriteNotSupported = 0x80730000,
405 BadTypeMismatch = 0x80740000,
406 BadMethodInvalid = 0x80750000,
407 BadArgumentsMissing = 0x80760000,
408 BadNotExecutable = 0x81110000,
409 BadTooManySubscriptions = 0x80770000,
410 BadTooManyPublishRequests = 0x80780000,
411 BadNoSubscription = 0x80790000,
412 BadSequenceNumberUnknown = 0x807A0000,
413 GoodRetransmissionQueueNotSupported = 0x00DF0000,
414 BadMessageNotAvailable = 0x807B0000,
415 BadInsufficientClientProfile = 0x807C0000,
416 BadStateNotActive = 0x80BF0000,
417 BadAlreadyExists = 0x81150000,
418 BadTcpServerTooBusy = 0x807D0000,
419 BadTcpMessageTypeInvalid = 0x807E0000,
420 BadTcpSecureChannelUnknown = 0x807F0000,
421 BadTcpMessageTooLarge = 0x80800000,
422 BadTcpNotEnoughResources = 0x80810000,
423 BadTcpInternalError = 0x80820000,
424 BadTcpEndpointUrlInvalid = 0x80830000,
425 BadRequestInterrupted = 0x80840000,
426 BadRequestTimeout = 0x80850000,
427 BadSecureChannelClosed = 0x80860000,
428 BadSecureChannelTokenUnknown = 0x80870000,
429 BadSequenceNumberInvalid = 0x80880000,
430 BadProtocolVersionUnsupported = 0x80BE0000,
431 BadConfigurationError = 0x80890000,
432 BadNotConnected = 0x808A0000,
433 BadDeviceFailure = 0x808B0000,
434 BadSensorFailure = 0x808C0000,
435 BadOutOfService = 0x808D0000,
436 BadDeadbandFilterInvalid = 0x808E0000,
437 UncertainNoCommunicationLastUsableValue = 0x408F0000,
438 UncertainLastUsableValue = 0x40900000,
439 UncertainSubstituteValue = 0x40910000,
440 UncertainInitialValue = 0x40920000,
441 UncertainSensorNotAccurate = 0x40930000,
442 UncertainEngineeringUnitsExceeded = 0x40940000,
443 UncertainSubNormal = 0x40950000,
444 GoodLocalOverride = 0x00960000,
445 BadRefreshInProgress = 0x80970000,
446 BadConditionAlreadyDisabled = 0x80980000,
447 BadConditionAlreadyEnabled = 0x80CC0000,
448 BadConditionDisabled = 0x80990000,
449 BadEventIdUnknown = 0x809A0000,
450 BadEventNotAcknowledgeable = 0x80BB0000,
451 BadDialogNotActive = 0x80CD0000,
452 BadDialogResponseInvalid = 0x80CE0000,
453 BadConditionBranchAlreadyAcked = 0x80CF0000,
454 BadConditionBranchAlreadyConfirmed = 0x80D00000,
455 BadConditionAlreadyShelved = 0x80D10000,
456 BadConditionNotShelved = 0x80D20000,
457 BadShelvingTimeOutOfRange = 0x80D30000,
458 BadNoData = 0x809B0000,
459 BadBoundNotFound = 0x80D70000,
460 BadBoundNotSupported = 0x80D80000,
461 BadDataLost = 0x809D0000,
462 BadDataUnavailable = 0x809E0000,
463 BadEntryExists = 0x809F0000,
464 BadNoEntryExists = 0x80A00000,
465 BadTimestampNotSupported = 0x80A10000,
466 GoodEntryInserted = 0x00A20000,
467 GoodEntryReplaced = 0x00A30000,
468 UncertainDataSubNormal = 0x40A40000,
469 GoodNoData = 0x00A50000,
470 GoodMoreData = 0x00A60000,
471 BadAggregateListMismatch = 0x80D40000,
472 BadAggregateNotSupported = 0x80D50000,
473 BadAggregateInvalidInputs = 0x80D60000,
474 BadAggregateConfigurationRejected = 0x80DA0000,
475 GoodDataIgnored = 0x00D90000,
476 BadRequestNotAllowed = 0x80E40000,
477 BadRequestNotComplete = 0x81130000,
478 BadTicketRequired = 0x811F0000,
479 BadTicketInvalid = 0x81200000,
480 GoodEdited = 0x00DC0000,
481 GoodPostActionFailed = 0x00DD0000,
482 UncertainDominantValueChanged = 0x40DE0000,
483 GoodDependentValueChanged = 0x00E00000,
484 BadDominantValueChanged = 0x80E10000,
485 UncertainDependentValueChanged = 0x40E20000,
486 BadDependentValueChanged = 0x80E30000,
487 GoodEdited_DependentValueChanged = 0x01160000,
488 GoodEdited_DominantValueChanged = 0x01170000,
489 GoodEdited_DominantValueChanged_DependentValueChanged = 0x01180000,
490 BadEdited_OutOfRange = 0x81190000,
491 BadInitialValue_OutOfRange = 0x811A0000,
492 BadOutOfRange_DominantValueChanged = 0x811B0000,
493 BadEdited_OutOfRange_DominantValueChanged = 0x811C0000,
494 BadOutOfRange_DominantValueChanged_DependentValueChanged = 0x811D0000,
495 BadEdited_OutOfRange_DominantValueChanged_DependentValueChanged = 0x811E0000,
496 GoodCommunicationEvent = 0x00A70000,
497 GoodShutdownEvent = 0x00A80000,
498 GoodCallAgain = 0x00A90000,
499 GoodNonCriticalTimeout = 0x00AA0000,
500 BadInvalidArgument = 0x80AB0000,
501 BadConnectionRejected = 0x80AC0000,
502 BadDisconnect = 0x80AD0000,
503 BadConnectionClosed = 0x80AE0000,
504 BadInvalidState = 0x80AF0000,
505 BadEndOfStream = 0x80B00000,
506 BadNoDataAvailable = 0x80B10000,
507 BadWaitingForResponse = 0x80B20000,
508 BadOperationAbandoned = 0x80B30000,
509 BadExpectedStreamToBlock = 0x80B40000,
510 BadWouldBlock = 0x80B50000,
511 BadSyntaxError = 0x80B60000,
512 BadMaxConnectionsReached = 0x80B70000,
513 UncertainTransducerInManual = 0x42080000,
514 UncertainSimulatedValue = 0x42090000,
515 UncertainSensorCalibration = 0x420A0000,
516 UncertainConfigurationError = 0x420F0000,
517 GoodCascadeInitializationAcknowledged = 0x04010000,
518 GoodCascadeInitializationRequest = 0x04020000,
519 GoodCascadeNotInvited = 0x04030000,
520 GoodCascadeNotSelected = 0x04040000,
521 GoodFaultStateActive = 0x04070000,
522 GoodInitiateFaultState = 0x04080000,
523 GoodCascade = 0x04090000,
524 BadDataSetIdInvalid = 0x80E70000,
525};
526Q_ENUM_NS(UaStatusCode)
527
528enum class ErrorCategory {
529 NoError,
530 NodeError,
531 AttributeError,
532 PermissionError,
533 ArgumentError,
534 TypeError,
535 ConnectionError,
536 UnspecifiedError,
537};
538Q_ENUM_NS(ErrorCategory)
539
540Q_OPCUA_EXPORT bool isSuccessStatus(QOpcUa::UaStatusCode statusCode);
541Q_OPCUA_EXPORT QOpcUa::ErrorCategory errorCategory(QOpcUa::UaStatusCode statusCode);
542Q_OPCUA_EXPORT QString statusToString(QOpcUa::UaStatusCode statusCode);
543Q_OPCUA_EXPORT bool isSecurePolicy(const QString &securityPolicy);
544
545// NodeId helpers
546Q_OPCUA_EXPORT QString nodeIdFromString(quint16 ns, const QString &identifier);
547Q_OPCUA_EXPORT QString nodeIdFromByteString(quint16 ns, const QByteArray &identifier);
548Q_OPCUA_EXPORT QString nodeIdFromGuid(quint16 ns, const QUuid &identifier);
549Q_OPCUA_EXPORT QString nodeIdFromInteger(quint16 ns, quint32 identifier);
550Q_OPCUA_EXPORT QString nodeIdFromReferenceType(QOpcUa::ReferenceTypeId referenceType);
551Q_OPCUA_EXPORT bool nodeIdStringSplit(const QString &nodeIdString, quint16 *nsIndex,
552 QString *identifier, char *identifierType);
553Q_OPCUA_EXPORT bool nodeIdEquals(const QString &first, const QString &second);
554Q_OPCUA_EXPORT QString namespace0Id(QOpcUa::NodeIds::Namespace0 id);
555Q_OPCUA_EXPORT QOpcUa::NodeIds::Namespace0 namespace0IdFromNodeId(const QString &nodeId);
556Q_OPCUA_EXPORT QString namespace0IdName(QOpcUa::NodeIds::Namespace0 id);
557
558typedef QPair<QVariant, QOpcUa::Types> TypedVariant;
559
560enum class AxisScale : quint32 {
561 Linear = 0,
562 Log = 1,
563 Ln = 2,
564};
565
566enum class IsAbstract {
567 NotAbstract = 0,
568 Abstract = 1,
569};
570Q_ENUM_NS(IsAbstract)
571
572Q_OPCUA_EXPORT QOpcUa::Types metaTypeToQOpcUaType(QMetaType::Type type);
573Q_OPCUA_EXPORT QOpcUa::Types opcUaDataTypeToQOpcUaType(const QString &type);
574}
575
576Q_DECLARE_TYPEINFO(QOpcUa::Types, Q_PRIMITIVE_TYPE);
577Q_DECLARE_TYPEINFO(QOpcUa::UaStatusCode, Q_PRIMITIVE_TYPE);
578Q_DECLARE_TYPEINFO(QOpcUa::ErrorCategory, Q_PRIMITIVE_TYPE);
579
580Q_DECLARE_TYPEINFO(QOpcUa::NodeClass, Q_PRIMITIVE_TYPE);
581Q_DECLARE_TYPEINFO(QOpcUa::NodeAttribute, Q_PRIMITIVE_TYPE);
582Q_DECLARE_OPERATORS_FOR_FLAGS(QOpcUa::NodeAttributes)
583Q_DECLARE_OPERATORS_FOR_FLAGS(QOpcUa::WriteMask)
584Q_DECLARE_OPERATORS_FOR_FLAGS(QOpcUa::AccessLevel)
585Q_DECLARE_OPERATORS_FOR_FLAGS(QOpcUa::EventNotifier)
586Q_DECLARE_OPERATORS_FOR_FLAGS(QOpcUa::NodeClasses)
587Q_DECLARE_TYPEINFO(QOpcUa::ReferenceTypeId, Q_PRIMITIVE_TYPE);
588
589QT_END_NAMESPACE
590
591Q_DECLARE_METATYPE(QOpcUa::Types)
592Q_DECLARE_METATYPE(QOpcUa::TypedVariant)
593Q_DECLARE_METATYPE(QOpcUa::UaStatusCode)
594Q_DECLARE_METATYPE(QOpcUa::ErrorCategory)
595Q_DECLARE_METATYPE(QOpcUa::NodeClass)
596Q_DECLARE_METATYPE(QOpcUa::NodeAttribute)
597Q_DECLARE_METATYPE(QOpcUa::NodeAttributes)
598Q_DECLARE_METATYPE(QOpcUa::WriteMaskBit)
599Q_DECLARE_METATYPE(QOpcUa::WriteMask)
600Q_DECLARE_METATYPE(QOpcUa::AccessLevelBit)
601Q_DECLARE_METATYPE(QOpcUa::AccessLevel)
602Q_DECLARE_METATYPE(QOpcUa::EventNotifierBit)
603Q_DECLARE_METATYPE(QOpcUa::EventNotifier)
604Q_DECLARE_METATYPE(QOpcUa::ReferenceTypeId)
605Q_DECLARE_METATYPE(QOpcUa::NodeClasses)
606
607#endif // QOPCUATYPE
608

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of qtopcua/src/opcua/client/qopcuatype.h