Skip to content
Snippets Groups Projects
Commit 548c35e9 authored by Martin Teichmann's avatar Martin Teichmann
Browse files

treat EtherCAT enums as UINT8 where possible

parent b44c40ca
No related branches found
No related tags found
No related merge requests found
...@@ -966,8 +966,11 @@ class Terminal: ...@@ -966,8 +966,11 @@ class Terminal:
oe.valueInfo, dataType, oe.bitLength, oe.objectAccess = \ oe.valueInfo, dataType, oe.bitLength, oe.objectAccess = \
unpack_from("<BxHHH", data) unpack_from("<BxHHH", data)
assert subidx == oe.valueInfo assert subidx == oe.valueInfo
oe.dataTypeOriginal = dataType
if dataType < 2048: if dataType < 2048:
oe.dataType = ECDataType(dataType) oe.dataType = ECDataType(dataType)
elif oe.bitLength == 8:
oe.dataType = ECDataType.UNSIGNED8
else: else:
oe.dataType = dataType oe.dataType = dataType
oe.name = data[8:].decode("utf8") oe.name = data[8:].decode("utf8")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment