@@ 2260-2312 (lines=53) @@ | ||
2257 | __repr__ = __str__ |
|
2258 | ||
2259 | ||
2260 | class GetEndpointsResponse(FrozenClass): |
|
2261 | ''' |
|
2262 | Gets the endpoints used by the server. |
|
2263 | ||
2264 | :ivar TypeId: |
|
2265 | :vartype TypeId: NodeId |
|
2266 | :ivar ResponseHeader: |
|
2267 | :vartype ResponseHeader: ResponseHeader |
|
2268 | :ivar Endpoints: |
|
2269 | :vartype Endpoints: EndpointDescription |
|
2270 | ''' |
|
2271 | ||
2272 | ua_types = [ |
|
2273 | ||
2274 | ('TypeId', 'NodeId'), |
|
2275 | ('ResponseHeader', 'ResponseHeader'), |
|
2276 | ('Endpoints', 'ListOfEndpointDescription'), |
|
2277 | ] |
|
2278 | ||
2279 | def __init__(self): |
|
2280 | self.TypeId = FourByteNodeId(ObjectIds.GetEndpointsResponse_Encoding_DefaultBinary) |
|
2281 | self.ResponseHeader = ResponseHeader() |
|
2282 | self.Endpoints = [] |
|
2283 | self._freeze = True |
|
2284 | ||
2285 | def to_binary(self): |
|
2286 | packet = [] |
|
2287 | packet.append(self.TypeId.to_binary()) |
|
2288 | packet.append(self.ResponseHeader.to_binary()) |
|
2289 | packet.append(uabin.Primitives.Int32.pack(len(self.Endpoints))) |
|
2290 | for fieldname in self.Endpoints: |
|
2291 | packet.append(fieldname.to_binary()) |
|
2292 | return b''.join(packet) |
|
2293 | ||
2294 | @staticmethod |
|
2295 | def from_binary(data): |
|
2296 | obj = GetEndpointsResponse() |
|
2297 | obj.TypeId = NodeId.from_binary(data) |
|
2298 | obj.ResponseHeader = ResponseHeader.from_binary(data) |
|
2299 | length = uabin.Primitives.Int32.unpack(data) |
|
2300 | array = [] |
|
2301 | if length != -1: |
|
2302 | for _ in range(0, length): |
|
2303 | array.append(EndpointDescription.from_binary(data)) |
|
2304 | obj.Endpoints = array |
|
2305 | return obj |
|
2306 | ||
2307 | def __str__(self): |
|
2308 | return 'GetEndpointsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \ |
|
2309 | 'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \ |
|
2310 | 'Endpoints:' + str(self.Endpoints) + ')' |
|
2311 | ||
2312 | __repr__ = __str__ |
|
2313 | ||
2314 | ||
2315 | class RegisteredServer(FrozenClass): |
|
@@ 1714-1766 (lines=53) @@ | ||
1711 | __repr__ = __str__ |
|
1712 | ||
1713 | ||
1714 | class FindServersResponse(FrozenClass): |
|
1715 | ''' |
|
1716 | Finds the servers known to the discovery server. |
|
1717 | ||
1718 | :ivar TypeId: |
|
1719 | :vartype TypeId: NodeId |
|
1720 | :ivar ResponseHeader: |
|
1721 | :vartype ResponseHeader: ResponseHeader |
|
1722 | :ivar Servers: |
|
1723 | :vartype Servers: ApplicationDescription |
|
1724 | ''' |
|
1725 | ||
1726 | ua_types = [ |
|
1727 | ||
1728 | ('TypeId', 'NodeId'), |
|
1729 | ('ResponseHeader', 'ResponseHeader'), |
|
1730 | ('Servers', 'ListOfApplicationDescription'), |
|
1731 | ] |
|
1732 | ||
1733 | def __init__(self): |
|
1734 | self.TypeId = FourByteNodeId(ObjectIds.FindServersResponse_Encoding_DefaultBinary) |
|
1735 | self.ResponseHeader = ResponseHeader() |
|
1736 | self.Servers = [] |
|
1737 | self._freeze = True |
|
1738 | ||
1739 | def to_binary(self): |
|
1740 | packet = [] |
|
1741 | packet.append(self.TypeId.to_binary()) |
|
1742 | packet.append(self.ResponseHeader.to_binary()) |
|
1743 | packet.append(uabin.Primitives.Int32.pack(len(self.Servers))) |
|
1744 | for fieldname in self.Servers: |
|
1745 | packet.append(fieldname.to_binary()) |
|
1746 | return b''.join(packet) |
|
1747 | ||
1748 | @staticmethod |
|
1749 | def from_binary(data): |
|
1750 | obj = FindServersResponse() |
|
1751 | obj.TypeId = NodeId.from_binary(data) |
|
1752 | obj.ResponseHeader = ResponseHeader.from_binary(data) |
|
1753 | length = uabin.Primitives.Int32.unpack(data) |
|
1754 | array = [] |
|
1755 | if length != -1: |
|
1756 | for _ in range(0, length): |
|
1757 | array.append(ApplicationDescription.from_binary(data)) |
|
1758 | obj.Servers = array |
|
1759 | return obj |
|
1760 | ||
1761 | def __str__(self): |
|
1762 | return 'FindServersResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \ |
|
1763 | 'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \ |
|
1764 | 'Servers:' + str(self.Servers) + ')' |
|
1765 | ||
1766 | __repr__ = __str__ |
|
1767 | ||
1768 | ||
1769 | class ServerOnNetwork(FrozenClass): |
|
@@ 10106-10156 (lines=51) @@ | ||
10103 | __repr__ = __str__ |
|
10104 | ||
10105 | ||
10106 | class CallMethodRequest(FrozenClass): |
|
10107 | ''' |
|
10108 | :ivar ObjectId: |
|
10109 | :vartype ObjectId: NodeId |
|
10110 | :ivar MethodId: |
|
10111 | :vartype MethodId: NodeId |
|
10112 | :ivar InputArguments: |
|
10113 | :vartype InputArguments: Variant |
|
10114 | ''' |
|
10115 | ||
10116 | ua_types = [ |
|
10117 | ||
10118 | ('ObjectId', 'NodeId'), |
|
10119 | ('MethodId', 'NodeId'), |
|
10120 | ('InputArguments', 'ListOfVariant'), |
|
10121 | ] |
|
10122 | ||
10123 | def __init__(self): |
|
10124 | self.ObjectId = NodeId() |
|
10125 | self.MethodId = NodeId() |
|
10126 | self.InputArguments = [] |
|
10127 | self._freeze = True |
|
10128 | ||
10129 | def to_binary(self): |
|
10130 | packet = [] |
|
10131 | packet.append(self.ObjectId.to_binary()) |
|
10132 | packet.append(self.MethodId.to_binary()) |
|
10133 | packet.append(uabin.Primitives.Int32.pack(len(self.InputArguments))) |
|
10134 | for fieldname in self.InputArguments: |
|
10135 | packet.append(fieldname.to_binary()) |
|
10136 | return b''.join(packet) |
|
10137 | ||
10138 | @staticmethod |
|
10139 | def from_binary(data): |
|
10140 | obj = CallMethodRequest() |
|
10141 | obj.ObjectId = NodeId.from_binary(data) |
|
10142 | obj.MethodId = NodeId.from_binary(data) |
|
10143 | length = uabin.Primitives.Int32.unpack(data) |
|
10144 | array = [] |
|
10145 | if length != -1: |
|
10146 | for _ in range(0, length): |
|
10147 | array.append(Variant.from_binary(data)) |
|
10148 | obj.InputArguments = array |
|
10149 | return obj |
|
10150 | ||
10151 | def __str__(self): |
|
10152 | return 'CallMethodRequest(' + 'ObjectId:' + str(self.ObjectId) + ', ' + \ |
|
10153 | 'MethodId:' + str(self.MethodId) + ', ' + \ |
|
10154 | 'InputArguments:' + str(self.InputArguments) + ')' |
|
10155 | ||
10156 | __repr__ = __str__ |
|
10157 | ||
10158 | ||
10159 | class CallMethodResult(FrozenClass): |
|
@@ 7469-7519 (lines=51) @@ | ||
7466 | __repr__ = __str__ |
|
7467 | ||
7468 | ||
7469 | class QueryDataSet(FrozenClass): |
|
7470 | ''' |
|
7471 | :ivar NodeId: |
|
7472 | :vartype NodeId: ExpandedNodeId |
|
7473 | :ivar TypeDefinitionNode: |
|
7474 | :vartype TypeDefinitionNode: ExpandedNodeId |
|
7475 | :ivar Values: |
|
7476 | :vartype Values: Variant |
|
7477 | ''' |
|
7478 | ||
7479 | ua_types = [ |
|
7480 | ||
7481 | ('NodeId', 'ExpandedNodeId'), |
|
7482 | ('TypeDefinitionNode', 'ExpandedNodeId'), |
|
7483 | ('Values', 'ListOfVariant'), |
|
7484 | ] |
|
7485 | ||
7486 | def __init__(self): |
|
7487 | self.NodeId = ExpandedNodeId() |
|
7488 | self.TypeDefinitionNode = ExpandedNodeId() |
|
7489 | self.Values = [] |
|
7490 | self._freeze = True |
|
7491 | ||
7492 | def to_binary(self): |
|
7493 | packet = [] |
|
7494 | packet.append(self.NodeId.to_binary()) |
|
7495 | packet.append(self.TypeDefinitionNode.to_binary()) |
|
7496 | packet.append(uabin.Primitives.Int32.pack(len(self.Values))) |
|
7497 | for fieldname in self.Values: |
|
7498 | packet.append(fieldname.to_binary()) |
|
7499 | return b''.join(packet) |
|
7500 | ||
7501 | @staticmethod |
|
7502 | def from_binary(data): |
|
7503 | obj = QueryDataSet() |
|
7504 | obj.NodeId = ExpandedNodeId.from_binary(data) |
|
7505 | obj.TypeDefinitionNode = ExpandedNodeId.from_binary(data) |
|
7506 | length = uabin.Primitives.Int32.unpack(data) |
|
7507 | array = [] |
|
7508 | if length != -1: |
|
7509 | for _ in range(0, length): |
|
7510 | array.append(Variant.from_binary(data)) |
|
7511 | obj.Values = array |
|
7512 | return obj |
|
7513 | ||
7514 | def __str__(self): |
|
7515 | return 'QueryDataSet(' + 'NodeId:' + str(self.NodeId) + ', ' + \ |
|
7516 | 'TypeDefinitionNode:' + str(self.TypeDefinitionNode) + ', ' + \ |
|
7517 | 'Values:' + str(self.Values) + ')' |
|
7518 | ||
7519 | __repr__ = __str__ |
|
7520 | ||
7521 | ||
7522 | class NodeReference(FrozenClass): |