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

Function list_to_binary

opcua/ua/ua_binary.py:289–298  ·  view source on GitHub ↗
(uatype, val)

Source from the content-addressed store, hash-verified

287
288
289def list_to_binary(uatype, val):
290 if val is None:
291 return Primitives.Int32.pack(-1)
292 if hasattr(Primitives1, uatype):
293 dataType = getattr(Primitives1, uatype)
294 return dataType.pack_array(val)
295 datasize = Primitives.Int32.pack(len(val))
296 pack = [to_binary(uatype, el) for el in val]
297 pack.insert(0, datasize)
298 return b''.join(pack)
299
300
301def nodeid_to_binary(nodeid):

Callers 2

struct_to_binaryFunction · 0.85
to_binaryFunction · 0.85

Calls 3

to_binaryFunction · 0.85
pack_arrayMethod · 0.80
packMethod · 0.45

Tested by

no test coverage detected