| | |
| | |
|
| | | /// <summary>
|
| | | /// 设备镜像的逻辑
|
| | | /// </summary> |
| | | private static HdlDeviceImageInfoLogic m_Current = null; |
| | | /// </summary>
|
| | | private static HdlDeviceImageInfoLogic m_Current = null;
|
| | | /// <summary>
|
| | | /// 设备镜像的逻辑
|
| | | /// </summary> |
| | | /// </summary>
|
| | | public static HdlDeviceImageInfoLogic Current
|
| | | {
|
| | | get
|
| | |
| | | /// <param name="tADevice"></param>
|
| | | private void SetFirmwareVersionToOtaDevice(OTADevice tADevice)
|
| | | {
|
| | | if (HdlDeviceAttributeLogic.Current.IsEsixt("DeviceAutoGetFirmwareVersion") == false)
|
| | | if (HdlGatewayReceiveLogic.Current.IsEsixt("DeviceAutoGetFirmwareVersion") == false)
|
| | | {
|
| | | //添加事件
|
| | | HdlDeviceAttributeLogic.Current.AddAttributeEvent("DeviceAutoGetFirmwareVersion", "DeviceStatusReport", this.SetFirmwareVersionByInterfaceResult);
|
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("DeviceAutoGetFirmwareVersion", ReceiveComandDiv.A设备属性上报, this.SetFirmwareVersionByInterfaceResult);
|
| | | }
|
| | | //发送命令
|
| | | this.SetFirmwareVersionComand(tADevice);
|
| | |
| | | public void SetFirmwareVersionComand(OTADevice device)
|
| | | {
|
| | | var jObject = new Newtonsoft.Json.Linq.JObject
|
| | | { |
| | | { "DeviceAddr",device.DeviceAddr }, |
| | | { "Epoint", device.DeviceEpoint }, |
| | | { "Cluster_ID", (int)Cluster_ID.Ota }, |
| | | { "Command", 108 } |
| | | {
|
| | | { "DeviceAddr",device.DeviceAddr },
|
| | | { "Epoint", device.DeviceEpoint },
|
| | | { "Cluster_ID", (int)Cluster_ID.Ota },
|
| | | { "Command", 108 }
|
| | | };
|
| | | var attriBute = new Newtonsoft.Json.Linq.JArray
|
| | | { |
| | | {
|
| | | new Newtonsoft.Json.Linq.JObject
|
| | | { |
| | | {
|
| | | { "AttriButeId", (int)AttriButeId.ImgVersion}
|
| | | }, |
| | | },
|
| | | new Newtonsoft.Json.Linq.JObject
|
| | | {
|
| | | { "AttriButeId", (int)AttriButeId.mgHWversion}
|
| | | }, |
| | | },
|
| | | new Newtonsoft.Json.Linq.JObject
|
| | | {
|
| | | { "AttriButeId", (int)AttriButeId.ImgTypeId}
|
| | | } |
| | | }
|
| | | };
|
| | | var data = new Newtonsoft.Json.Linq.JObject { { "AttriBute", attriBute } };
|
| | | jObject.Add("Data", data);
|