using System;
using System.Collections.Generic;
using System.Text;
using ZigBee.Device;
namespace Shared.Phone.UserCenter
{
///
/// 设备镜像的逻辑
///
public class HdlDeviceImageInfoLogic
{
#region ■ 变量声明___________________________
///
/// 设备镜像的逻辑
///
private static HdlDeviceImageInfoLogic m_Current = null;
///
/// 设备镜像的逻辑
///
public static HdlDeviceImageInfoLogic Current
{
get
{
if (m_Current == null)
{
m_Current = new HdlDeviceImageInfoLogic();
}
return m_Current;
}
}
#endregion
#region ■ 发送命令___________________________
///
/// 发送获取固件版本信息的命令
///
///
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 }
};
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);
device.Gateway?.Send(("GetDeviceStatus"), jObject.ToString());
}
#endregion
}
}