diff --git a/.travis.yml b/.travis.yml
index 8fdf4175c..4f631f00c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,17 +6,16 @@ python:
# command to install dependencies
install:
- pip install python-dateutil
+ - pip install pytz
+ - pip install lxml
- if [[ $TRAVIS_PYTHON_VERSION == '3.4' ]]; then pip install cryptography ; fi
- - if [[ $TRAVIS_PYTHON_VERSION == '3.4' ]]; then pip install pytz ; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install futures ; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install cryptography ; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install trollius ; fi
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install enum34 ; fi
- - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install pytz ; fi
#- if [[ $TRAVIS_PYTHON_VERSION == 'pypy3' ]]; then pip install cryptography ; fi
- if [[ $TRAVIS_PYTHON_VERSION == 'pypy' ]]; then pip install futures ; fi
- if [[ $TRAVIS_PYTHON_VERSION == 'pypy' ]]; then pip install trollius ; fi
- if [[ $TRAVIS_PYTHON_VERSION == 'pypy' ]]; then pip install enum34 ; fi
- - if [[ $TRAVIS_PYTHON_VERSION == 'pypy' ]]; then pip install pytz ; fi
# command to run tests
script: ./run-tests.sh
diff --git a/README.md b/README.md
index 9a6354b92..57f4b7aad 100644
--- a/README.md
+++ b/README.md
@@ -13,11 +13,7 @@ OPC UA binary protocol implementation is quasi complete and has been tested agai
Most low level code is autogenerated from xml specification, thus adding missing functionality to client or server is often trivial.
-Using Python > 3.4 the dependencies are cryptography, dateutil and pytz. If using python 2.7 or pypy < 3 you also need to install enum34, trollius(asyncio), and futures(concurrent.futures), with pip for example.
-```
-pip install enum34 trollius futures
-```
-
+Using Python > 3.4 the dependencies are cryptography, dateutil, lxml and pytz. If using python 2.7 or pypy < 3 you also need to install enum34, trollius(asyncio), and futures(concurrent.futures), with pip for example.
coveryage.py reports a test coverage of over 90% of code, most of non-tested code is autogenerated code that is not used yet.
diff --git a/examples/test_perf.py b/examples/test_perf.py
new file mode 100644
index 000000000..90ae1bb72
--- /dev/null
+++ b/examples/test_perf.py
@@ -0,0 +1,36 @@
+import sys
+sys.path.insert(0, "..")
+import time
+
+
+from opcua import ua, Server
+
+import cProfile
+import re
+
+
+def mymain():
+
+ # setup our server
+ server = Server()
+ server.set_endpoint("opc.tcp://0.0.0.0:4840/freeopcua/server/")
+
+ # setup our own namespace, not really necessary but should as spec
+ uri = "http://examples.freeopcua.github.io"
+ idx = server.register_namespace(uri)
+
+ # get Objects node, this is where we should put our nodes
+ objects = server.get_objects_node()
+
+ # populating our address space
+ myobj = objects.add_object(idx, "MyObject")
+ myvar = myobj.add_variable(idx, "MyVariable", 6.7)
+ myvar.set_writable() # Set MyVariable to be writable by clients
+
+ # starting!
+ server.start()
+ server.stop()
+
+
+if __name__ == "__main__":
+ cProfile.run('mymain()')
diff --git a/opcua/client/client.py b/opcua/client/client.py
index 16f395218..8623f89a3 100644
--- a/opcua/client/client.py
+++ b/opcua/client/client.py
@@ -16,6 +16,7 @@
from opcua.common import utils
from opcua.crypto import security_policies
from opcua.common.shortcuts import Shortcuts
+from opcua.common.structures_generator import StructGenerator
use_crypto = True
try:
from opcua.crypto import uacrypto
@@ -550,4 +551,45 @@ def register_namespace(self, uri):
ns_node.set_value(uries)
return len(uries) - 1
-
+ def import_and_register_structures(self, nodes=None):
+ """
+ Download xml from given variable node defining custom structures.
+ If no no node is given, attemps to import variables from all nodes under
+ "0:OPC Binary"
+ the code is generated and imported on the fly. If you know the structures
+ are not going to be modified it might be interresting to copy the generated files
+ and include them in you code
+ """
+ if nodes is None:
+ nodes = []
+ for desc in self.nodes.opc_binary.get_children_descriptions():
+ if desc.BrowseName != ua.QualifiedName("Opc.Ua"):
+ nodes.append(self.get_node(desc.NodeId))
+ self.logger.info("Importing structures from nodes: %s", nodes)
+
+ structs_dict = {}
+ for node in nodes:
+ xml = node.get_value()
+ xml = xml.decode("utf-8")
+ name = "structures_" + node.get_browse_name().Name
+ gen = StructGenerator()
+ gen.make_model_from_string(xml)
+ gen.save_and_import(name + ".py", append_to=structs_dict)
+
+ # register classes
+ for desc in self.nodes.base_structure_type.get_children_descriptions():
+ # FIXME: maybe we should look recursively at children
+ # FIXME: we should get enoding and description but this is too
+ # expensive. we take a shorcut and assume that browsename of struct
+ # is the same as the name of the data type structure
+ if desc.BrowseName.Name in structs_dict:
+ struct_node = self.get_node(desc.NodeId)
+ refs = struct_node.get_references(ua.ObjectIds.HasEncoding, ua.BrowseDirection.Forward)
+ for ref in refs:
+ if "Binary" in ref.BrowseName.Name:
+ ua.register_extension_object(desc.BrowseName.Name, ref.NodeId, structs_dict[desc.BrowseName.Name])
+
+
+
+
+
diff --git a/opcua/common/node.py b/opcua/common/node.py
index a972bd7f7..fd7d03edf 100644
--- a/opcua/common/node.py
+++ b/opcua/common/node.py
@@ -308,6 +308,12 @@ def get_methods(self):
def get_children_descriptions(self, refs=ua.ObjectIds.HierarchicalReferences, nodeclassmask=ua.NodeClass.Unspecified, includesubtypes=True):
return self.get_references(refs, ua.BrowseDirection.Forward, nodeclassmask, includesubtypes)
+ def get_encoding_refs(self):
+ return self.get_referenced_nodes(ua.ObjectIds.HasEncoding, ua.BrowseDirection.Forward)
+
+ def get_description_refs(self):
+ return self.get_referenced_nodes(ua.ObjectIds.HasDescription, ua.BrowseDirection.Forward)
+
def get_references(self, refs=ua.ObjectIds.References, direction=ua.BrowseDirection.Both, nodeclassmask=ua.NodeClass.Unspecified, includesubtypes=True):
"""
returns references of the node based on specific filter defined with:
diff --git a/opcua/common/shortcuts.py b/opcua/common/shortcuts.py
index 92b5d8213..8027a6f01 100644
--- a/opcua/common/shortcuts.py
+++ b/opcua/common/shortcuts.py
@@ -24,3 +24,5 @@ def __init__(self, server):
self.variable_types = Node(server, ObjectIds.VariableTypesFolder)
self.object_types = Node(server, ObjectIds.ObjectTypesFolder)
self.namespace_array = Node(server, ObjectIds.Server_NamespaceArray)
+ self.opc_binary = Node(server, ObjectIds.OPCBinarySchema_TypeSystem)
+ self.base_structure_type = Node(server, ObjectIds.Structure)
diff --git a/opcua/common/structures_generator.py b/opcua/common/structures_generator.py
new file mode 100644
index 000000000..f27bf0224
--- /dev/null
+++ b/opcua/common/structures_generator.py
@@ -0,0 +1,221 @@
+"""
+parse simple structures from an xml tree
+We only support a subset of features but should be enough
+for custom structures
+"""
+
+import os
+import importlib
+
+from lxml import objectify
+
+
+from opcua.ua.ua_binary import Primitives
+
+
+def get_default_value(uatype):
+ if uatype == "String":
+ return "None"
+ elif uatype == "Guid":
+ return "uuid.uuid4()"
+ elif uatype in ("ByteString", "CharArray", "Char"):
+ return None
+ elif uatype == "Boolean":
+ return "True"
+ elif uatype == "DateTime":
+ return "datetime.utcnow()"
+ elif uatype in ("Int8", "Int16", "Int32", "Int64", "UInt8", "UInt16", "UInt32", "UInt64", "Double", "Float", "Byte", "SByte"):
+ return 0
+ else:
+ return "ua." + uatype + "()"
+
+
+class Struct(object):
+ def __init__(self, name):
+ self.name = name
+ self.fields = []
+ self.code = ""
+
+ def get_code(self):
+ if not self.fields:
+ return """
+
+class {}(object):
+ pass
+
+""".format(self.name)
+ self._make_constructor()
+ self._make_from_binary()
+ self._make_to_binary()
+ return self.code
+
+ def _make_constructor(self):
+ self.code = """
+
+
+class {0}(object):
+ '''
+ {0} structure autogenerated from xml
+ '''
+ def __init__(self, data=None):
+ if data is not None:
+ self._binary_init(data)
+ return
+""".format(self.name)
+ for field in self.fields:
+ self.code += " self.{} = {}\n".format(field.name, field.value)
+
+ def _make_from_binary(self):
+ self.code += '''
+ @staticmethod
+ def from_binary(data):
+ return {}(data=data)
+
+ def _binary_init(self, data):
+'''.format(self.name)
+ for field in self.fields:
+ if hasattr(Primitives, field.uatype):
+ if field.array:
+ self.code += ' self.{} = ua.ua_binary.Primitives.{}.unpack_array(data)\n'.format(field.name, field.uatype)
+ else:
+ self.code += ' self.{} = ua.ua_binary.Primitives.{}.unpack(data)\n'.format(field.name, field.uatype)
+ else:
+ if field.array:
+ self.code += '''
+ length = ua.ua_binary.Primitives.Int32.unpack(data)
+ if length == -1:
+ self.{0} = None
+ else:
+ self.{0} = [ua.{1}.from_binary(data) for _ in range(length)]
+'''.format(field.name, field.uatype)
+ else:
+ self.code += " self.{} = ua.{}.from_binary(data)\n".format(field.name, field.uatype)
+
+ def _make_to_binary(self):
+ self.code += '''
+ def to_binary(self):
+ packet = []
+'''
+ for field in self.fields:
+ if hasattr(Primitives, field.uatype):
+ if field.array:
+ self.code += ' packet.append(ua.ua_binary.Primitives.{}.pack_array(self.{}))\n'.format(field.uatype, field.name)
+ else:
+ self.code += ' packet.append(ua.ua_binary.Primitives.{}.pack(self.{}))\n'.format(field.uatype, field.name)
+ else:
+ if field.array:
+ self.code += '''
+ if self.{0} is None:
+ packet.append(ua.ua_binary.Primitives.Int32.pack(-1))
+ else:
+ packet.append(ua.ua_binary.Primitives.Int32.pack(len(self.{0})))
+ for element in self.{0}:
+ packet.append(element.to_binary())
+'''.format(field.name)
+ else:
+ self.code += " packet.append(self.{}.to_binary())\n".format(field.name)
+ self.code += ' return b"".join(packet)'
+
+
+class Field(object):
+ def __init__(self, name):
+ self.name = name
+ self.uatype = None
+ self.value = None
+ self.array = False
+
+
+class StructGenerator(object):
+ def __init__(self):
+ self.model = []
+
+ def make_model_from_string(self, xml):
+ obj = objectify.fromstring(xml)
+ self._make_model(obj)
+
+ def make_model_from_file(self, path):
+ obj = objectify.parse(path)
+ root = obj.getroot()
+ self._make_model(root)
+
+ def _make_model(self, root):
+ for child in root.iter("{*}StructuredType"):
+ struct = Struct(child.get("Name"))
+ array = False
+ for xmlfield in child.iter("{*}Field"):
+ name = xmlfield.get("Name")
+ if name.startswith("NoOf"):
+ array = True
+ continue
+ field = Field(name)
+ field.uatype = xmlfield.get("TypeName")
+ if ":" in field.uatype:
+ field.uatype = field.uatype.split(":")[1]
+ field.value = get_default_value(field.uatype)
+ if array:
+ field.array = True
+ field.value = []
+ array = False
+ struct.fields.append(field)
+ self.model.append(struct)
+
+ def save_to_file(self, path):
+ _file = open(path, "wt")
+ self._make_header(_file)
+ for struct in self.model:
+ _file.write(struct.get_code())
+ _file.close()
+
+ def save_and_import(self, path, append_to=None):
+ """
+ save the new structures to a python file which be used later
+ import the result and return resulting classes in a dict
+ if append_to is a dict, the classes are added to the dict
+ """
+ self.save_to_file(path)
+ name = os.path.basename(path)
+ name = os.path.splitext(name)[0]
+ mymodule = importlib.import_module(name)
+ if append_to is None:
+ result = {}
+ else:
+ result = append_to
+ for struct in self.model:
+ result[struct.name] = getattr(mymodule, struct.name)
+ return result
+
+ def get_structures(self):
+ ld = {}
+ for struct in self.model:
+ exec(struct.get_code(), ld)
+ return ld
+
+ def _make_header(self, _file):
+ _file.write("""
+'''
+THIS FILE IS AUTOGENERATED, DO NOT EDIT!!!
+'''
+
+from datetime import datetime
+import uuid
+
+from opcua import ua
+""")
+
+
+
+
+if __name__ == "__main__":
+ import sys
+ from IPython import embed
+ sys.path.insert(0, ".") # necessary for import in current dir
+
+ #xmlpath = "schemas/Opc.Ua.Types.bsd"
+ xmlpath = "schemas/example.bsd"
+ c = StructGenerator(xmlpath, "structures.py")
+ c.run()
+ import structures as s
+
+
+ #sts = c.get_structures()
+ embed()
diff --git a/opcua/common/ua_utils.py b/opcua/common/ua_utils.py
index 8ff4c7b6a..4ad29f310 100644
--- a/opcua/common/ua_utils.py
+++ b/opcua/common/ua_utils.py
@@ -258,3 +258,14 @@ def get_nodes_of_namespace(server, namespaces=None):
nodes = [server.get_node(nodeid) for nodeid in server.iserver.aspace.keys()
if nodeid.NamespaceIndex != 0 and nodeid.NamespaceIndex in namespace_indexes]
return nodes
+
+
+def get_default_value(uatype):
+ if isinstance(uatype, ua.VariantType):
+ return ua.get_default_values(uatype)
+ elif hasattr(ua.VariantType, uatype):
+ return ua.get_default_value(getattr(ua.VariantType, uatype))
+ else:
+ return getattr(ua, uatype)()
+
+
diff --git a/opcua/common/utils.py b/opcua/common/utils.py
index c87bc22b3..6a1be0fb6 100644
--- a/opcua/common/utils.py
+++ b/opcua/common/utils.py
@@ -1,3 +1,8 @@
+"""
+Helper function and classes that do not rely on opcua library.
+Helper function and classes depending on ua object are in ua_utils.py
+"""
+
import logging
import os
from concurrent.futures import Future
@@ -6,7 +11,6 @@
from socket import error as SocketError
try:
- # we prefer to use bundles asyncio version, otherwise fallback to trollius
import asyncio
except ImportError:
import trollius as asyncio
diff --git a/opcua/ua/ua_binary.py b/opcua/ua/ua_binary.py
index d9f7fddd4..ab4f038f7 100644
--- a/opcua/ua/ua_binary.py
+++ b/opcua/ua/ua_binary.py
@@ -91,6 +91,7 @@ def pack_array(self, array):
length = len(array)
b = [self.pack(val) for val in array]
b.insert(0, Primitives.Int32.pack(length))
+ return b"".join(b)
def unpack_array(self, data):
length = Primitives.Int32.unpack(data)
@@ -263,7 +264,7 @@ def pack_uatype(vtype, value):
# dependency loop: classes in uaprotocol_auto use Variant defined in this file,
# but Variant can contain any object from uaprotocol_auto as ExtensionObject.
# Using local import to avoid import loop
- from opcua.ua.uaprotocol_auto import extensionobject_to_binary
+ from opcua.ua import extensionobject_to_binary
return extensionobject_to_binary(value)
else:
try:
@@ -282,7 +283,7 @@ def unpack_uatype(vtype, data):
# dependency loop: classes in uaprotocol_auto use Variant defined in this file,
# but Variant can contain any object from uaprotocol_auto as ExtensionObject.
# Using local import to avoid import loop
- from opcua.ua.uaprotocol_auto import extensionobject_from_binary
+ from opcua.ua import extensionobject_from_binary
return extensionobject_from_binary(data)
else:
from opcua.ua import uatypes
diff --git a/opcua/ua/uaprotocol_auto.py b/opcua/ua/uaprotocol_auto.py
index ceea6115f..4bdc8875d 100644
--- a/opcua/ua/uaprotocol_auto.py
+++ b/opcua/ua/uaprotocol_auto.py
@@ -3,10 +3,8 @@
'''
from datetime import datetime
-from enum import Enum, IntEnum
+from enum import IntEnum
-from opcua.common.utils import Buffer
-from opcua.ua.uaerrors import UaError
from opcua.ua.uatypes import *
from opcua.ua import ua_binary as uabin
from opcua.ua.object_ids import ObjectIds
@@ -16114,268 +16112,633 @@ def __str__(self):
__repr__ = __str__
-ExtensionClasses = {
- ObjectIds.TrustListDataType_Encoding_DefaultBinary: TrustListDataType,
- ObjectIds.Argument_Encoding_DefaultBinary: Argument,
- ObjectIds.EnumValueType_Encoding_DefaultBinary: EnumValueType,
- ObjectIds.OptionSet_Encoding_DefaultBinary: OptionSet,
- ObjectIds.Union_Encoding_DefaultBinary: Union,
- ObjectIds.TimeZoneDataType_Encoding_DefaultBinary: TimeZoneDataType,
- ObjectIds.ApplicationDescription_Encoding_DefaultBinary: ApplicationDescription,
- ObjectIds.RequestHeader_Encoding_DefaultBinary: RequestHeader,
- ObjectIds.ResponseHeader_Encoding_DefaultBinary: ResponseHeader,
- ObjectIds.ServiceFault_Encoding_DefaultBinary: ServiceFault,
- ObjectIds.FindServersRequest_Encoding_DefaultBinary: FindServersRequest,
- ObjectIds.FindServersResponse_Encoding_DefaultBinary: FindServersResponse,
- ObjectIds.ServerOnNetwork_Encoding_DefaultBinary: ServerOnNetwork,
- ObjectIds.FindServersOnNetworkRequest_Encoding_DefaultBinary: FindServersOnNetworkRequest,
- ObjectIds.FindServersOnNetworkResponse_Encoding_DefaultBinary: FindServersOnNetworkResponse,
- ObjectIds.UserTokenPolicy_Encoding_DefaultBinary: UserTokenPolicy,
- ObjectIds.EndpointDescription_Encoding_DefaultBinary: EndpointDescription,
- ObjectIds.GetEndpointsRequest_Encoding_DefaultBinary: GetEndpointsRequest,
- ObjectIds.GetEndpointsResponse_Encoding_DefaultBinary: GetEndpointsResponse,
- ObjectIds.RegisteredServer_Encoding_DefaultBinary: RegisteredServer,
- ObjectIds.RegisterServerRequest_Encoding_DefaultBinary: RegisterServerRequest,
- ObjectIds.RegisterServerResponse_Encoding_DefaultBinary: RegisterServerResponse,
- ObjectIds.DiscoveryConfiguration_Encoding_DefaultBinary: DiscoveryConfiguration,
- ObjectIds.MdnsDiscoveryConfiguration_Encoding_DefaultBinary: MdnsDiscoveryConfiguration,
- ObjectIds.RegisterServer2Request_Encoding_DefaultBinary: RegisterServer2Request,
- ObjectIds.RegisterServer2Response_Encoding_DefaultBinary: RegisterServer2Response,
- ObjectIds.ChannelSecurityToken_Encoding_DefaultBinary: ChannelSecurityToken,
- ObjectIds.OpenSecureChannelRequest_Encoding_DefaultBinary: OpenSecureChannelRequest,
- ObjectIds.OpenSecureChannelResponse_Encoding_DefaultBinary: OpenSecureChannelResponse,
- ObjectIds.CloseSecureChannelRequest_Encoding_DefaultBinary: CloseSecureChannelRequest,
- ObjectIds.CloseSecureChannelResponse_Encoding_DefaultBinary: CloseSecureChannelResponse,
- ObjectIds.SignedSoftwareCertificate_Encoding_DefaultBinary: SignedSoftwareCertificate,
- ObjectIds.SignatureData_Encoding_DefaultBinary: SignatureData,
- ObjectIds.CreateSessionRequest_Encoding_DefaultBinary: CreateSessionRequest,
- ObjectIds.CreateSessionResponse_Encoding_DefaultBinary: CreateSessionResponse,
- ObjectIds.UserIdentityToken_Encoding_DefaultBinary: UserIdentityToken,
- ObjectIds.AnonymousIdentityToken_Encoding_DefaultBinary: AnonymousIdentityToken,
- ObjectIds.UserNameIdentityToken_Encoding_DefaultBinary: UserNameIdentityToken,
- ObjectIds.X509IdentityToken_Encoding_DefaultBinary: X509IdentityToken,
- ObjectIds.KerberosIdentityToken_Encoding_DefaultBinary: KerberosIdentityToken,
- ObjectIds.IssuedIdentityToken_Encoding_DefaultBinary: IssuedIdentityToken,
- ObjectIds.ActivateSessionRequest_Encoding_DefaultBinary: ActivateSessionRequest,
- ObjectIds.ActivateSessionResponse_Encoding_DefaultBinary: ActivateSessionResponse,
- ObjectIds.CloseSessionRequest_Encoding_DefaultBinary: CloseSessionRequest,
- ObjectIds.CloseSessionResponse_Encoding_DefaultBinary: CloseSessionResponse,
- ObjectIds.CancelRequest_Encoding_DefaultBinary: CancelRequest,
- ObjectIds.CancelResponse_Encoding_DefaultBinary: CancelResponse,
- ObjectIds.NodeAttributes_Encoding_DefaultBinary: NodeAttributes,
- ObjectIds.ObjectAttributes_Encoding_DefaultBinary: ObjectAttributes,
- ObjectIds.VariableAttributes_Encoding_DefaultBinary: VariableAttributes,
- ObjectIds.MethodAttributes_Encoding_DefaultBinary: MethodAttributes,
- ObjectIds.ObjectTypeAttributes_Encoding_DefaultBinary: ObjectTypeAttributes,
- ObjectIds.VariableTypeAttributes_Encoding_DefaultBinary: VariableTypeAttributes,
- ObjectIds.ReferenceTypeAttributes_Encoding_DefaultBinary: ReferenceTypeAttributes,
- ObjectIds.DataTypeAttributes_Encoding_DefaultBinary: DataTypeAttributes,
- ObjectIds.ViewAttributes_Encoding_DefaultBinary: ViewAttributes,
- ObjectIds.AddNodesItem_Encoding_DefaultBinary: AddNodesItem,
- ObjectIds.AddNodesResult_Encoding_DefaultBinary: AddNodesResult,
- ObjectIds.AddNodesRequest_Encoding_DefaultBinary: AddNodesRequest,
- ObjectIds.AddNodesResponse_Encoding_DefaultBinary: AddNodesResponse,
- ObjectIds.AddReferencesItem_Encoding_DefaultBinary: AddReferencesItem,
- ObjectIds.AddReferencesRequest_Encoding_DefaultBinary: AddReferencesRequest,
- ObjectIds.AddReferencesResponse_Encoding_DefaultBinary: AddReferencesResponse,
- ObjectIds.DeleteNodesItem_Encoding_DefaultBinary: DeleteNodesItem,
- ObjectIds.DeleteNodesRequest_Encoding_DefaultBinary: DeleteNodesRequest,
- ObjectIds.DeleteNodesResponse_Encoding_DefaultBinary: DeleteNodesResponse,
- ObjectIds.DeleteReferencesItem_Encoding_DefaultBinary: DeleteReferencesItem,
- ObjectIds.DeleteReferencesRequest_Encoding_DefaultBinary: DeleteReferencesRequest,
- ObjectIds.DeleteReferencesResponse_Encoding_DefaultBinary: DeleteReferencesResponse,
- ObjectIds.ViewDescription_Encoding_DefaultBinary: ViewDescription,
- ObjectIds.BrowseDescription_Encoding_DefaultBinary: BrowseDescription,
- ObjectIds.ReferenceDescription_Encoding_DefaultBinary: ReferenceDescription,
- ObjectIds.BrowseResult_Encoding_DefaultBinary: BrowseResult,
- ObjectIds.BrowseRequest_Encoding_DefaultBinary: BrowseRequest,
- ObjectIds.BrowseResponse_Encoding_DefaultBinary: BrowseResponse,
- ObjectIds.BrowseNextRequest_Encoding_DefaultBinary: BrowseNextRequest,
- ObjectIds.BrowseNextResponse_Encoding_DefaultBinary: BrowseNextResponse,
- ObjectIds.RelativePathElement_Encoding_DefaultBinary: RelativePathElement,
- ObjectIds.RelativePath_Encoding_DefaultBinary: RelativePath,
- ObjectIds.BrowsePath_Encoding_DefaultBinary: BrowsePath,
- ObjectIds.BrowsePathTarget_Encoding_DefaultBinary: BrowsePathTarget,
- ObjectIds.BrowsePathResult_Encoding_DefaultBinary: BrowsePathResult,
- ObjectIds.TranslateBrowsePathsToNodeIdsRequest_Encoding_DefaultBinary: TranslateBrowsePathsToNodeIdsRequest,
- ObjectIds.TranslateBrowsePathsToNodeIdsResponse_Encoding_DefaultBinary: TranslateBrowsePathsToNodeIdsResponse,
- ObjectIds.RegisterNodesRequest_Encoding_DefaultBinary: RegisterNodesRequest,
- ObjectIds.RegisterNodesResponse_Encoding_DefaultBinary: RegisterNodesResponse,
- ObjectIds.UnregisterNodesRequest_Encoding_DefaultBinary: UnregisterNodesRequest,
- ObjectIds.UnregisterNodesResponse_Encoding_DefaultBinary: UnregisterNodesResponse,
- ObjectIds.EndpointConfiguration_Encoding_DefaultBinary: EndpointConfiguration,
- ObjectIds.SupportedProfile_Encoding_DefaultBinary: SupportedProfile,
- ObjectIds.SoftwareCertificate_Encoding_DefaultBinary: SoftwareCertificate,
- ObjectIds.QueryDataDescription_Encoding_DefaultBinary: QueryDataDescription,
- ObjectIds.NodeTypeDescription_Encoding_DefaultBinary: NodeTypeDescription,
- ObjectIds.QueryDataSet_Encoding_DefaultBinary: QueryDataSet,
- ObjectIds.NodeReference_Encoding_DefaultBinary: NodeReference,
- ObjectIds.ContentFilterElement_Encoding_DefaultBinary: ContentFilterElement,
- ObjectIds.ContentFilter_Encoding_DefaultBinary: ContentFilter,
- ObjectIds.ElementOperand_Encoding_DefaultBinary: ElementOperand,
- ObjectIds.LiteralOperand_Encoding_DefaultBinary: LiteralOperand,
- ObjectIds.AttributeOperand_Encoding_DefaultBinary: AttributeOperand,
- ObjectIds.SimpleAttributeOperand_Encoding_DefaultBinary: SimpleAttributeOperand,
- ObjectIds.ContentFilterElementResult_Encoding_DefaultBinary: ContentFilterElementResult,
- ObjectIds.ContentFilterResult_Encoding_DefaultBinary: ContentFilterResult,
- ObjectIds.ParsingResult_Encoding_DefaultBinary: ParsingResult,
- ObjectIds.QueryFirstRequest_Encoding_DefaultBinary: QueryFirstRequest,
- ObjectIds.QueryFirstResponse_Encoding_DefaultBinary: QueryFirstResponse,
- ObjectIds.QueryNextRequest_Encoding_DefaultBinary: QueryNextRequest,
- ObjectIds.QueryNextResponse_Encoding_DefaultBinary: QueryNextResponse,
- ObjectIds.ReadValueId_Encoding_DefaultBinary: ReadValueId,
- ObjectIds.ReadRequest_Encoding_DefaultBinary: ReadRequest,
- ObjectIds.ReadResponse_Encoding_DefaultBinary: ReadResponse,
- ObjectIds.HistoryReadValueId_Encoding_DefaultBinary: HistoryReadValueId,
- ObjectIds.HistoryReadResult_Encoding_DefaultBinary: HistoryReadResult,
- ObjectIds.HistoryReadDetails_Encoding_DefaultBinary: HistoryReadDetails,
- ObjectIds.ReadEventDetails_Encoding_DefaultBinary: ReadEventDetails,
- ObjectIds.ReadRawModifiedDetails_Encoding_DefaultBinary: ReadRawModifiedDetails,
- ObjectIds.ReadProcessedDetails_Encoding_DefaultBinary: ReadProcessedDetails,
- ObjectIds.ReadAtTimeDetails_Encoding_DefaultBinary: ReadAtTimeDetails,
- ObjectIds.HistoryData_Encoding_DefaultBinary: HistoryData,
- ObjectIds.ModificationInfo_Encoding_DefaultBinary: ModificationInfo,
- ObjectIds.HistoryModifiedData_Encoding_DefaultBinary: HistoryModifiedData,
- ObjectIds.HistoryEvent_Encoding_DefaultBinary: HistoryEvent,
- ObjectIds.HistoryReadRequest_Encoding_DefaultBinary: HistoryReadRequest,
- ObjectIds.HistoryReadResponse_Encoding_DefaultBinary: HistoryReadResponse,
- ObjectIds.WriteValue_Encoding_DefaultBinary: WriteValue,
- ObjectIds.WriteRequest_Encoding_DefaultBinary: WriteRequest,
- ObjectIds.WriteResponse_Encoding_DefaultBinary: WriteResponse,
- ObjectIds.HistoryUpdateDetails_Encoding_DefaultBinary: HistoryUpdateDetails,
- ObjectIds.UpdateDataDetails_Encoding_DefaultBinary: UpdateDataDetails,
- ObjectIds.UpdateStructureDataDetails_Encoding_DefaultBinary: UpdateStructureDataDetails,
- ObjectIds.UpdateEventDetails_Encoding_DefaultBinary: UpdateEventDetails,
- ObjectIds.DeleteRawModifiedDetails_Encoding_DefaultBinary: DeleteRawModifiedDetails,
- ObjectIds.DeleteAtTimeDetails_Encoding_DefaultBinary: DeleteAtTimeDetails,
- ObjectIds.DeleteEventDetails_Encoding_DefaultBinary: DeleteEventDetails,
- ObjectIds.HistoryUpdateResult_Encoding_DefaultBinary: HistoryUpdateResult,
- ObjectIds.HistoryUpdateRequest_Encoding_DefaultBinary: HistoryUpdateRequest,
- ObjectIds.HistoryUpdateResponse_Encoding_DefaultBinary: HistoryUpdateResponse,
- ObjectIds.CallMethodRequest_Encoding_DefaultBinary: CallMethodRequest,
- ObjectIds.CallMethodResult_Encoding_DefaultBinary: CallMethodResult,
- ObjectIds.CallRequest_Encoding_DefaultBinary: CallRequest,
- ObjectIds.CallResponse_Encoding_DefaultBinary: CallResponse,
- ObjectIds.MonitoringFilter_Encoding_DefaultBinary: MonitoringFilter,
- ObjectIds.DataChangeFilter_Encoding_DefaultBinary: DataChangeFilter,
- ObjectIds.EventFilter_Encoding_DefaultBinary: EventFilter,
- ObjectIds.AggregateConfiguration_Encoding_DefaultBinary: AggregateConfiguration,
- ObjectIds.AggregateFilter_Encoding_DefaultBinary: AggregateFilter,
- ObjectIds.MonitoringFilterResult_Encoding_DefaultBinary: MonitoringFilterResult,
- ObjectIds.EventFilterResult_Encoding_DefaultBinary: EventFilterResult,
- ObjectIds.AggregateFilterResult_Encoding_DefaultBinary: AggregateFilterResult,
- ObjectIds.MonitoringParameters_Encoding_DefaultBinary: MonitoringParameters,
- ObjectIds.MonitoredItemCreateRequest_Encoding_DefaultBinary: MonitoredItemCreateRequest,
- ObjectIds.MonitoredItemCreateResult_Encoding_DefaultBinary: MonitoredItemCreateResult,
- ObjectIds.CreateMonitoredItemsRequest_Encoding_DefaultBinary: CreateMonitoredItemsRequest,
- ObjectIds.CreateMonitoredItemsResponse_Encoding_DefaultBinary: CreateMonitoredItemsResponse,
- ObjectIds.MonitoredItemModifyRequest_Encoding_DefaultBinary: MonitoredItemModifyRequest,
- ObjectIds.MonitoredItemModifyResult_Encoding_DefaultBinary: MonitoredItemModifyResult,
- ObjectIds.ModifyMonitoredItemsRequest_Encoding_DefaultBinary: ModifyMonitoredItemsRequest,
- ObjectIds.ModifyMonitoredItemsResponse_Encoding_DefaultBinary: ModifyMonitoredItemsResponse,
- ObjectIds.SetMonitoringModeRequest_Encoding_DefaultBinary: SetMonitoringModeRequest,
- ObjectIds.SetMonitoringModeResponse_Encoding_DefaultBinary: SetMonitoringModeResponse,
- ObjectIds.SetTriggeringRequest_Encoding_DefaultBinary: SetTriggeringRequest,
- ObjectIds.SetTriggeringResponse_Encoding_DefaultBinary: SetTriggeringResponse,
- ObjectIds.DeleteMonitoredItemsRequest_Encoding_DefaultBinary: DeleteMonitoredItemsRequest,
- ObjectIds.DeleteMonitoredItemsResponse_Encoding_DefaultBinary: DeleteMonitoredItemsResponse,
- ObjectIds.CreateSubscriptionRequest_Encoding_DefaultBinary: CreateSubscriptionRequest,
- ObjectIds.CreateSubscriptionResponse_Encoding_DefaultBinary: CreateSubscriptionResponse,
- ObjectIds.ModifySubscriptionRequest_Encoding_DefaultBinary: ModifySubscriptionRequest,
- ObjectIds.ModifySubscriptionResponse_Encoding_DefaultBinary: ModifySubscriptionResponse,
- ObjectIds.SetPublishingModeRequest_Encoding_DefaultBinary: SetPublishingModeRequest,
- ObjectIds.SetPublishingModeResponse_Encoding_DefaultBinary: SetPublishingModeResponse,
- ObjectIds.NotificationMessage_Encoding_DefaultBinary: NotificationMessage,
- ObjectIds.NotificationData_Encoding_DefaultBinary: NotificationData,
- ObjectIds.DataChangeNotification_Encoding_DefaultBinary: DataChangeNotification,
- ObjectIds.MonitoredItemNotification_Encoding_DefaultBinary: MonitoredItemNotification,
- ObjectIds.EventNotificationList_Encoding_DefaultBinary: EventNotificationList,
- ObjectIds.EventFieldList_Encoding_DefaultBinary: EventFieldList,
- ObjectIds.HistoryEventFieldList_Encoding_DefaultBinary: HistoryEventFieldList,
- ObjectIds.StatusChangeNotification_Encoding_DefaultBinary: StatusChangeNotification,
- ObjectIds.SubscriptionAcknowledgement_Encoding_DefaultBinary: SubscriptionAcknowledgement,
- ObjectIds.PublishRequest_Encoding_DefaultBinary: PublishRequest,
- ObjectIds.PublishResponse_Encoding_DefaultBinary: PublishResponse,
- ObjectIds.RepublishRequest_Encoding_DefaultBinary: RepublishRequest,
- ObjectIds.RepublishResponse_Encoding_DefaultBinary: RepublishResponse,
- ObjectIds.TransferResult_Encoding_DefaultBinary: TransferResult,
- ObjectIds.TransferSubscriptionsRequest_Encoding_DefaultBinary: TransferSubscriptionsRequest,
- ObjectIds.TransferSubscriptionsResponse_Encoding_DefaultBinary: TransferSubscriptionsResponse,
- ObjectIds.DeleteSubscriptionsRequest_Encoding_DefaultBinary: DeleteSubscriptionsRequest,
- ObjectIds.DeleteSubscriptionsResponse_Encoding_DefaultBinary: DeleteSubscriptionsResponse,
- ObjectIds.BuildInfo_Encoding_DefaultBinary: BuildInfo,
- ObjectIds.RedundantServerDataType_Encoding_DefaultBinary: RedundantServerDataType,
- ObjectIds.EndpointUrlListDataType_Encoding_DefaultBinary: EndpointUrlListDataType,
- ObjectIds.NetworkGroupDataType_Encoding_DefaultBinary: NetworkGroupDataType,
- ObjectIds.SamplingIntervalDiagnosticsDataType_Encoding_DefaultBinary: SamplingIntervalDiagnosticsDataType,
- ObjectIds.ServerDiagnosticsSummaryDataType_Encoding_DefaultBinary: ServerDiagnosticsSummaryDataType,
- ObjectIds.ServerStatusDataType_Encoding_DefaultBinary: ServerStatusDataType,
- ObjectIds.SessionDiagnosticsDataType_Encoding_DefaultBinary: SessionDiagnosticsDataType,
- ObjectIds.SessionSecurityDiagnosticsDataType_Encoding_DefaultBinary: SessionSecurityDiagnosticsDataType,
- ObjectIds.ServiceCounterDataType_Encoding_DefaultBinary: ServiceCounterDataType,
- ObjectIds.StatusResult_Encoding_DefaultBinary: StatusResult,
- ObjectIds.SubscriptionDiagnosticsDataType_Encoding_DefaultBinary: SubscriptionDiagnosticsDataType,
- ObjectIds.ModelChangeStructureDataType_Encoding_DefaultBinary: ModelChangeStructureDataType,
- ObjectIds.SemanticChangeStructureDataType_Encoding_DefaultBinary: SemanticChangeStructureDataType,
- ObjectIds.Range_Encoding_DefaultBinary: Range,
- ObjectIds.EUInformation_Encoding_DefaultBinary: EUInformation,
- ObjectIds.ComplexNumberType_Encoding_DefaultBinary: ComplexNumberType,
- ObjectIds.DoubleComplexNumberType_Encoding_DefaultBinary: DoubleComplexNumberType,
- ObjectIds.AxisInformation_Encoding_DefaultBinary: AxisInformation,
- ObjectIds.XVType_Encoding_DefaultBinary: XVType,
- ObjectIds.ProgramDiagnosticDataType_Encoding_DefaultBinary: ProgramDiagnosticDataType,
- ObjectIds.Annotation_Encoding_DefaultBinary: Annotation,
-}
-
-
-def extensionobject_from_binary(data):
- """
- Convert binary-coded ExtensionObject to a Python object.
- Returns an object, or None if TypeId is zero
- """
- TypeId = NodeId.from_binary(data)
- Encoding = ord(data.read(1))
- body = None
- if Encoding & (1 << 0):
- length = uabin.Primitives.Int32.unpack(data)
- if length < 1:
- body = Buffer(b"")
- else:
- body = data.copy(length)
- data.skip(length)
- if TypeId.Identifier == 0:
- return None
- elif TypeId.Identifier not in ExtensionClasses:
- e = ExtensionObject()
- e.TypeId = TypeId
- e.Encoding = Encoding
- if body is not None:
- e.Body = body.read(len(body))
- return e
- klass = ExtensionClasses[TypeId.Identifier]
- if body is None:
- raise UaError("parsing ExtensionObject {0} without data".format(klass.__name__))
- return klass.from_binary(body)
-
-
-def extensionobject_to_binary(obj):
- """
- Convert Python object to binary-coded ExtensionObject.
- If obj is None, convert to empty ExtensionObject (TypeId = 0, no Body).
- Returns a binary string
- """
- if isinstance(obj, ExtensionObject):
- return obj.to_binary()
- TypeId = NodeId()
- Encoding = 0
- Body = None
- if obj is not None:
- TypeId = FourByteNodeId(getattr(ObjectIds, "{0}_Encoding_DefaultBinary".format(obj.__class__.__name__)))
- Encoding |= (1 << 0)
- Body = obj.to_binary()
- packet = []
- packet.append(TypeId.to_binary())
- packet.append(uabin.Primitives.UInt8.pack(Encoding))
- if Body:
- packet.append(uabin.Primitives.Bytes.pack(Body))
- return b''.join(packet)
+nid = FourByteNodeId(ObjectIds.TrustListDataType_Encoding_DefaultBinary)
+extension_object_classes[nid] = TrustListDataType
+extension_object_ids['TrustListDataType'] = nid
+nid = FourByteNodeId(ObjectIds.Argument_Encoding_DefaultBinary)
+extension_object_classes[nid] = Argument
+extension_object_ids['Argument'] = nid
+nid = FourByteNodeId(ObjectIds.EnumValueType_Encoding_DefaultBinary)
+extension_object_classes[nid] = EnumValueType
+extension_object_ids['EnumValueType'] = nid
+nid = FourByteNodeId(ObjectIds.OptionSet_Encoding_DefaultBinary)
+extension_object_classes[nid] = OptionSet
+extension_object_ids['OptionSet'] = nid
+nid = FourByteNodeId(ObjectIds.Union_Encoding_DefaultBinary)
+extension_object_classes[nid] = Union
+extension_object_ids['Union'] = nid
+nid = FourByteNodeId(ObjectIds.TimeZoneDataType_Encoding_DefaultBinary)
+extension_object_classes[nid] = TimeZoneDataType
+extension_object_ids['TimeZoneDataType'] = nid
+nid = FourByteNodeId(ObjectIds.ApplicationDescription_Encoding_DefaultBinary)
+extension_object_classes[nid] = ApplicationDescription
+extension_object_ids['ApplicationDescription'] = nid
+nid = FourByteNodeId(ObjectIds.RequestHeader_Encoding_DefaultBinary)
+extension_object_classes[nid] = RequestHeader
+extension_object_ids['RequestHeader'] = nid
+nid = FourByteNodeId(ObjectIds.ResponseHeader_Encoding_DefaultBinary)
+extension_object_classes[nid] = ResponseHeader
+extension_object_ids['ResponseHeader'] = nid
+nid = FourByteNodeId(ObjectIds.ServiceFault_Encoding_DefaultBinary)
+extension_object_classes[nid] = ServiceFault
+extension_object_ids['ServiceFault'] = nid
+nid = FourByteNodeId(ObjectIds.FindServersRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = FindServersRequest
+extension_object_ids['FindServersRequest'] = nid
+nid = FourByteNodeId(ObjectIds.FindServersResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = FindServersResponse
+extension_object_ids['FindServersResponse'] = nid
+nid = FourByteNodeId(ObjectIds.ServerOnNetwork_Encoding_DefaultBinary)
+extension_object_classes[nid] = ServerOnNetwork
+extension_object_ids['ServerOnNetwork'] = nid
+nid = FourByteNodeId(ObjectIds.FindServersOnNetworkRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = FindServersOnNetworkRequest
+extension_object_ids['FindServersOnNetworkRequest'] = nid
+nid = FourByteNodeId(ObjectIds.FindServersOnNetworkResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = FindServersOnNetworkResponse
+extension_object_ids['FindServersOnNetworkResponse'] = nid
+nid = FourByteNodeId(ObjectIds.UserTokenPolicy_Encoding_DefaultBinary)
+extension_object_classes[nid] = UserTokenPolicy
+extension_object_ids['UserTokenPolicy'] = nid
+nid = FourByteNodeId(ObjectIds.EndpointDescription_Encoding_DefaultBinary)
+extension_object_classes[nid] = EndpointDescription
+extension_object_ids['EndpointDescription'] = nid
+nid = FourByteNodeId(ObjectIds.GetEndpointsRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = GetEndpointsRequest
+extension_object_ids['GetEndpointsRequest'] = nid
+nid = FourByteNodeId(ObjectIds.GetEndpointsResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = GetEndpointsResponse
+extension_object_ids['GetEndpointsResponse'] = nid
+nid = FourByteNodeId(ObjectIds.RegisteredServer_Encoding_DefaultBinary)
+extension_object_classes[nid] = RegisteredServer
+extension_object_ids['RegisteredServer'] = nid
+nid = FourByteNodeId(ObjectIds.RegisterServerRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = RegisterServerRequest
+extension_object_ids['RegisterServerRequest'] = nid
+nid = FourByteNodeId(ObjectIds.RegisterServerResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = RegisterServerResponse
+extension_object_ids['RegisterServerResponse'] = nid
+nid = FourByteNodeId(ObjectIds.DiscoveryConfiguration_Encoding_DefaultBinary)
+extension_object_classes[nid] = DiscoveryConfiguration
+extension_object_ids['DiscoveryConfiguration'] = nid
+nid = FourByteNodeId(ObjectIds.MdnsDiscoveryConfiguration_Encoding_DefaultBinary)
+extension_object_classes[nid] = MdnsDiscoveryConfiguration
+extension_object_ids['MdnsDiscoveryConfiguration'] = nid
+nid = FourByteNodeId(ObjectIds.RegisterServer2Request_Encoding_DefaultBinary)
+extension_object_classes[nid] = RegisterServer2Request
+extension_object_ids['RegisterServer2Request'] = nid
+nid = FourByteNodeId(ObjectIds.RegisterServer2Response_Encoding_DefaultBinary)
+extension_object_classes[nid] = RegisterServer2Response
+extension_object_ids['RegisterServer2Response'] = nid
+nid = FourByteNodeId(ObjectIds.ChannelSecurityToken_Encoding_DefaultBinary)
+extension_object_classes[nid] = ChannelSecurityToken
+extension_object_ids['ChannelSecurityToken'] = nid
+nid = FourByteNodeId(ObjectIds.OpenSecureChannelRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = OpenSecureChannelRequest
+extension_object_ids['OpenSecureChannelRequest'] = nid
+nid = FourByteNodeId(ObjectIds.OpenSecureChannelResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = OpenSecureChannelResponse
+extension_object_ids['OpenSecureChannelResponse'] = nid
+nid = FourByteNodeId(ObjectIds.CloseSecureChannelRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = CloseSecureChannelRequest
+extension_object_ids['CloseSecureChannelRequest'] = nid
+nid = FourByteNodeId(ObjectIds.CloseSecureChannelResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = CloseSecureChannelResponse
+extension_object_ids['CloseSecureChannelResponse'] = nid
+nid = FourByteNodeId(ObjectIds.SignedSoftwareCertificate_Encoding_DefaultBinary)
+extension_object_classes[nid] = SignedSoftwareCertificate
+extension_object_ids['SignedSoftwareCertificate'] = nid
+nid = FourByteNodeId(ObjectIds.SignatureData_Encoding_DefaultBinary)
+extension_object_classes[nid] = SignatureData
+extension_object_ids['SignatureData'] = nid
+nid = FourByteNodeId(ObjectIds.CreateSessionRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = CreateSessionRequest
+extension_object_ids['CreateSessionRequest'] = nid
+nid = FourByteNodeId(ObjectIds.CreateSessionResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = CreateSessionResponse
+extension_object_ids['CreateSessionResponse'] = nid
+nid = FourByteNodeId(ObjectIds.UserIdentityToken_Encoding_DefaultBinary)
+extension_object_classes[nid] = UserIdentityToken
+extension_object_ids['UserIdentityToken'] = nid
+nid = FourByteNodeId(ObjectIds.AnonymousIdentityToken_Encoding_DefaultBinary)
+extension_object_classes[nid] = AnonymousIdentityToken
+extension_object_ids['AnonymousIdentityToken'] = nid
+nid = FourByteNodeId(ObjectIds.UserNameIdentityToken_Encoding_DefaultBinary)
+extension_object_classes[nid] = UserNameIdentityToken
+extension_object_ids['UserNameIdentityToken'] = nid
+nid = FourByteNodeId(ObjectIds.X509IdentityToken_Encoding_DefaultBinary)
+extension_object_classes[nid] = X509IdentityToken
+extension_object_ids['X509IdentityToken'] = nid
+nid = FourByteNodeId(ObjectIds.KerberosIdentityToken_Encoding_DefaultBinary)
+extension_object_classes[nid] = KerberosIdentityToken
+extension_object_ids['KerberosIdentityToken'] = nid
+nid = FourByteNodeId(ObjectIds.IssuedIdentityToken_Encoding_DefaultBinary)
+extension_object_classes[nid] = IssuedIdentityToken
+extension_object_ids['IssuedIdentityToken'] = nid
+nid = FourByteNodeId(ObjectIds.ActivateSessionRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = ActivateSessionRequest
+extension_object_ids['ActivateSessionRequest'] = nid
+nid = FourByteNodeId(ObjectIds.ActivateSessionResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = ActivateSessionResponse
+extension_object_ids['ActivateSessionResponse'] = nid
+nid = FourByteNodeId(ObjectIds.CloseSessionRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = CloseSessionRequest
+extension_object_ids['CloseSessionRequest'] = nid
+nid = FourByteNodeId(ObjectIds.CloseSessionResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = CloseSessionResponse
+extension_object_ids['CloseSessionResponse'] = nid
+nid = FourByteNodeId(ObjectIds.CancelRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = CancelRequest
+extension_object_ids['CancelRequest'] = nid
+nid = FourByteNodeId(ObjectIds.CancelResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = CancelResponse
+extension_object_ids['CancelResponse'] = nid
+nid = FourByteNodeId(ObjectIds.NodeAttributes_Encoding_DefaultBinary)
+extension_object_classes[nid] = NodeAttributes
+extension_object_ids['NodeAttributes'] = nid
+nid = FourByteNodeId(ObjectIds.ObjectAttributes_Encoding_DefaultBinary)
+extension_object_classes[nid] = ObjectAttributes
+extension_object_ids['ObjectAttributes'] = nid
+nid = FourByteNodeId(ObjectIds.VariableAttributes_Encoding_DefaultBinary)
+extension_object_classes[nid] = VariableAttributes
+extension_object_ids['VariableAttributes'] = nid
+nid = FourByteNodeId(ObjectIds.MethodAttributes_Encoding_DefaultBinary)
+extension_object_classes[nid] = MethodAttributes
+extension_object_ids['MethodAttributes'] = nid
+nid = FourByteNodeId(ObjectIds.ObjectTypeAttributes_Encoding_DefaultBinary)
+extension_object_classes[nid] = ObjectTypeAttributes
+extension_object_ids['ObjectTypeAttributes'] = nid
+nid = FourByteNodeId(ObjectIds.VariableTypeAttributes_Encoding_DefaultBinary)
+extension_object_classes[nid] = VariableTypeAttributes
+extension_object_ids['VariableTypeAttributes'] = nid
+nid = FourByteNodeId(ObjectIds.ReferenceTypeAttributes_Encoding_DefaultBinary)
+extension_object_classes[nid] = ReferenceTypeAttributes
+extension_object_ids['ReferenceTypeAttributes'] = nid
+nid = FourByteNodeId(ObjectIds.DataTypeAttributes_Encoding_DefaultBinary)
+extension_object_classes[nid] = DataTypeAttributes
+extension_object_ids['DataTypeAttributes'] = nid
+nid = FourByteNodeId(ObjectIds.ViewAttributes_Encoding_DefaultBinary)
+extension_object_classes[nid] = ViewAttributes
+extension_object_ids['ViewAttributes'] = nid
+nid = FourByteNodeId(ObjectIds.AddNodesItem_Encoding_DefaultBinary)
+extension_object_classes[nid] = AddNodesItem
+extension_object_ids['AddNodesItem'] = nid
+nid = FourByteNodeId(ObjectIds.AddNodesResult_Encoding_DefaultBinary)
+extension_object_classes[nid] = AddNodesResult
+extension_object_ids['AddNodesResult'] = nid
+nid = FourByteNodeId(ObjectIds.AddNodesRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = AddNodesRequest
+extension_object_ids['AddNodesRequest'] = nid
+nid = FourByteNodeId(ObjectIds.AddNodesResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = AddNodesResponse
+extension_object_ids['AddNodesResponse'] = nid
+nid = FourByteNodeId(ObjectIds.AddReferencesItem_Encoding_DefaultBinary)
+extension_object_classes[nid] = AddReferencesItem
+extension_object_ids['AddReferencesItem'] = nid
+nid = FourByteNodeId(ObjectIds.AddReferencesRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = AddReferencesRequest
+extension_object_ids['AddReferencesRequest'] = nid
+nid = FourByteNodeId(ObjectIds.AddReferencesResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = AddReferencesResponse
+extension_object_ids['AddReferencesResponse'] = nid
+nid = FourByteNodeId(ObjectIds.DeleteNodesItem_Encoding_DefaultBinary)
+extension_object_classes[nid] = DeleteNodesItem
+extension_object_ids['DeleteNodesItem'] = nid
+nid = FourByteNodeId(ObjectIds.DeleteNodesRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = DeleteNodesRequest
+extension_object_ids['DeleteNodesRequest'] = nid
+nid = FourByteNodeId(ObjectIds.DeleteNodesResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = DeleteNodesResponse
+extension_object_ids['DeleteNodesResponse'] = nid
+nid = FourByteNodeId(ObjectIds.DeleteReferencesItem_Encoding_DefaultBinary)
+extension_object_classes[nid] = DeleteReferencesItem
+extension_object_ids['DeleteReferencesItem'] = nid
+nid = FourByteNodeId(ObjectIds.DeleteReferencesRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = DeleteReferencesRequest
+extension_object_ids['DeleteReferencesRequest'] = nid
+nid = FourByteNodeId(ObjectIds.DeleteReferencesResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = DeleteReferencesResponse
+extension_object_ids['DeleteReferencesResponse'] = nid
+nid = FourByteNodeId(ObjectIds.ViewDescription_Encoding_DefaultBinary)
+extension_object_classes[nid] = ViewDescription
+extension_object_ids['ViewDescription'] = nid
+nid = FourByteNodeId(ObjectIds.BrowseDescription_Encoding_DefaultBinary)
+extension_object_classes[nid] = BrowseDescription
+extension_object_ids['BrowseDescription'] = nid
+nid = FourByteNodeId(ObjectIds.ReferenceDescription_Encoding_DefaultBinary)
+extension_object_classes[nid] = ReferenceDescription
+extension_object_ids['ReferenceDescription'] = nid
+nid = FourByteNodeId(ObjectIds.BrowseResult_Encoding_DefaultBinary)
+extension_object_classes[nid] = BrowseResult
+extension_object_ids['BrowseResult'] = nid
+nid = FourByteNodeId(ObjectIds.BrowseRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = BrowseRequest
+extension_object_ids['BrowseRequest'] = nid
+nid = FourByteNodeId(ObjectIds.BrowseResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = BrowseResponse
+extension_object_ids['BrowseResponse'] = nid
+nid = FourByteNodeId(ObjectIds.BrowseNextRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = BrowseNextRequest
+extension_object_ids['BrowseNextRequest'] = nid
+nid = FourByteNodeId(ObjectIds.BrowseNextResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = BrowseNextResponse
+extension_object_ids['BrowseNextResponse'] = nid
+nid = FourByteNodeId(ObjectIds.RelativePathElement_Encoding_DefaultBinary)
+extension_object_classes[nid] = RelativePathElement
+extension_object_ids['RelativePathElement'] = nid
+nid = FourByteNodeId(ObjectIds.RelativePath_Encoding_DefaultBinary)
+extension_object_classes[nid] = RelativePath
+extension_object_ids['RelativePath'] = nid
+nid = FourByteNodeId(ObjectIds.BrowsePath_Encoding_DefaultBinary)
+extension_object_classes[nid] = BrowsePath
+extension_object_ids['BrowsePath'] = nid
+nid = FourByteNodeId(ObjectIds.BrowsePathTarget_Encoding_DefaultBinary)
+extension_object_classes[nid] = BrowsePathTarget
+extension_object_ids['BrowsePathTarget'] = nid
+nid = FourByteNodeId(ObjectIds.BrowsePathResult_Encoding_DefaultBinary)
+extension_object_classes[nid] = BrowsePathResult
+extension_object_ids['BrowsePathResult'] = nid
+nid = FourByteNodeId(ObjectIds.TranslateBrowsePathsToNodeIdsRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = TranslateBrowsePathsToNodeIdsRequest
+extension_object_ids['TranslateBrowsePathsToNodeIdsRequest'] = nid
+nid = FourByteNodeId(ObjectIds.TranslateBrowsePathsToNodeIdsResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = TranslateBrowsePathsToNodeIdsResponse
+extension_object_ids['TranslateBrowsePathsToNodeIdsResponse'] = nid
+nid = FourByteNodeId(ObjectIds.RegisterNodesRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = RegisterNodesRequest
+extension_object_ids['RegisterNodesRequest'] = nid
+nid = FourByteNodeId(ObjectIds.RegisterNodesResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = RegisterNodesResponse
+extension_object_ids['RegisterNodesResponse'] = nid
+nid = FourByteNodeId(ObjectIds.UnregisterNodesRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = UnregisterNodesRequest
+extension_object_ids['UnregisterNodesRequest'] = nid
+nid = FourByteNodeId(ObjectIds.UnregisterNodesResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = UnregisterNodesResponse
+extension_object_ids['UnregisterNodesResponse'] = nid
+nid = FourByteNodeId(ObjectIds.EndpointConfiguration_Encoding_DefaultBinary)
+extension_object_classes[nid] = EndpointConfiguration
+extension_object_ids['EndpointConfiguration'] = nid
+nid = FourByteNodeId(ObjectIds.SupportedProfile_Encoding_DefaultBinary)
+extension_object_classes[nid] = SupportedProfile
+extension_object_ids['SupportedProfile'] = nid
+nid = FourByteNodeId(ObjectIds.SoftwareCertificate_Encoding_DefaultBinary)
+extension_object_classes[nid] = SoftwareCertificate
+extension_object_ids['SoftwareCertificate'] = nid
+nid = FourByteNodeId(ObjectIds.QueryDataDescription_Encoding_DefaultBinary)
+extension_object_classes[nid] = QueryDataDescription
+extension_object_ids['QueryDataDescription'] = nid
+nid = FourByteNodeId(ObjectIds.NodeTypeDescription_Encoding_DefaultBinary)
+extension_object_classes[nid] = NodeTypeDescription
+extension_object_ids['NodeTypeDescription'] = nid
+nid = FourByteNodeId(ObjectIds.QueryDataSet_Encoding_DefaultBinary)
+extension_object_classes[nid] = QueryDataSet
+extension_object_ids['QueryDataSet'] = nid
+nid = FourByteNodeId(ObjectIds.NodeReference_Encoding_DefaultBinary)
+extension_object_classes[nid] = NodeReference
+extension_object_ids['NodeReference'] = nid
+nid = FourByteNodeId(ObjectIds.ContentFilterElement_Encoding_DefaultBinary)
+extension_object_classes[nid] = ContentFilterElement
+extension_object_ids['ContentFilterElement'] = nid
+nid = FourByteNodeId(ObjectIds.ContentFilter_Encoding_DefaultBinary)
+extension_object_classes[nid] = ContentFilter
+extension_object_ids['ContentFilter'] = nid
+nid = FourByteNodeId(ObjectIds.ElementOperand_Encoding_DefaultBinary)
+extension_object_classes[nid] = ElementOperand
+extension_object_ids['ElementOperand'] = nid
+nid = FourByteNodeId(ObjectIds.LiteralOperand_Encoding_DefaultBinary)
+extension_object_classes[nid] = LiteralOperand
+extension_object_ids['LiteralOperand'] = nid
+nid = FourByteNodeId(ObjectIds.AttributeOperand_Encoding_DefaultBinary)
+extension_object_classes[nid] = AttributeOperand
+extension_object_ids['AttributeOperand'] = nid
+nid = FourByteNodeId(ObjectIds.SimpleAttributeOperand_Encoding_DefaultBinary)
+extension_object_classes[nid] = SimpleAttributeOperand
+extension_object_ids['SimpleAttributeOperand'] = nid
+nid = FourByteNodeId(ObjectIds.ContentFilterElementResult_Encoding_DefaultBinary)
+extension_object_classes[nid] = ContentFilterElementResult
+extension_object_ids['ContentFilterElementResult'] = nid
+nid = FourByteNodeId(ObjectIds.ContentFilterResult_Encoding_DefaultBinary)
+extension_object_classes[nid] = ContentFilterResult
+extension_object_ids['ContentFilterResult'] = nid
+nid = FourByteNodeId(ObjectIds.ParsingResult_Encoding_DefaultBinary)
+extension_object_classes[nid] = ParsingResult
+extension_object_ids['ParsingResult'] = nid
+nid = FourByteNodeId(ObjectIds.QueryFirstRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = QueryFirstRequest
+extension_object_ids['QueryFirstRequest'] = nid
+nid = FourByteNodeId(ObjectIds.QueryFirstResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = QueryFirstResponse
+extension_object_ids['QueryFirstResponse'] = nid
+nid = FourByteNodeId(ObjectIds.QueryNextRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = QueryNextRequest
+extension_object_ids['QueryNextRequest'] = nid
+nid = FourByteNodeId(ObjectIds.QueryNextResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = QueryNextResponse
+extension_object_ids['QueryNextResponse'] = nid
+nid = FourByteNodeId(ObjectIds.ReadValueId_Encoding_DefaultBinary)
+extension_object_classes[nid] = ReadValueId
+extension_object_ids['ReadValueId'] = nid
+nid = FourByteNodeId(ObjectIds.ReadRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = ReadRequest
+extension_object_ids['ReadRequest'] = nid
+nid = FourByteNodeId(ObjectIds.ReadResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = ReadResponse
+extension_object_ids['ReadResponse'] = nid
+nid = FourByteNodeId(ObjectIds.HistoryReadValueId_Encoding_DefaultBinary)
+extension_object_classes[nid] = HistoryReadValueId
+extension_object_ids['HistoryReadValueId'] = nid
+nid = FourByteNodeId(ObjectIds.HistoryReadResult_Encoding_DefaultBinary)
+extension_object_classes[nid] = HistoryReadResult
+extension_object_ids['HistoryReadResult'] = nid
+nid = FourByteNodeId(ObjectIds.HistoryReadDetails_Encoding_DefaultBinary)
+extension_object_classes[nid] = HistoryReadDetails
+extension_object_ids['HistoryReadDetails'] = nid
+nid = FourByteNodeId(ObjectIds.ReadEventDetails_Encoding_DefaultBinary)
+extension_object_classes[nid] = ReadEventDetails
+extension_object_ids['ReadEventDetails'] = nid
+nid = FourByteNodeId(ObjectIds.ReadRawModifiedDetails_Encoding_DefaultBinary)
+extension_object_classes[nid] = ReadRawModifiedDetails
+extension_object_ids['ReadRawModifiedDetails'] = nid
+nid = FourByteNodeId(ObjectIds.ReadProcessedDetails_Encoding_DefaultBinary)
+extension_object_classes[nid] = ReadProcessedDetails
+extension_object_ids['ReadProcessedDetails'] = nid
+nid = FourByteNodeId(ObjectIds.ReadAtTimeDetails_Encoding_DefaultBinary)
+extension_object_classes[nid] = ReadAtTimeDetails
+extension_object_ids['ReadAtTimeDetails'] = nid
+nid = FourByteNodeId(ObjectIds.HistoryData_Encoding_DefaultBinary)
+extension_object_classes[nid] = HistoryData
+extension_object_ids['HistoryData'] = nid
+nid = FourByteNodeId(ObjectIds.ModificationInfo_Encoding_DefaultBinary)
+extension_object_classes[nid] = ModificationInfo
+extension_object_ids['ModificationInfo'] = nid
+nid = FourByteNodeId(ObjectIds.HistoryModifiedData_Encoding_DefaultBinary)
+extension_object_classes[nid] = HistoryModifiedData
+extension_object_ids['HistoryModifiedData'] = nid
+nid = FourByteNodeId(ObjectIds.HistoryEvent_Encoding_DefaultBinary)
+extension_object_classes[nid] = HistoryEvent
+extension_object_ids['HistoryEvent'] = nid
+nid = FourByteNodeId(ObjectIds.HistoryReadRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = HistoryReadRequest
+extension_object_ids['HistoryReadRequest'] = nid
+nid = FourByteNodeId(ObjectIds.HistoryReadResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = HistoryReadResponse
+extension_object_ids['HistoryReadResponse'] = nid
+nid = FourByteNodeId(ObjectIds.WriteValue_Encoding_DefaultBinary)
+extension_object_classes[nid] = WriteValue
+extension_object_ids['WriteValue'] = nid
+nid = FourByteNodeId(ObjectIds.WriteRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = WriteRequest
+extension_object_ids['WriteRequest'] = nid
+nid = FourByteNodeId(ObjectIds.WriteResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = WriteResponse
+extension_object_ids['WriteResponse'] = nid
+nid = FourByteNodeId(ObjectIds.HistoryUpdateDetails_Encoding_DefaultBinary)
+extension_object_classes[nid] = HistoryUpdateDetails
+extension_object_ids['HistoryUpdateDetails'] = nid
+nid = FourByteNodeId(ObjectIds.UpdateDataDetails_Encoding_DefaultBinary)
+extension_object_classes[nid] = UpdateDataDetails
+extension_object_ids['UpdateDataDetails'] = nid
+nid = FourByteNodeId(ObjectIds.UpdateStructureDataDetails_Encoding_DefaultBinary)
+extension_object_classes[nid] = UpdateStructureDataDetails
+extension_object_ids['UpdateStructureDataDetails'] = nid
+nid = FourByteNodeId(ObjectIds.UpdateEventDetails_Encoding_DefaultBinary)
+extension_object_classes[nid] = UpdateEventDetails
+extension_object_ids['UpdateEventDetails'] = nid
+nid = FourByteNodeId(ObjectIds.DeleteRawModifiedDetails_Encoding_DefaultBinary)
+extension_object_classes[nid] = DeleteRawModifiedDetails
+extension_object_ids['DeleteRawModifiedDetails'] = nid
+nid = FourByteNodeId(ObjectIds.DeleteAtTimeDetails_Encoding_DefaultBinary)
+extension_object_classes[nid] = DeleteAtTimeDetails
+extension_object_ids['DeleteAtTimeDetails'] = nid
+nid = FourByteNodeId(ObjectIds.DeleteEventDetails_Encoding_DefaultBinary)
+extension_object_classes[nid] = DeleteEventDetails
+extension_object_ids['DeleteEventDetails'] = nid
+nid = FourByteNodeId(ObjectIds.HistoryUpdateResult_Encoding_DefaultBinary)
+extension_object_classes[nid] = HistoryUpdateResult
+extension_object_ids['HistoryUpdateResult'] = nid
+nid = FourByteNodeId(ObjectIds.HistoryUpdateRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = HistoryUpdateRequest
+extension_object_ids['HistoryUpdateRequest'] = nid
+nid = FourByteNodeId(ObjectIds.HistoryUpdateResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = HistoryUpdateResponse
+extension_object_ids['HistoryUpdateResponse'] = nid
+nid = FourByteNodeId(ObjectIds.CallMethodRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = CallMethodRequest
+extension_object_ids['CallMethodRequest'] = nid
+nid = FourByteNodeId(ObjectIds.CallMethodResult_Encoding_DefaultBinary)
+extension_object_classes[nid] = CallMethodResult
+extension_object_ids['CallMethodResult'] = nid
+nid = FourByteNodeId(ObjectIds.CallRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = CallRequest
+extension_object_ids['CallRequest'] = nid
+nid = FourByteNodeId(ObjectIds.CallResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = CallResponse
+extension_object_ids['CallResponse'] = nid
+nid = FourByteNodeId(ObjectIds.MonitoringFilter_Encoding_DefaultBinary)
+extension_object_classes[nid] = MonitoringFilter
+extension_object_ids['MonitoringFilter'] = nid
+nid = FourByteNodeId(ObjectIds.DataChangeFilter_Encoding_DefaultBinary)
+extension_object_classes[nid] = DataChangeFilter
+extension_object_ids['DataChangeFilter'] = nid
+nid = FourByteNodeId(ObjectIds.EventFilter_Encoding_DefaultBinary)
+extension_object_classes[nid] = EventFilter
+extension_object_ids['EventFilter'] = nid
+nid = FourByteNodeId(ObjectIds.AggregateConfiguration_Encoding_DefaultBinary)
+extension_object_classes[nid] = AggregateConfiguration
+extension_object_ids['AggregateConfiguration'] = nid
+nid = FourByteNodeId(ObjectIds.AggregateFilter_Encoding_DefaultBinary)
+extension_object_classes[nid] = AggregateFilter
+extension_object_ids['AggregateFilter'] = nid
+nid = FourByteNodeId(ObjectIds.MonitoringFilterResult_Encoding_DefaultBinary)
+extension_object_classes[nid] = MonitoringFilterResult
+extension_object_ids['MonitoringFilterResult'] = nid
+nid = FourByteNodeId(ObjectIds.EventFilterResult_Encoding_DefaultBinary)
+extension_object_classes[nid] = EventFilterResult
+extension_object_ids['EventFilterResult'] = nid
+nid = FourByteNodeId(ObjectIds.AggregateFilterResult_Encoding_DefaultBinary)
+extension_object_classes[nid] = AggregateFilterResult
+extension_object_ids['AggregateFilterResult'] = nid
+nid = FourByteNodeId(ObjectIds.MonitoringParameters_Encoding_DefaultBinary)
+extension_object_classes[nid] = MonitoringParameters
+extension_object_ids['MonitoringParameters'] = nid
+nid = FourByteNodeId(ObjectIds.MonitoredItemCreateRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = MonitoredItemCreateRequest
+extension_object_ids['MonitoredItemCreateRequest'] = nid
+nid = FourByteNodeId(ObjectIds.MonitoredItemCreateResult_Encoding_DefaultBinary)
+extension_object_classes[nid] = MonitoredItemCreateResult
+extension_object_ids['MonitoredItemCreateResult'] = nid
+nid = FourByteNodeId(ObjectIds.CreateMonitoredItemsRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = CreateMonitoredItemsRequest
+extension_object_ids['CreateMonitoredItemsRequest'] = nid
+nid = FourByteNodeId(ObjectIds.CreateMonitoredItemsResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = CreateMonitoredItemsResponse
+extension_object_ids['CreateMonitoredItemsResponse'] = nid
+nid = FourByteNodeId(ObjectIds.MonitoredItemModifyRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = MonitoredItemModifyRequest
+extension_object_ids['MonitoredItemModifyRequest'] = nid
+nid = FourByteNodeId(ObjectIds.MonitoredItemModifyResult_Encoding_DefaultBinary)
+extension_object_classes[nid] = MonitoredItemModifyResult
+extension_object_ids['MonitoredItemModifyResult'] = nid
+nid = FourByteNodeId(ObjectIds.ModifyMonitoredItemsRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = ModifyMonitoredItemsRequest
+extension_object_ids['ModifyMonitoredItemsRequest'] = nid
+nid = FourByteNodeId(ObjectIds.ModifyMonitoredItemsResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = ModifyMonitoredItemsResponse
+extension_object_ids['ModifyMonitoredItemsResponse'] = nid
+nid = FourByteNodeId(ObjectIds.SetMonitoringModeRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = SetMonitoringModeRequest
+extension_object_ids['SetMonitoringModeRequest'] = nid
+nid = FourByteNodeId(ObjectIds.SetMonitoringModeResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = SetMonitoringModeResponse
+extension_object_ids['SetMonitoringModeResponse'] = nid
+nid = FourByteNodeId(ObjectIds.SetTriggeringRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = SetTriggeringRequest
+extension_object_ids['SetTriggeringRequest'] = nid
+nid = FourByteNodeId(ObjectIds.SetTriggeringResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = SetTriggeringResponse
+extension_object_ids['SetTriggeringResponse'] = nid
+nid = FourByteNodeId(ObjectIds.DeleteMonitoredItemsRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = DeleteMonitoredItemsRequest
+extension_object_ids['DeleteMonitoredItemsRequest'] = nid
+nid = FourByteNodeId(ObjectIds.DeleteMonitoredItemsResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = DeleteMonitoredItemsResponse
+extension_object_ids['DeleteMonitoredItemsResponse'] = nid
+nid = FourByteNodeId(ObjectIds.CreateSubscriptionRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = CreateSubscriptionRequest
+extension_object_ids['CreateSubscriptionRequest'] = nid
+nid = FourByteNodeId(ObjectIds.CreateSubscriptionResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = CreateSubscriptionResponse
+extension_object_ids['CreateSubscriptionResponse'] = nid
+nid = FourByteNodeId(ObjectIds.ModifySubscriptionRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = ModifySubscriptionRequest
+extension_object_ids['ModifySubscriptionRequest'] = nid
+nid = FourByteNodeId(ObjectIds.ModifySubscriptionResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = ModifySubscriptionResponse
+extension_object_ids['ModifySubscriptionResponse'] = nid
+nid = FourByteNodeId(ObjectIds.SetPublishingModeRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = SetPublishingModeRequest
+extension_object_ids['SetPublishingModeRequest'] = nid
+nid = FourByteNodeId(ObjectIds.SetPublishingModeResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = SetPublishingModeResponse
+extension_object_ids['SetPublishingModeResponse'] = nid
+nid = FourByteNodeId(ObjectIds.NotificationMessage_Encoding_DefaultBinary)
+extension_object_classes[nid] = NotificationMessage
+extension_object_ids['NotificationMessage'] = nid
+nid = FourByteNodeId(ObjectIds.NotificationData_Encoding_DefaultBinary)
+extension_object_classes[nid] = NotificationData
+extension_object_ids['NotificationData'] = nid
+nid = FourByteNodeId(ObjectIds.DataChangeNotification_Encoding_DefaultBinary)
+extension_object_classes[nid] = DataChangeNotification
+extension_object_ids['DataChangeNotification'] = nid
+nid = FourByteNodeId(ObjectIds.MonitoredItemNotification_Encoding_DefaultBinary)
+extension_object_classes[nid] = MonitoredItemNotification
+extension_object_ids['MonitoredItemNotification'] = nid
+nid = FourByteNodeId(ObjectIds.EventNotificationList_Encoding_DefaultBinary)
+extension_object_classes[nid] = EventNotificationList
+extension_object_ids['EventNotificationList'] = nid
+nid = FourByteNodeId(ObjectIds.EventFieldList_Encoding_DefaultBinary)
+extension_object_classes[nid] = EventFieldList
+extension_object_ids['EventFieldList'] = nid
+nid = FourByteNodeId(ObjectIds.HistoryEventFieldList_Encoding_DefaultBinary)
+extension_object_classes[nid] = HistoryEventFieldList
+extension_object_ids['HistoryEventFieldList'] = nid
+nid = FourByteNodeId(ObjectIds.StatusChangeNotification_Encoding_DefaultBinary)
+extension_object_classes[nid] = StatusChangeNotification
+extension_object_ids['StatusChangeNotification'] = nid
+nid = FourByteNodeId(ObjectIds.SubscriptionAcknowledgement_Encoding_DefaultBinary)
+extension_object_classes[nid] = SubscriptionAcknowledgement
+extension_object_ids['SubscriptionAcknowledgement'] = nid
+nid = FourByteNodeId(ObjectIds.PublishRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = PublishRequest
+extension_object_ids['PublishRequest'] = nid
+nid = FourByteNodeId(ObjectIds.PublishResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = PublishResponse
+extension_object_ids['PublishResponse'] = nid
+nid = FourByteNodeId(ObjectIds.RepublishRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = RepublishRequest
+extension_object_ids['RepublishRequest'] = nid
+nid = FourByteNodeId(ObjectIds.RepublishResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = RepublishResponse
+extension_object_ids['RepublishResponse'] = nid
+nid = FourByteNodeId(ObjectIds.TransferResult_Encoding_DefaultBinary)
+extension_object_classes[nid] = TransferResult
+extension_object_ids['TransferResult'] = nid
+nid = FourByteNodeId(ObjectIds.TransferSubscriptionsRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = TransferSubscriptionsRequest
+extension_object_ids['TransferSubscriptionsRequest'] = nid
+nid = FourByteNodeId(ObjectIds.TransferSubscriptionsResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = TransferSubscriptionsResponse
+extension_object_ids['TransferSubscriptionsResponse'] = nid
+nid = FourByteNodeId(ObjectIds.DeleteSubscriptionsRequest_Encoding_DefaultBinary)
+extension_object_classes[nid] = DeleteSubscriptionsRequest
+extension_object_ids['DeleteSubscriptionsRequest'] = nid
+nid = FourByteNodeId(ObjectIds.DeleteSubscriptionsResponse_Encoding_DefaultBinary)
+extension_object_classes[nid] = DeleteSubscriptionsResponse
+extension_object_ids['DeleteSubscriptionsResponse'] = nid
+nid = FourByteNodeId(ObjectIds.BuildInfo_Encoding_DefaultBinary)
+extension_object_classes[nid] = BuildInfo
+extension_object_ids['BuildInfo'] = nid
+nid = FourByteNodeId(ObjectIds.RedundantServerDataType_Encoding_DefaultBinary)
+extension_object_classes[nid] = RedundantServerDataType
+extension_object_ids['RedundantServerDataType'] = nid
+nid = FourByteNodeId(ObjectIds.EndpointUrlListDataType_Encoding_DefaultBinary)
+extension_object_classes[nid] = EndpointUrlListDataType
+extension_object_ids['EndpointUrlListDataType'] = nid
+nid = FourByteNodeId(ObjectIds.NetworkGroupDataType_Encoding_DefaultBinary)
+extension_object_classes[nid] = NetworkGroupDataType
+extension_object_ids['NetworkGroupDataType'] = nid
+nid = FourByteNodeId(ObjectIds.SamplingIntervalDiagnosticsDataType_Encoding_DefaultBinary)
+extension_object_classes[nid] = SamplingIntervalDiagnosticsDataType
+extension_object_ids['SamplingIntervalDiagnosticsDataType'] = nid
+nid = FourByteNodeId(ObjectIds.ServerDiagnosticsSummaryDataType_Encoding_DefaultBinary)
+extension_object_classes[nid] = ServerDiagnosticsSummaryDataType
+extension_object_ids['ServerDiagnosticsSummaryDataType'] = nid
+nid = FourByteNodeId(ObjectIds.ServerStatusDataType_Encoding_DefaultBinary)
+extension_object_classes[nid] = ServerStatusDataType
+extension_object_ids['ServerStatusDataType'] = nid
+nid = FourByteNodeId(ObjectIds.SessionDiagnosticsDataType_Encoding_DefaultBinary)
+extension_object_classes[nid] = SessionDiagnosticsDataType
+extension_object_ids['SessionDiagnosticsDataType'] = nid
+nid = FourByteNodeId(ObjectIds.SessionSecurityDiagnosticsDataType_Encoding_DefaultBinary)
+extension_object_classes[nid] = SessionSecurityDiagnosticsDataType
+extension_object_ids['SessionSecurityDiagnosticsDataType'] = nid
+nid = FourByteNodeId(ObjectIds.ServiceCounterDataType_Encoding_DefaultBinary)
+extension_object_classes[nid] = ServiceCounterDataType
+extension_object_ids['ServiceCounterDataType'] = nid
+nid = FourByteNodeId(ObjectIds.StatusResult_Encoding_DefaultBinary)
+extension_object_classes[nid] = StatusResult
+extension_object_ids['StatusResult'] = nid
+nid = FourByteNodeId(ObjectIds.SubscriptionDiagnosticsDataType_Encoding_DefaultBinary)
+extension_object_classes[nid] = SubscriptionDiagnosticsDataType
+extension_object_ids['SubscriptionDiagnosticsDataType'] = nid
+nid = FourByteNodeId(ObjectIds.ModelChangeStructureDataType_Encoding_DefaultBinary)
+extension_object_classes[nid] = ModelChangeStructureDataType
+extension_object_ids['ModelChangeStructureDataType'] = nid
+nid = FourByteNodeId(ObjectIds.SemanticChangeStructureDataType_Encoding_DefaultBinary)
+extension_object_classes[nid] = SemanticChangeStructureDataType
+extension_object_ids['SemanticChangeStructureDataType'] = nid
+nid = FourByteNodeId(ObjectIds.Range_Encoding_DefaultBinary)
+extension_object_classes[nid] = Range
+extension_object_ids['Range'] = nid
+nid = FourByteNodeId(ObjectIds.EUInformation_Encoding_DefaultBinary)
+extension_object_classes[nid] = EUInformation
+extension_object_ids['EUInformation'] = nid
+nid = FourByteNodeId(ObjectIds.ComplexNumberType_Encoding_DefaultBinary)
+extension_object_classes[nid] = ComplexNumberType
+extension_object_ids['ComplexNumberType'] = nid
+nid = FourByteNodeId(ObjectIds.DoubleComplexNumberType_Encoding_DefaultBinary)
+extension_object_classes[nid] = DoubleComplexNumberType
+extension_object_ids['DoubleComplexNumberType'] = nid
+nid = FourByteNodeId(ObjectIds.AxisInformation_Encoding_DefaultBinary)
+extension_object_classes[nid] = AxisInformation
+extension_object_ids['AxisInformation'] = nid
+nid = FourByteNodeId(ObjectIds.XVType_Encoding_DefaultBinary)
+extension_object_classes[nid] = XVType
+extension_object_ids['XVType'] = nid
+nid = FourByteNodeId(ObjectIds.ProgramDiagnosticDataType_Encoding_DefaultBinary)
+extension_object_classes[nid] = ProgramDiagnosticDataType
+extension_object_ids['ProgramDiagnosticDataType'] = nid
+nid = FourByteNodeId(ObjectIds.Annotation_Encoding_DefaultBinary)
+extension_object_classes[nid] = Annotation
+extension_object_ids['Annotation'] = nid
diff --git a/opcua/ua/uatypes.py b/opcua/ua/uatypes.py
index f055c22f7..9f0578857 100644
--- a/opcua/ua/uatypes.py
+++ b/opcua/ua/uatypes.py
@@ -1,8 +1,10 @@
"""
implement ua datatypes
"""
+
+import logging
import struct
-from enum import Enum, IntEnum, EnumMeta
+from enum import Enum, IntEnum
from datetime import datetime
import sys
import os
@@ -16,6 +18,10 @@
from opcua.ua.uaerrors import UaError
from opcua.ua.uaerrors import UaStatusCodeError
from opcua.ua.uaerrors import UaStringParsingError
+from opcua.common.utils import Buffer
+
+
+logger = logging.getLogger(__name__)
if sys.version_info.major > 2:
@@ -609,6 +615,12 @@ class ExtensionObject(FrozenClass):
:vartype Body: bytes
"""
+ ua_types = {
+ "TypeId": "NodeId",
+ "Encoding": "Byte",
+ "Body": "ByteString"
+ }
+
def __init__(self):
self.TypeId = NodeId()
self.Encoding = 0
@@ -618,7 +630,7 @@ def __init__(self):
def to_binary(self):
packet = []
if self.Body:
- self.Encoding |= (1 << 0)
+ self.Encoding = 0x01
packet.append(self.TypeId.to_binary())
packet.append(uabin.Primitives.UInt8.pack(self.Encoding))
if self.Body:
@@ -911,12 +923,12 @@ class XmlElement(FrozenClass):
An XML element encoded as an UTF-8 string.
"""
- def __init__(self, binary=None):
+ def __init__(self, value=None, binary=None):
if binary is not None:
self._binary_init(binary)
self._freeze = True
return
- self.Value = []
+ self.Value = value
self._freeze = True
def to_binary(self):
@@ -924,7 +936,7 @@ def to_binary(self):
@staticmethod
def from_binary(data):
- return XmlElement(data)
+ return XmlElement(binary=data)
def _binary_init(self, data):
self.Value = uabin.Primitives.String.unpack(data)
@@ -1063,7 +1075,9 @@ def get_default_value(vtype):
return None
elif vtype == VariantType.Boolean:
return False
- elif vtype in (VariantType.SByte, VariantType.Byte, VariantType.ByteString):
+ elif vtype in (VariantType.SByte, VariantType.Byte):
+ return 0
+ elif vtype == VariantType.ByteString:
return b""
elif 4 <= vtype.value <= 9:
return 0
@@ -1097,3 +1111,70 @@ def get_default_value(vtype):
raise RuntimeError("function take a uatype as argument, got:", vtype)
+# These dictionnaries are used to register extensions classes for automatic
+# decoding and encoding
+extension_object_classes = {}
+extension_object_ids = {}
+
+
+def register_extension_object(name, nodeid, class_type):
+ """
+ """
+ logger.warning("registring new extension object: %s %s %s", name, nodeid, class_type)
+ extension_object_classes[nodeid] = class_type
+ extension_object_ids[name] = nodeid
+
+
+def extensionobject_from_binary(data):
+ """
+ Convert binary-coded ExtensionObject to a Python object.
+ Returns an object, or None if TypeId is zero
+ """
+ typeid = NodeId.from_binary(data)
+ Encoding = ord(data.read(1))
+ body = None
+ if Encoding & (1 << 0):
+ length = uabin.Primitives.Int32.unpack(data)
+ if length < 1:
+ body = Buffer(b"")
+ else:
+ body = data.copy(length)
+ data.skip(length)
+ if typeid.Identifier == 0:
+ return None
+ elif typeid in extension_object_classes:
+ klass = extension_object_classes[typeid]
+ if body is None:
+ raise UaError("parsing ExtensionObject {0} without data".format(klass.__name__))
+ return klass.from_binary(body)
+ else:
+ e = ExtensionObject()
+ e.TypeId = typeid
+ e.Encoding = Encoding
+ if body is not None:
+ e.Body = body.read(len(body))
+ return e
+
+
+def extensionobject_to_binary(obj):
+ """
+ Convert Python object to binary-coded ExtensionObject.
+ If obj is None, convert to empty ExtensionObject (TypeId = 0, no Body).
+ Returns a binary string
+ """
+ if isinstance(obj, ExtensionObject):
+ return obj.to_binary()
+ if obj is None:
+ TypeId = NodeId()
+ Encoding = 0
+ Body = None
+ else:
+ TypeId = extension_object_ids[obj.__class__.__name__]
+ Encoding = 0x01
+ Body = obj.to_binary()
+ packet = []
+ packet.append(TypeId.to_binary())
+ packet.append(uabin.Primitives.UInt8.pack(Encoding))
+ if Body:
+ packet.append(uabin.Primitives.Bytes.pack(Body))
+ return b''.join(packet)
diff --git a/schemas/generate_protocol_python.py b/schemas/generate_protocol_python.py
index 367ada199..b6884bfca 100644
--- a/schemas/generate_protocol_python.py
+++ b/schemas/generate_protocol_python.py
@@ -54,19 +54,15 @@ def run(self):
self.iidx = 0
self.write("")
self.write("")
- self.write("ExtensionClasses = {")
for struct in self.model.structs:
if struct.name in IgnoredStructs:
continue
if struct.name.endswith("Node") or struct.name.endswith("NodeId"):
continue
if "ExtensionObject" in struct.parents:
- self.write(" ObjectIds.{0}_Encoding_DefaultBinary: {0},".format(struct.name))
- self.write("}")
- self.write("")
- with open('uaprotocol_auto_add.py') as f:
- for line in f:
- self.write(line.rstrip())
+ self.write("nid = FourByteNodeId(ObjectIds.{0}_Encoding_DefaultBinary)".format(struct.name))
+ self.write("extension_object_classes[nid] = {0}".format(struct.name))
+ self.write("extension_object_ids['{0}'] = nid".format(struct.name))
def write(self, line):
if line:
@@ -79,10 +75,9 @@ def make_header(self):
self.write("'''")
self.write("")
self.write("from datetime import datetime")
- self.write("from enum import Enum, IntEnum")
+ self.write("from enum import IntEnum")
self.write("")
- self.write("from opcua.common.utils import Buffer")
- self.write("from opcua.ua.uaerrors import UaError")
+ #self.write("from opcua.ua.uaerrors import UaError")
self.write("from opcua.ua.uatypes import *")
self.write("from opcua.ua import ua_binary as uabin")
self.write("from opcua.ua.object_ids import ObjectIds")
diff --git a/setup.py b/setup.py
index 818b7b221..13fea441e 100644
--- a/setup.py
+++ b/setup.py
@@ -2,10 +2,9 @@
import sys
+install_requires = ["python-dateutil", "pytz", "lxml"]
if sys.version_info[0] < 3:
- install_requires = ["python-dateutil", "enum34", "trollius", "futures", "pytz"]
-else:
- install_requires = ["python-dateutil", "pytz"]
+ install_requires.extend(["enum34", "trollius", "futures"])
setup(name="freeopcua",
version="0.90.2",
diff --git a/tests/example.bsd b/tests/example.bsd
new file mode 100644
index 000000000..bb7b325a0
--- /dev/null
+++ b/tests/example.bsd
@@ -0,0 +1,237 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/tests_unit.py b/tests/tests_unit.py
index 7247c3889..beded9691 100755
--- a/tests/tests_unit.py
+++ b/tests/tests_unit.py
@@ -16,6 +16,7 @@
from opcua.common.ua_utils import string_to_variant, variant_to_string, string_to_val, val_to_string
from opcua.common.xmlimporter import XmlImporter
from opcua.ua.uatypes import _MaskEnum
+from opcua.common.structures_generator import StructGenerator
class TestUnit(unittest.TestCase):
@@ -37,6 +38,111 @@ def test_variant_array_none(self):
self.assertEqual(v, v2)
self.assertTrue(v2.is_array)
+ def test_structs_save_and_import(self):
+ xmlpath = "tests/example.bsd"
+ c = StructGenerator()
+ c.make_model_from_file(xmlpath)
+ struct_dict = c.save_and_import("structures.py")
+ for k, v in struct_dict.items():
+ a = v()
+ self.assertEqual(k, a.__class__.__name__)
+
+ def test_custom_structs(self):
+ xmlpath = "tests/example.bsd"
+ c = StructGenerator()
+ c.make_model_from_file(xmlpath)
+ c.save_to_file("structures.py")
+ import structures as s
+
+ # test with default values
+ v = s.ScalarValueDataType()
+ data = v.to_binary()
+ v2 = s.ScalarValueDataType.from_binary(ua.utils.Buffer(data))
+
+
+ # set some values
+ v = s.ScalarValueDataType()
+ v.SbyteValue = 1
+ v.ByteValue = 2
+ v.Int16Value = 3
+ v.UInt16Value = 4
+ v.Int32Value = 5
+ v.UInt32Value = 6
+ v.Int64Value = 7
+ v.UInt64Value = 8
+ v.FloatValue = 9.0
+ v.DoubleValue = 10.0
+ v.StringValue = "elleven"
+ v.DateTimeValue = datetime.utcnow()
+ #self.GuidValue = uuid.uudib"14"
+ v.ByteStringValue = b"fifteen"
+ v.XmlElementValue = ua.XmlElement("titi")
+ v.NodeIdValue = ua.NodeId.from_string("ns=4;i=9999")
+ #self.ExpandedNodeIdValue =
+ #self.QualifiedNameValue =
+ #self.LocalizedTextValue =
+ #self.StatusCodeValue =
+ #self.VariantValue =
+ #self.EnumerationValue =
+ #self.StructureValue =
+ #self.Number =
+ #self.Integer =
+ #self.UInteger =
+
+
+ data = v.to_binary()
+ v2 = s.ScalarValueDataType.from_binary(ua.utils.Buffer(data))
+ self.assertEqual(v.NodeIdValue, v2.NodeIdValue)
+
+ def test_custom_structs_array(self):
+ xmlpath = "tests/example.bsd"
+ c = StructGenerator()
+ c.make_model_from_file(xmlpath)
+ c.save_to_file("structures.py")
+ import structures as s
+
+ # test with default values
+ v = s.ArrayValueDataType()
+ data = v.to_binary()
+ v2 = s.ArrayValueDataType.from_binary(ua.utils.Buffer(data))
+
+
+ # set some values
+ v = s.ArrayValueDataType()
+ v.SbyteValue = [1]
+ v.ByteValue = [2]
+ v.Int16Value = [3]
+ v.UInt16Value = [4]
+ v.Int32Value = [5]
+ v.UInt32Value = [6]
+ v.Int64Value = [7]
+ v.UInt64Value = [8]
+ v.FloatValue = [9.0]
+ v.DoubleValue = [10.0]
+ v.StringValue = ["elleven"]
+ v.DateTimeValue = [datetime.utcnow()]
+ #self.GuidValue = uuid.uudib"14"
+ v.ByteStringValue = [b"fifteen", b"sixteen"]
+ v.XmlElementValue = [ua.XmlElement("titi")]
+ v.NodeIdValue = [ua.NodeId.from_string("ns=4;i=9999"), ua.NodeId.from_string("i=6")]
+ #self.ExpandedNodeIdValue =
+ #self.QualifiedNameValue =
+ #self.LocalizedTextValue =
+ #self.StatusCodeValue =
+ #self.VariantValue =
+ #self.EnumerationValue =
+ #self.StructureValue =
+ #self.Number =
+ #self.Integer =
+ #self.UInteger =
+
+
+ data = v.to_binary()
+ v2 = s.ArrayValueDataType.from_binary(ua.utils.Buffer(data))
+ self.assertEqual(v.NodeIdValue, v2.NodeIdValue)
+ print(v2.NodeIdValue)
+
+
def test_nodeid_ordering(self):
a = ua.NodeId(2000, 1)
b = ua.NodeId(3000, 1)