This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new d26aafba91 feat: Added some code to make the breaking change of using 
PlcRawByteArray less invasive.
d26aafba91 is described below

commit d26aafba91ad62dbca7f4abe5fe0d9ab2432e7f7
Author: Christofer Dutz <[email protected]>
AuthorDate: Tue Aug 19 15:00:55 2025 +0200

    feat: Added some code to make the breaking change of using PlcRawByteArray 
less invasive.
---
 .../apache/plc4x/java/spi/values/PlcRawByteArray.java  | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git 
a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcRawByteArray.java 
b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcRawByteArray.java
index 9cf8fd096d..abddce9287 100644
--- 
a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcRawByteArray.java
+++ 
b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcRawByteArray.java
@@ -20,9 +20,13 @@ package org.apache.plc4x.java.spi.values;
 
 import org.apache.commons.codec.binary.Hex;
 import org.apache.plc4x.java.api.types.PlcValueType;
+import org.apache.plc4x.java.api.value.PlcValue;
 import org.apache.plc4x.java.spi.generation.SerializationException;
 import org.apache.plc4x.java.spi.generation.WriteBuffer;
 
+import java.util.ArrayList;
+import java.util.List;
+
 public class PlcRawByteArray extends PlcIECValue<byte[]> {
 
     public static PlcRawByteArray of(Object value) {
@@ -59,4 +63,18 @@ public class PlcRawByteArray extends PlcIECValue<byte[]> {
         writeBuffer.writeByteArray(getClass().getSimpleName(), value);
     }
 
+    @Override
+    public boolean isList() {
+        return true;
+    }
+
+    @Override
+    public List<PlcValue> getList() {
+        List<PlcValue> shortList = new ArrayList<>(value.length);
+        for (byte b : value) {
+            shortList.add(new PlcSINT((short) (b & 0xFF)));
+        }
+        return shortList;
+    }
+
 }

Reply via email to