From e238b9cc3caef879fd907ceab8997d08ae891ea3 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期四, 04 十一月 2021 09:22:08 +0800
Subject: [PATCH] BUG修复
---
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