From 0d07b90fd906e52ce486484aa53a6850983b1325 Mon Sep 17 00:00:00 2001 From: hutongqing <hutongqing@hnkhzn.com> Date: 星期二, 15 十月 2024 14:21:57 +0800 Subject: [PATCH] 更新 --- WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/DeviceBase/DeviceCommand.cs | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/DeviceBase/DeviceCommand.cs b/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/DeviceBase/DeviceCommand.cs index 2b7c4b7..5cb4938 100644 --- a/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/DeviceBase/DeviceCommand.cs +++ b/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/DeviceBase/DeviceCommand.cs @@ -55,7 +55,7 @@ case TypeCode.Byte: case TypeCode.SByte: case TypeCode.Char: - readCount += 1; + readCount += sizeof(byte); break; case TypeCode.Int16: case TypeCode.UInt16: @@ -224,7 +224,7 @@ bytes.Add(Convert.ToByte(dataLength)); bytes.Add(Convert.ToByte(obj.ToString().Length)); bytes.AddRange(bytesString); - for (int i = 0; i < dataLength - obj.ToString().Length; i++) + for (int i = 0; i < dataLength - obj.ToString().Length - 2; i++) { bytes.Add(0); } -- Gitblit v1.9.3