From 6f89acbf74c6838db518a9f2b6c83f0ab0d97e7f Mon Sep 17 00:00:00 2001
From: 杨张扬 <634643841@qq.com>
Date: 星期二, 29 七月 2025 18:13:31 +0800
Subject: [PATCH] 余料回库流程增加绑定和解绑,RFID校验必须校验开头

---
 device/TcpServer.cs |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/device/TcpServer.cs b/device/TcpServer.cs
index 1b17450..d6537f0 100644
--- a/device/TcpServer.cs
+++ b/device/TcpServer.cs
@@ -147,13 +147,18 @@
                             saoMa[remote_ip] = 3;//鏈壂鍒扮爜
                         }
 
-                        if (messageBytes.Length >= 21 && isCheck[remote_ip])
+                        if (messageBytes.Length >= 21 
+                            && isCheck[remote_ip] 
+                            && messageBytes[0] == 0xCC 
+                            && messageBytes[1] == 0xFF 
+                            && messageBytes[2] == 0xFF)
                         {
                             byte[] rfid = new byte[12];
                             Array.Copy(messageBytes, 9, rfid, 0, 12);
 
-                            string rfids16 = BitConverter.ToString(rfid);
-                            string rfids = Encoding.ASCII.GetString(rfid);
+                            string rfids16 = BitConverter.ToString(messageBytes);
+                            string rfids = Encoding.ASCII.GetString(rfid);//鎴彇瀛楃涓�+                            
                             LogHelper.Info($"璇诲崱鍣ㄦ牎楠屽搴斿鍣ㄥ彿锛歿rfids}锛屽叾16杩涘埗褰㈠紡锛歿rfids16}");
                             if (ScanCodeHelper.Analysis(remote_ip, rfids))//鏍¢獙RFID
                             {

--
Gitblit v1.9.1