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 |   28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/HDL_ON/DAL/DriverLayer/Control_Udp.cs b/HDL_ON/DAL/DriverLayer/Control_Udp.cs
index c916cce..fd41020 100644
--- a/HDL_ON/DAL/DriverLayer/Control_Udp.cs
+++ b/HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -196,7 +196,7 @@
                                 case FunctionAttributeKey.FanSpeed:
                                     tempAc.trait_fan.curValue = attr.value;
                                     break;
-                                case FunctionAttributeKey.Temp:
+                                case FunctionAttributeKey.SetTemp:
                                     tempAc.trait_temp.curValue = attr.value;
                                     switch (tempAc.curModeIndex)
                                     {
@@ -261,7 +261,7 @@
                                 case FunctionAttributeKey.OnOff:
                                     tempFh.trait_on_off.curValue = attr.value;
                                     break;
-                                case FunctionAttributeKey.Temp:
+                                case FunctionAttributeKey.SetTemp:
                                     tempFh.trait_temp.curValue = attr.value;
                                     break;
                                 case FunctionAttributeKey.Mode:
@@ -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;
@@ -787,6 +787,10 @@
 
         }
 
+        //private void signAlinkPacket()
+        //{
+        //}
+
         /// <summary>
         /// 鍙戦�佹暟鎹�
         /// </summary>
@@ -841,19 +845,23 @@
             }
         }
         /// <summary>
-        /// 鏈湴udp鎺у埗A鍗忚缃戝叧
+        /// 鍙戦�乽dp A鍗忚鏁版嵁
         /// </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