From 1887ea937010ff8caba39622e8246a2802ca02c5 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期一, 21 十二月 2020 19:40:04 +0800
Subject: [PATCH] 20201221-3

---
 HDL_ON/DAL/DriverLayer/Control.cs |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index 3ef6d42..1883b20 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -277,6 +277,13 @@
                             commandDictionary[FunctionAttributeKey.Brightness] = "100";
                         }
                     }
+                    if (commandDictionary[FunctionAttributeKey.OnOff] == "off")
+                    {
+                        if (commandDictionary[FunctionAttributeKey.Brightness] != "0")
+                        {
+                            commandDictionary[FunctionAttributeKey.Brightness] = "0";
+                        }
+                    }
                 }
             }
 
@@ -313,6 +320,7 @@
                     var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(functionControlDataObj);
                     var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlFunctionTopic, functionControlDataJson);
                     new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id);
+                    MainPage.Log($"鍙戦�丠DL-Link鏁版嵁:{functionControlDataJson}");
                 }
             }
         }
@@ -364,6 +372,7 @@
                     };
                     var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(readDataObj);
                     var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ReadStatus, functionControlDataJson);
+                    MainPage.Log($"鍙戦�丠DL-Link鏁版嵁:{functionControlDataJson}");
                     new Control_Udp().SendLocalHdlLinkData(sendBytes, readDataObj.id);
                 }
             }
@@ -424,7 +433,7 @@
 
             string sendDataString = topicString + lengthString + bodyDataString;
             byte[] sendDataBytes = Encoding.ASCII.GetBytes(sendDataString);
-            MainPage.Log($"杞崲HDL-Link鏁版嵁\r\n{sendDataString}\r\n");
+            //MainPage.Log($"杞崲HDL-Link鏁版嵁\r\n{sendDataString}\r\n");
 
             return sendDataBytes;
         }
@@ -464,6 +473,10 @@
                             break;
                     }
                 }
+
+                MainPage.Log($"time 1 :{receiveObj.Topic}");
+
+
                 //楠岃瘉鏈夋晥鏁版嵁闀垮害
                 //if (res[1].Length != receiveObj.Length)
                 //{
@@ -498,6 +511,7 @@
                     }
                 }
                 else if (receiveObj.Topic == CommunicationTopic.ct.ReadStatus + "_reply" ||
+                    receiveObj.Topic == CommunicationTopic.ct.ControlFunctionTopic + "_reply" ||
                     receiveObj.Topic == CommunicationTopic.ct.GatewayUpStatus)
                 {
                     //TODO 鏆傛椂涓嶄紶姝g‘鐨勬暟鎹笂鍘伙紝濡傛灉鍚庨潰瑕佷紭鍖栧墠闈㈣繖浜涗唬鐮�

--
Gitblit v1.8.0