From 7a835554eac55bf0e672fe36f575c6a759b4785c Mon Sep 17 00:00:00 2001 From: gisellevonbingen Date: Tue, 25 Jul 2023 21:02:15 +0900 Subject: [PATCH] Fix EPathSegmentData send wrong payload length --- Giselle.Net.EtherNetIP/CIP/EPathSegmentData.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Giselle.Net.EtherNetIP/CIP/EPathSegmentData.cs b/Giselle.Net.EtherNetIP/CIP/EPathSegmentData.cs index 9d07508..ed90b08 100644 --- a/Giselle.Net.EtherNetIP/CIP/EPathSegmentData.cs +++ b/Giselle.Net.EtherNetIP/CIP/EPathSegmentData.cs @@ -49,7 +49,7 @@ public void ReadValue(byte readingType, DataProcessor processor) public void WriteValue(DataProcessor processor) { var payload = this.Payload; - processor.WriteByte((byte)payload.Length); + processor.WriteByte((byte)((payload.Length + 1) / 2)); // +1 for pad processor.WriteBytes(payload); // Pad to words