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/HdlDeviceHardInfoLogic.cs | 87 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 87 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceHardInfoLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceHardInfoLogic.cs new file mode 100644 index 0000000..b34358e --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceHardInfoLogic.cs @@ -0,0 +1,87 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; +using ZigBee.Device; + +namespace Shared.Phone.UserCenter +{ + /// <summary> + /// 璁惧纭欢淇℃伅鐨勯�昏緫 + /// </summary> + public class HdlDeviceHardInfoLogic + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 璁惧纭欢淇℃伅鐨勯�昏緫 + /// </summary> + private static HdlDeviceHardInfoLogic m_Current = null; + /// <summary> + /// 璁惧纭欢淇℃伅鐨勯�昏緫 + /// </summary> + public static HdlDeviceHardInfoLogic Current + { + get + { + if (m_Current == null) + { + m_Current = new HdlDeviceHardInfoLogic(); + } + return m_Current; + } + } + + #endregion + + #region 鈻� 涓诲叆鍙e嚱鏁癬________________________ + + /// <summary> + /// 璇诲彇浠ュ強璁剧疆璁惧纭欢淇℃伅 + /// </summary> + /// <param name="device">璁惧鍥炶矾</param> + /// <param name="backAction">鍥炶皟鍑芥暟</param> + public void SetAllHardFirmwareInfoToDevice(CommonDevice device) + { + if (device == null) + { + return; + } + + var jObject = new Newtonsoft.Json.Linq.JObject + { + { "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}//鍨嬪彿鐮�(涔熷彨妯″潡ID) + }, + 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); + device.Gateway?.Send(("GetDeviceStatus"), jObject.ToString()); + } + + #endregion + } +} -- Gitblit v1.8.0