module OMG { module DDSOPCUA { module OPCUA2DDS { #ifndef OMG_IDL_FIX_WIDTH_INTEGERS_SUPPORT /* * IDL 4.2 fixed-width integers */ typedef octet int8; typedef short int16; typedef long int32; typedef long long int64; typedef octet uint8; typedef unsigned short uint16; typedef unsigned long uint32; typedef unsigned long long uint64; #endif // [OPCUA-6], Section 5.1.2 enum BuiltinTypeKind { @value(1) BOOLEAN_TYPE, @value(2) SBYTE_TYPE, @value(3) BYTE_TYPE, @value(4) INT16_TYPE, @value(5) UINT16_TYPE, @value(6) INT32_TYPE, @value(7) UINT32_TYPE, @value(8) INT64_TYPE, @value(9) UINT64_TYPE, @value(10) FLOAT_TYPE, @value(11) DOUBLE_TYPE, @value(12) STRING_TYPE, @value(13) DATETIME_TYPE, @value(14) GUID_TYPE, @value(15) BYTESTRING_TYPE, @value(16) XMLELEMENT_TYPE, @value(17) NODEID_TYPE, @value(18) EXPANDEDNODEID_TYPE, @value(19) STATUSCODE_TYPE, @value(20) QUALIFIEDNAME_TYPE, @value(21) LOCALIZEDTEXT_TYPE, @value(22) EXTENSIONOBJECT_TYPE, @value(23) DATAVALUE_TYPE, @value(24) VARIANT_TYPE, @value(25) DIAGNOSTICINFO_TYPE }; // [OPCUA-3], Section 8.8 typedef boolean Boolean; // [OPCUA-3], Section 8.17 // typedef @signed octet SByte; typedef int8 SByte; // [OPCUA-3], Section 8.9 typedef uint8 Byte; // [OPCUA-3], Section 8.25 typedef int16 Int16; // [OPCUA-3], Section 8.35 typedef uint16 UInt16; // [OPCUA-3], Section 8.26 typedef int32 Int32; // [OPCUA-3], Section 8.36 typedef uint32 UInt32; // [OPCUA-3], Section 8.27 typedef int64 Int64; // [OPCUA-3], Section 8.37 typedef uint64 UInt64; // [OPCUA-3], Section 8.15 and [OPCUA-6], Section 5.1.2 typedef float Float; // [OPCUA-6], Section 5.2.2.3 typedef double Double; // [OPCUA-6], Section 5.2.2.4 typedef string String; // [OPCUA-6], Section 5.2.2.5 typedef int64 DateTime; // [OPCUA-6], Section 5.2.2.6 struct Guid { uint32 data1; uint16 data2; uint16 data3; octet data4[8]; }; // [OPCUA-6], Section 5.2.2.7 typedef sequence ByteString; // [OPCUA-6], Section 5.2.2.8 typedef string XmlElement; // [OPCUA-3], Section 8.2.3 enum NodeIdentifierKind { NUMERIC_NODE_ID, STRING_NODE_ID, GUID_NODE_ID, OPAQUE_NODE_ID }; // [OPCUA-3], Section 8.2.3 and [OPCUA-6], Section 5.2.2.9 @nested union NodeIdentifierType switch (NodeIdentifierKind) { case NUMERIC_NODE_ID: uint32 numeric_id; case STRING_NODE_ID: string string_id; // Restricted to 4096 bytes case GUID_NODE_ID: Guid guid_id; case OPAQUE_NODE_ID: ByteString opaque_id; // Restricted to 4096 bytes }; // [OPCUA-3], Section 8.2.1 struct NodeId { uint16 namespace_index; NodeIdentifierType identifier_type; }; // [OPCUA-4], Section 7.11 and [OPCUA-6], Section 5.2.2.10 struct ExpandedNodeId : NodeId { string namespace_uri; uint32 server_index; }; // [OPCUA-6], Section 5.2.2.11 typedef uint32 StatusCode; // [OPCUA-3], Section 8.3 struct QualifiedName { uint16 namespace_index; string name; // Restricted to 512 characters }; // [OPCUA-6], Section 5.2.2.14 @mutable struct LocalizedText { @id(1) @optional string locale; @id(2) @optional string text; }; // [OPCUA-6], Section 5.2.2.15 enum BodyEncoding { @value(0) NONE_BODY_ENCODING, @value(1) BYTESTRING_BODY_ENCODING, @value(2) XMLELEMENT_BODY_ENCODING }; // [OPCUA-6], Section 5.2.2.15 @nested union ExtensionObjectBody switch (BodyEncoding) { case NONE_BODY_ENCODING: octet none_encoding; case BYTESTRING_BODY_ENCODING: sequence bytestring_encoding; case XMLELEMENT_BODY_ENCODING: XmlElement xmlelement_encoding; }; // [OPCUA-6], Section 5.2.2.15 struct ExtensionObject { NodeId type_id; ExtensionObjectBody body; }; // [OPCUA-6], Section 5.1.2 and Section 5.1.6 @nested union VariantValue switch (BuiltinTypeKind) { case BOOLEAN_TYPE: boolean bool_value; case SBYTE_TYPE: int8 sbyte_value; case BYTE_TYPE: uint8 byte_value; case INT16_TYPE: int16 int16_value; case UINT16_TYPE: uint16 uint16_value; case INT32_TYPE: int32 int32_value; case UINT32_TYPE: uint32 uint32_value; case INT64_TYPE: int64 int64_value; case UINT64_TYPE: uint64 uint64_value; case FLOAT_TYPE: float float_value; case DOUBLE_TYPE: double double_value; case STRING_TYPE: string string_value; case DATETIME_TYPE: DateTime datetime_value; case GUID_TYPE: Guid guid_value; case BYTESTRING_TYPE: ByteString bytestring_value; case XMLELEMENT_TYPE: XmlElement xmlelement_value; case NODEID_TYPE: NodeId nodeid_value; case EXPANDEDNODEID_TYPE: ExpandedNodeId expandednodeid_value; case STATUSCODE_TYPE: StatusCode statuscode_value; case QUALIFIEDNAME_TYPE: QualifiedName qualifiedname_value; case LOCALIZEDTEXT_TYPE: LocalizedText localizedtext_value; case EXTENSIONOBJECT_TYPE: ExtensionObject extensionobject_value; }; // [OPCUA-6], Section 5.2.2.16 struct Variant { sequence array_dimensions; sequence value; }; // [OPCUA-6], Section 5.2.2.17 @mutable struct DataValue { @id(1) @optional Variant value; @id(2) @optional StatusCode status; @id(4) @optional DateTime source_timestamp; @id(8) @optional DateTime server_timestamp; @id(16) @optional uint16 source_pico_sec; @id(32) @optional uint16 server_pico_sec; }; // [OPCUA-4], Section 7.8 and [OPCUA-6], Section 5.2.2.12 @mutable struct DiagnosticInfo { @id(1) @optional int32 symbolic_id; @id(2) @optional int32 namespace_uri; @id(4) @optional int32 localized_text; @id(8) @optional int32 locale; @id(16) @optional string additional_info; @id(32) @optional StatusCode inner_status_code; #ifdef OMG_IDL_RECURSIVE_TYPE_DEFINITION_SUPPORT @id(64) @optional DiagnosticInfo inner_diagnostic_info; #endif }; };};}; // OMG::DDSOPCUA::OPCUA2DDS