From dcf60777c9346ff058f06298d03173f0c53d1902 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 16 十二月 2020 20:42:15 +0800
Subject: [PATCH] 20201216-4

---
 HDL_ON/DAL/DriverLayer/Control_Udp.cs |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/HDL_ON/DAL/DriverLayer/Control_Udp.cs b/HDL_ON/DAL/DriverLayer/Control_Udp.cs
index e4e770b..fd41020 100644
--- a/HDL_ON/DAL/DriverLayer/Control_Udp.cs
+++ b/HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -331,8 +331,8 @@
                                 var bytes = new byte[] { function.bus_Data.loopId,
                                             b,
                                             254, 0,Convert.ToByte(light.fadeTime) ,3,
-                                            (byte)light.redColor,(byte)light.greenColor,
-                                            (byte)light.blueColor,
+                                            (byte)light.RedColor,(byte)light.GreenColor,
+                                            (byte)light.BlueColor,
                                             0,0};
                                 ControlBytesSend(Command.SetLogicLoopColor, subnetId, deviceId, bytes, 1);
                                 break;
@@ -714,7 +714,7 @@
 
             try
             {
-                //MainPage.Log("鍙戦�佹暟鎹�:" + SendFlag);
+                MainPage.Log("鍙戦�佹暟鎹�:" + SendFlag);
                 UdpSocket._BusSocket.AsyncBeginSend(Packet);
                 Packet.HaveSendCount--;
 
@@ -787,6 +787,10 @@
 
         }
 
+        //private void signAlinkPacket()
+        //{
+        //}
+
         /// <summary>
         /// 鍙戦�佹暟鎹�
         /// </summary>
@@ -845,15 +849,19 @@
         /// </summary>
         public void SendLocalHdlLinkData(byte[] sendBytes)
         {
+            if (controlLostCount > 3)
+            {
+                UdpSocket._BusSocket.Stop();
+                UdpSocket._BusSocket.Start(8585);
+                controlLostCount = 0;
+            }
             Packet = new Packet(sendBytes, new System.Net.IPEndPoint(System.Net.IPAddress.Parse(Control.Ins.reportIp), 8585));
-            Packet.HaveSendCount = 4;//ps锛氭病鏈夐噸鍙戯紝鍚庢湡鏈夋椂闂村彲浠ュ鍔犻噸鍙戝垽鏂�
+            Packet.HaveSendCount = 2;//ps锛氭病鏈夐噸鍙戯紝鍚庢湡鏈夋椂闂村彲浠ュ鍔犻噸鍙戝垽鏂�
+            
             System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(managerSendCount));
             thread.IsBackground = true;
             thread.Start(Packet);
-            //wait();涓嶉渶瑕佺瓑寰�
-            //MainPage.Log($"鍙戦�丠dl-Link鏁版嵁锛孖P:{Control.Ins.reportIp}:8585");
+            controlLostCount++;
         }
-
-
     }
 }

--
Gitblit v1.8.0