From 48ba446936b51fffafa7c3600c0dadc6ac0e8c20 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 10 七月 2020 10:52:13 +0800
Subject: [PATCH] 2020-07-10-01

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceHardInfoLogic.cs |   55 +++++++++++++++++++++++++++++--------------------------
 1 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceHardInfoLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceHardInfoLogic.cs
index 6f2361e..03de7f2 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceHardInfoLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceHardInfoLogic.cs
@@ -14,11 +14,11 @@
 
         /// <summary>
         /// 璁惧纭欢淇℃伅鐨勯�昏緫
-        /// </summary>
-        private static HdlDeviceHardInfoLogic m_Current = null;
+        /// </summary>
+        private static HdlDeviceHardInfoLogic m_Current = null;
         /// <summary>
         /// 璁惧纭欢淇℃伅鐨勯�昏緫
-        /// </summary>
+        /// </summary>
         public static HdlDeviceHardInfoLogic Current
         {
             get
@@ -78,10 +78,10 @@
         /// <param name="device"></param>
         private void SetHardFirmwareInfoToDevice(CommonDevice device)
         {
-            if (HdlDeviceAttributeLogic.Current.IsEsixt("DeviceGetHardFirmwareInfo") == false)
+            if (HdlGatewayReceiveLogic.Current.IsEsixt("DeviceGetHardFirmwareInfo") == false)
             {
                 //娣诲姞浜嬩欢
-                HdlDeviceAttributeLogic.Current.AddAttributeEvent("DeviceGetHardFirmwareInfo", "DeviceStatusReport", this.SetHardFirmwareInfoByInterfaceResult);
+                HdlGatewayReceiveLogic.Current.AddAttributeEvent("DeviceGetHardFirmwareInfo", ReceiveComandDiv.A璁惧灞炴�т笂鎶�, this.SetHardFirmwareInfoByInterfaceResult);
             }
             //鍙戦�佸懡浠�
             this.SetHardFirmwareInfoComand(device);
@@ -98,34 +98,34 @@
         public void SetHardFirmwareInfoComand(CommonDevice device)
         {
             var jObject = new Newtonsoft.Json.Linq.JObject
-            {
-                { "DeviceAddr",device.DeviceAddr },
-                { "Epoint", device.DeviceEpoint },
-                { "Cluster_ID", (int)Cluster_ID.Basic },
-                { "Command", 108 }
+            {
+                { "DeviceAddr",device.DeviceAddr },
+                { "Epoint", device.DeviceEpoint },
+                { "Cluster_ID", (int)Cluster_ID.Basic },
+                { "Command", 108 }
             };
             var attriBute = new Newtonsoft.Json.Linq.JArray
-            {
+            {
                new Newtonsoft.Json.Linq.JObject
-               {
+               {
                  { "AttriButeId", 4}
-               },
+               },
                new Newtonsoft.Json.Linq.JObject
                {
                  { "AttriButeId", 5}
-               },
+               },
                new Newtonsoft.Json.Linq.JObject
                {
                  { "AttriButeId", 6}
-               },
+               },
                   new Newtonsoft.Json.Linq.JObject
                {
                  { "AttriButeId", 7}
-               },
+               },
                new Newtonsoft.Json.Linq.JObject
                {
                  { "AttriButeId", 13}
-               }
+               }
             };
             var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } };
             jObject.Add("Data", data);
@@ -211,7 +211,17 @@
                     isRightData = true;
                     if (data.AttriButeDataHex.Length > 2)
                     {
-                        var value = UserCenterLogic.TranslateHexadecimalIntoText(data.AttriButeDataHex.Substring(2));
+                        string value;
+                        if (Common.LocalDevice.Current.IsHdlDevice(device) == false)
+                        {
+                            //绗笁鏂硅澶�
+                            value = data.AttriButeDataHex.Substring(2);
+                        }
+                        else
+                        {
+                            //娌充笢璁惧
+                            value = UserCenterLogic.TranslateHexadecimalIntoText(data.AttriButeDataHex.Substring(2));
+                        }
                         if (device.SerialNumber != value)
                         {
                             //灞炴�у彉鏇翠簡
@@ -228,20 +238,13 @@
             }
 
             //濡傛灉灞炴�у彉鏇翠簡
-            if (AttriButeChanged == true && UserCenterResourse.listDeviceAttributePushForm.Count > 0)
+            if (AttriButeChanged == true)
             {
                 if (device.IsCustomizeImage == false)
                 {
                     //UI閲嶆柊鐢熸垚
                     device.IconPath = string.Empty;
                     device.ReSave();
-                }
-                //灞炴�у彉鏇存帹閫�
-                var list = new List<CommonFormBase>();
-                list.AddRange(UserCenterResourse.listDeviceAttributePushForm);
-                for (int i = 0; i < list.Count; i++)
-                {
-                    list[i]?.DeviceAttributePush(device);
                 }
             }
             return 1;

--
Gitblit v1.8.0