From 5b2267c6780d6a73e4daaffe77611a86f5ffe76f Mon Sep 17 00:00:00 2001
From: Martin Teichmann <martin.teichmann@xfel.eu>
Date: Tue, 9 Apr 2024 16:10:00 +0000
Subject: [PATCH] treat EtherCAT enums as UINT8 where possible

---
 ebpfcat/ethercat.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ebpfcat/ethercat.py b/ebpfcat/ethercat.py
index dfc0b4a..94304f9 100644
--- a/ebpfcat/ethercat.py
+++ b/ebpfcat/ethercat.py
@@ -966,8 +966,11 @@ class Terminal:
         oe.valueInfo, dataType, oe.bitLength, oe.objectAccess = \
             unpack_from("<BxHHH", data)
         assert subidx == oe.valueInfo
+        oe.dataTypeOriginal = dataType
         if dataType < 2048:
             oe.dataType = ECDataType(dataType)
+        elif oe.bitLength == 8:
+            oe.dataType = ECDataType.UNSIGNED8
         else:
             oe.dataType = dataType
         oe.name = data[8:].decode("utf8")
-- 
GitLab