From 351bdda734832d821a9764b0cde8be5d83c4ec50 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期四, 01 十二月 2022 09:56:25 +0800
Subject: [PATCH] 2022年12月01日09:56:23
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceFixedAttributeLogic.cs | 212 ++++++++++++++++++++++++++--------------------------
1 files changed, 106 insertions(+), 106 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceFixedAttributeLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceFixedAttributeLogic.cs
old mode 100755
new mode 100644
index b5ff35b..b7ef9d0
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceFixedAttributeLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceFixedAttributeLogic.cs
@@ -1,106 +1,106 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Text;
-using ZigBee.Device;
-
-namespace Shared.Phone.UserCenter
-{
- /// <summary>
- /// 璁惧鍥哄畾淇℃伅鐨勯�昏緫
- /// </summary>
- public class HdlDeviceFixedAttributeLogic
- {
- #region 鈻� 鍙橀噺澹版槑___________________________
-
- /// <summary>
- /// 璁惧鍥哄畾淇℃伅鐨勯�昏緫
- /// </summary>
- private static HdlDeviceFixedAttributeLogic m_Current = null;
- /// <summary>
- /// 璁惧鍥哄畾淇℃伅鐨勯�昏緫
- /// </summary>
- public static HdlDeviceFixedAttributeLogic Current
- {
- get
- {
- if (m_Current == null)
- {
- m_Current = new HdlDeviceFixedAttributeLogic();
- }
- return m_Current;
- }
- }
-
- #endregion
-
- #region 鈻� 涓诲叆鍙e嚱鏁癬________________________
-
- /// <summary>
- /// 璇诲彇浠ュ強璁剧疆璁惧鍥哄畾灞炴��(false:涓嶉渶瑕佸彂閫佸懡浠�)
- /// </summary>
- /// <param name="i_device">璁惧鍥炶矾</param>
- public bool SetAllFixedAttributeToDevice(CommonDevice i_device)
- {
- if (i_device == null)
- {
- return false;
- }
- var localDevice = Common.LocalDevice.Current.GetDevice(i_device.DeviceAddr, i_device.DeviceEpoint);
- if (localDevice == null)
- {
- //ota涔熶細璺戣繘鏉�
- return false;
- }
-
- Newtonsoft.Json.Linq.JObject jObject = null;
- Newtonsoft.Json.Linq.JArray attriBute = null;
- //绐楀笜
- if (localDevice.Type == DeviceType.WindowCoveringDevice
- && ((Rollershade)localDevice).WcdType == -1)
- {
- this.GetCurtainComand(localDevice, ref jObject, ref attriBute);
- }
- if (jObject == null)
- {
- //涓嶉渶瑕佸彂閫�
- return false;
- }
- //鍙戦��
- var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } };
- jObject.Add("Data", data);
- localDevice.Gateway?.Send(("GetDeviceStatus"), jObject.ToString());
-
- return true;
- }
-
- #endregion
-
- #region 鈻� 鑾峰彇绐楀笜鍛戒护_______________________
-
- /// <summary>
- /// 鑾峰彇绐楀笜鍛戒护
- /// </summary>
- /// <param name="device">璁惧瀵硅薄</param>
- /// <param name="jObject">鏍囬鏁版嵁</param>
- /// <param name="attriBute">灞炴�ф暟鎹�</param>
- private void GetCurtainComand(CommonDevice device, ref Newtonsoft.Json.Linq.JObject jObject, ref Newtonsoft.Json.Linq.JArray attriBute)
- {
- jObject = new Newtonsoft.Json.Linq.JObject
- {
- { "DeviceAddr",device.DeviceAddr },
- { "Epoint", device.DeviceEpoint },
- { "Cluster_ID", (int)Cluster_ID.WindowCovering },
- { "Command", 108 }
- };
- attriBute = new Newtonsoft.Json.Linq.JArray
- {
- new Newtonsoft.Json.Linq.JObject
- {
- { "AttriButeId", (int)AttriButeId.WindowCoveringType }
- }
- };
- }
-
- #endregion
- }
-}
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using ZigBee.Device;
+
+namespace Shared.Phone.UserCenter
+{
+ /// <summary>
+ /// 璁惧鍥哄畾淇℃伅鐨勯�昏緫
+ /// </summary>
+ public class HdlDeviceFixedAttributeLogic
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 璁惧鍥哄畾淇℃伅鐨勯�昏緫
+ /// </summary>
+ private static HdlDeviceFixedAttributeLogic m_Current = null;
+ /// <summary>
+ /// 璁惧鍥哄畾淇℃伅鐨勯�昏緫
+ /// </summary>
+ public static HdlDeviceFixedAttributeLogic Current
+ {
+ get
+ {
+ if (m_Current == null)
+ {
+ m_Current = new HdlDeviceFixedAttributeLogic();
+ }
+ return m_Current;
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 涓诲叆鍙e嚱鏁癬________________________
+
+ /// <summary>
+ /// 璇诲彇浠ュ強璁剧疆璁惧鍥哄畾灞炴��(false:涓嶉渶瑕佸彂閫佸懡浠�)
+ /// </summary>
+ /// <param name="i_device">璁惧鍥炶矾</param>
+ public bool SetAllFixedAttributeToDevice(CommonDevice i_device)
+ {
+ if (i_device == null)
+ {
+ return false;
+ }
+ var localDevice = Common.LocalDevice.Current.GetDevice(i_device.DeviceAddr, i_device.DeviceEpoint);
+ if (localDevice == null)
+ {
+ //ota涔熶細璺戣繘鏉�
+ return false;
+ }
+
+ Newtonsoft.Json.Linq.JObject jObject = null;
+ Newtonsoft.Json.Linq.JArray attriBute = null;
+ //绐楀笜
+ if (localDevice.Type == DeviceType.WindowCoveringDevice
+ && ((Rollershade)localDevice).WcdType == -1)
+ {
+ this.GetCurtainComand(localDevice, ref jObject, ref attriBute);
+ }
+ if (jObject == null)
+ {
+ //涓嶉渶瑕佸彂閫�
+ return false;
+ }
+ //鍙戦��
+ var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } };
+ jObject.Add("Data", data);
+ localDevice.Gateway?.Send(("GetDeviceStatus"), jObject.ToString());
+
+ return true;
+ }
+
+ #endregion
+
+ #region 鈻� 鑾峰彇绐楀笜鍛戒护_______________________
+
+ /// <summary>
+ /// 鑾峰彇绐楀笜鍛戒护
+ /// </summary>
+ /// <param name="device">璁惧瀵硅薄</param>
+ /// <param name="jObject">鏍囬鏁版嵁</param>
+ /// <param name="attriBute">灞炴�ф暟鎹�</param>
+ private void GetCurtainComand(CommonDevice device, ref Newtonsoft.Json.Linq.JObject jObject, ref Newtonsoft.Json.Linq.JArray attriBute)
+ {
+ jObject = new Newtonsoft.Json.Linq.JObject
+ {
+ { "DeviceAddr",device.DeviceAddr },
+ { "Epoint", device.DeviceEpoint },
+ { "Cluster_ID", (int)Cluster_ID.WindowCovering },
+ { "Command", 108 }
+ };
+ attriBute = new Newtonsoft.Json.Linq.JArray
+ {
+ new Newtonsoft.Json.Linq.JObject
+ {
+ { "AttriButeId", (int)AttriButeId.WindowCoveringType }
+ }
+ };
+ }
+
+ #endregion
+ }
+}
--
Gitblit v1.8.0