From 5428935270159bfc42c2934ed7fb1091554fc9a4 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 09 七月 2020 17:12:42 +0800
Subject: [PATCH] 修改了 sokect

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs |   23 +++++++----------------
 1 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs
index 2ea4709..d1eddb8 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDevicePanelLogic.cs
@@ -810,16 +810,9 @@
         /// </summary>
         /// <param name="panel">骞叉帴鐐瑰璞�</param>
         /// <returns></returns>
-        public async Task<List<CommonDevice.AttributeDataObj>> GetDryContactConfigureInfo(CommonDevice device)
+        public List<CommonDevice.AttributeDataObj> GetDryContactConfigureInfo(CommonDevice device)
         {
-            //鍊熺敤瀹冪殑鍑芥暟
-            var panel = new Panel();
-            panel.DeviceAddr = device.DeviceAddr;
-            panel.DeviceEpoint = device.DeviceEpoint;
-            panel.CurrentGateWayId = device.CurrentGateWayId;
-
-            var result = HdlDeviceBindLogic.Current.ReadPanelConfigureInfoAsync(panel);
-            panel = null;
+            var result = HdlDeviceBindLogic.Current.ReadPanelConfigureInfoAsync(device);
 
             //鍏遍�氶敊璇娴�
             string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
@@ -1256,10 +1249,7 @@
         /// </summary>
         private void SaveDryContactFunctionToLocaltion()
         {
-            var file = Newtonsoft.Json.JsonConvert.SerializeObject(dicDryContactFunction);
-
-            var bytes = System.Text.Encoding.UTF8.GetBytes(file);
-            Common.Global.WriteFileByBytesByHomeId(DirNameResourse.DryContactFunctionFile, bytes);
+            HdlFileLogic.Current.SaveFileContent(DirNameResourse.DryContactFunctionFile, dicDryContactFunction);
         }
 
         /// <summary>
@@ -1267,12 +1257,13 @@
         /// </summary>
         private void LoadDryContactFunctionFromLocaltion()
         {
-            if (Common.Global.IsExistsByHomeId(DirNameResourse.DryContactFunctionFile) == false)
+            this.dicDryContactFunction = new Dictionary<string, DryContactFunctionInfo>();
+
+            byte[] filebyte = HdlFileLogic.Current.ReadFileByteContent(DirNameResourse.DryContactFunctionFile);
+            if (filebyte == null)
             {
                 return;
             }
-
-            byte[] filebyte = Common.Global.ReadFileByHomeId(DirNameResourse.DryContactFunctionFile);
             string strvalue = System.Text.Encoding.UTF8.GetString(filebyte);
             this.dicDryContactFunction = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, DryContactFunctionInfo>>(strvalue);
         }

--
Gitblit v1.8.0