| | |
| | |
|
| | | /// <summary>
|
| | | /// 设备固定信息的逻辑
|
| | | /// </summary> |
| | | private static HdlDeviceFixedAttributeLogic m_Current = null; |
| | | /// </summary>
|
| | | private static HdlDeviceFixedAttributeLogic m_Current = null;
|
| | | /// <summary>
|
| | | /// 设备固定信息的逻辑
|
| | | /// </summary> |
| | | /// </summary>
|
| | | public static HdlDeviceFixedAttributeLogic Current
|
| | | {
|
| | | get
|
| | |
| | | lock (this.hsGetHardInfoDevice)
|
| | | {
|
| | | //先移除
|
| | | this.RemoveDeviceHardInfoThread(device);
|
| | |
|
| | | string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
|
| | | this.hsGetHardInfoDevice.Add(mainkeys);
|
| | |
|
| | | if (HdlDeviceAttributeLogic.Current.IsEsixt("DeviceGetFixedAttribute") == false)
|
| | | string mainKeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
|
| | | if (this.hsGetHardInfoDevice.Contains(mainKeys) == true)
|
| | | {
|
| | | this.hsGetHardInfoDevice.Remove(mainKeys);
|
| | | }
|
| | | if (HdlGatewayReceiveLogic.Current.IsEsixt("DeviceGetFixedAttribute") == false)
|
| | | {
|
| | | //添加事件
|
| | | HdlDeviceAttributeLogic.Current.AddAttributeEvent("DeviceGetFixedAttribute", "DeviceStatusReport", this.SetFixedAttributeByInterfaceResult);
|
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("DeviceGetFixedAttribute", ReceiveComandDiv.A设备属性上报, this.SetFixedAttributeByInterfaceResult);
|
| | | }
|
| | | //发送命令
|
| | | this.SeFixedAttributeComand(device);
|
| | |
| | | //不需要发送
|
| | | return;
|
| | | }
|
| | | string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
|
| | | this.hsGetHardInfoDevice.Add(mainkeys);
|
| | | //发送
|
| | | var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } };
|
| | | jObject.Add("Data", data);
|
| | |
| | | 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 } |
| | | {
|
| | | { "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 }
|
| | | } |
| | | }
|
| | | };
|
| | | }
|
| | |
|