From 4383bfcc87a7726f39391eb78d830aca160d8efd Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期一, 30 九月 2024 10:07:52 +0800
Subject: [PATCH] bug修复

---
 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