MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / header_from_binary

Function header_from_binary

opcua/ua/ua_binary.py:522–529  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

520
521
522def header_from_binary(data):
523 hdr = ua.Header()
524 hdr.MessageType, hdr.ChunkType, hdr.packet_size = struct.unpack("<3scI", data.read(8))
525 hdr.body_size = hdr.packet_size - 8
526 if hdr.MessageType in (ua.MessageType.SecureOpen, ua.MessageType.SecureClose, ua.MessageType.SecureMessage):
527 hdr.body_size -= 4
528 hdr.ChannelId = Primitives.UInt32.unpack(data)
529 return hdr
530
531
532def uatcp_to_binary(message_type, message):

Callers 2

from_binaryMethod · 0.90
receive_from_socketMethod · 0.90

Calls 2

unpackMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected