From 548c35e9f12f2b0ffa9947451ec714b24dcd6af6 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 30eef3f..ffcfc27 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