From da371578695057ef83352a732cb5b1879bd66ee6 Mon Sep 17 00:00:00 2001 From: OhneFleisKeinReis <117668342+OhneFleisKeinReis@users.noreply.github.com> Date: Tue, 6 Jun 2023 11:39:58 +0200 Subject: [PATCH] use ushort conversion for connectionsize --- EEIP.NET/EIPClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EEIP.NET/EIPClient.cs b/EEIP.NET/EIPClient.cs index cd8962c..fed0e37 100644 --- a/EEIP.NET/EIPClient.cs +++ b/EEIP.NET/EIPClient.cs @@ -435,7 +435,7 @@ public void ForwardOpen(bool largeForwardOpen) connectionType = (byte)T_O_ConnectionType; //1=Multicast, 2=P2P priority = (byte)T_O_Priority; variableLength = T_O_VariableLength; - connectionSize = (byte)(T_O_Length + t_o_headerOffset); + connectionSize = (ushort)(T_O_Length + t_o_headerOffset); NetworkConnectionParameters = (UInt16)((UInt16)(connectionSize & 0x1FF) | ((Convert.ToUInt16(variableLength)) << 9) | ((priority & 0x03) << 10) | ((connectionType & 0x03) << 13) | ((Convert.ToUInt16(redundantOwner)) << 15)); if (largeForwardOpen) NetworkConnectionParameters = (UInt32)((uint)(connectionSize & 0xFFFF) | ((Convert.ToUInt32(variableLength)) << 25) | (uint)((priority & 0x03) << 26) | (uint)((connectionType & 0x03) << 29) | ((Convert.ToUInt32(redundantOwner)) << 31));