From 6d73bf6e816570291865674bef8bce8972e4de3f Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期三, 01 十二月 2021 16:32:57 +0800
Subject: [PATCH] 2021-12-01-01

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

diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index 686064e..be5293d 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -38,6 +38,11 @@
                 return _control;
             }
         }
+        /// <summary>
+        /// 璁板綍鎺ユ敹鍒扮殑娑堟伅锛屾柟渚縵b鐨勫伐绋嬪笀璋冭瘯浠栦滑鐨勮澶�
+        /// </summary>
+        public List<string> MsgInfoList = new List<string>();
+
         int _msg_id = 1;
         /// <summary>
         /// 閫氳ID
@@ -354,7 +359,7 @@
         /// <param name="function"></param>
         /// <param name="useRemote">鏄惁鐩存帴浣跨敤杩滅▼鍙戦��</param>
         /// <returns></returns>
-        public void SendWriteCommand(Function function, Dictionary<string, string> commandDictionary, bool useRemote = false)
+        public void SendWriteCommand(Function function, Dictionary<string, string> commandDictionary, bool useRemote = false,int resend = 3)
         {
             function.controlCounter++;
             function.refreshTime = DateTime.Now;
@@ -451,7 +456,7 @@
                         var functionControlDataObj = function.GetGatewayAlinkControlData(commandDictionary);
                         var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(functionControlDataObj);
                         var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlFunctionTopic, functionControlDataJson);
-                        new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id);
+                        new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id,resend);
                         MainPage.Log($"鏈湴閫氳 鍙戦�丠DL-Link鏁版嵁:{functionControlDataJson}");
                     }
                 }
@@ -699,7 +704,7 @@
                 };
                 var aLinkJson = Newtonsoft.Json.JsonConvert.SerializeObject(aLinkData);
                 var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlScene, aLinkJson);
-                new Control_Udp().SendLocalHdlLinkData(sendBytes, aLinkData.id);
+                new Control_Udp().SendLocalHdlLinkData(sendBytes, aLinkData.id,0);
             }
         }
         /// <summary>
@@ -830,6 +835,10 @@
                             var revString = Encoding.UTF8.GetString(receiveBytes);
                             receiveObj.BodyDataString = revString;
                             MainPage.Log($"灞�鍩熺綉淇℃伅: 瑙e瘑鍚庯細" + receiveObj.BodyDataString);
+                            if(receiveObj.Topic.EndsWith("/thing/property/up"))
+                            {
+                                MsgInfoList.Add(revString + "\r\n");
+                            }
                         }
                         else
                         {

--
Gitblit v1.8.0