From d1af1b8337591363e60c286348501a841138dbb3 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期四, 24 十二月 2020 16:00:09 +0800
Subject: [PATCH] 20201224-3

---
 HDL_ON/DAL/DriverLayer/Control_Udp.cs |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/HDL_ON/DAL/DriverLayer/Control_Udp.cs b/HDL_ON/DAL/DriverLayer/Control_Udp.cs
index f678509..d3e11b0 100644
--- a/HDL_ON/DAL/DriverLayer/Control_Udp.cs
+++ b/HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -158,6 +158,10 @@
         {
             foreach (var f in scene.functions)
             {
+                if(f.localFunction == null)
+                {
+                    continue;
+                }
                 switch (f.localFunction.functionType)
                 {
                     case FunctionType.Curtain:
@@ -249,7 +253,7 @@
                             }
                         }
                         ControlBytesSend(Command.SetSingleLight, f.localFunction.bus.SubnetID, f.localFunction.bus.DeviceID,
-                            new byte[] { f.localFunction.bus.LoopId, brightness });
+                            new byte[] { f.localFunction.bus.LoopId, brightness, (byte)(f.localFunction.delay / 255), (byte)(f.localFunction.delay % 255) });
                         break;
                     case FunctionType.RGB:
                         break;
@@ -728,7 +732,7 @@
                         UdpSocket._BusSocket.AsyncBeginSend(packet);
                         controlLostCount++;
                     }
-                    System.Threading.Thread.Sleep(100);
+                    System.Threading.Thread.Sleep(300);
                 }
             }
             catch (Exception ex)
@@ -861,7 +865,7 @@
             {
                 wait(); 
             }
-            //MainPage.Log($"鍙戦�丠dl-Link鏁版嵁锛孖P:{Control.Ins.reportIp}:8585");
+            MainPage.Log($"鍙戦�丠dl-Link鏁版嵁锛孖P:{Control.Ins.reportIp}:8585");
         }
     }
 

--
Gitblit v1.8.0