Commit ddfff2c1 authored by oroulet's avatar oroulet

Never pack NamespaceUri and ServerIndex for Two and Four bytes nodeid

parent a96f9a83
......@@ -298,9 +298,9 @@ def list_to_binary(uatype, val):
def nodeid_to_binary(nodeid):
data = None
if nodeid.NodeIdType == ua.NodeIdType.TwoByte:
data = struct.pack("<BB", nodeid.NodeIdType.value, nodeid.Identifier)
return struct.pack("<BB", nodeid.NodeIdType.value, nodeid.Identifier)
elif nodeid.NodeIdType == ua.NodeIdType.FourByte:
data = struct.pack("<BBH", nodeid.NodeIdType.value, nodeid.NamespaceIndex, nodeid.Identifier)
return struct.pack("<BBH", nodeid.NodeIdType.value, nodeid.NamespaceIndex, nodeid.Identifier)
elif nodeid.NodeIdType == ua.NodeIdType.Numeric:
data = struct.pack("<BHI", nodeid.NodeIdType.value, nodeid.NamespaceIndex, nodeid.Identifier)
elif nodeid.NodeIdType == ua.NodeIdType.String:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment