From ea0628889f64f802768c4fdf17d2223424e5e29f Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期三, 30 十月 2024 11:13:22 +0800
Subject: [PATCH] 1

---
 WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/DeviceBase/DeviceCommand.cs |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/DeviceBase/DeviceCommand.cs b/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/DeviceBase/DeviceCommand.cs
index 2b7c4b7..adf69f5 100644
--- a/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/DeviceBase/DeviceCommand.cs
+++ b/WIDESEAWCS_Server/WIDESEAWCS_QuartzJob/DeviceBase/DeviceCommand.cs
@@ -26,6 +26,9 @@
 
 namespace WIDESEAWCS_QuartzJob.DeviceBase
 {
+    /// <summary>
+    /// 瑗块棬瀛�
+    /// </summary>
     public class DeviceCommand : IDataTransfer
     {
         #region <Const>
@@ -55,7 +58,7 @@
                     case TypeCode.Byte:
                     case TypeCode.SByte:
                     case TypeCode.Char:
-                        readCount += 1;
+                        readCount += sizeof(byte);
                         break;
                     case TypeCode.Int16:
                     case TypeCode.UInt16:
@@ -224,7 +227,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