From 6fa9d69da922c8049f5acfcbb9ce9fd26811024c Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期四, 16 四月 2020 17:10:57 +0800 Subject: [PATCH] 请合并代码 --- ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs | 2357 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 2,357 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs new file mode 100755 index 0000000..d063079 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/ZbGatewayData.cs @@ -0,0 +1,2357 @@ +锘縰sing System; +using System.Collections.Generic; +using Newtonsoft.Json.Linq; + +namespace ZigBee.Device +{ + public class ZbGatewayData : CommonDevice + { + #region 鏂拌拷鍔犵殑涓�浜涘彉閲� + /// <summary> + /// 鍒ゆ柇缃戝叧鏄惁鍦ㄧ嚎鐨勬爣璇嗭紝APP鐣岄潰浼氭敼鍙樺畠鐨勫��,Application浼氶噸鏂板埛鏂板畠鐨勫�� + /// </summary> + public bool GatewayOnlineFlage = false; + /// <summary> + /// 缃戝叧鎵�鍦ㄧ殑鎴块棿ID + /// </summary> + public string RoomId = string.Empty; + + #endregion + + [Newtonsoft.Json.JsonIgnore] + /// <summary> + /// 铏氭嫙缃戝叧 + /// </summary> + public bool IsVirtual; + + #region 缃戝叧鍩烘湰淇℃伅 + /// <summary> + /// 璇ョ綉鍏冲簲鐢ㄧ▼搴忕増鏈� + /// </summary> + public long AppVersion; + + /// <summary> + /// Zigbee鍗忚鍣ㄧ▼搴忕増鏈� + /// </summary> + public int ZigbeeVersion; + #endregion + + #region 缃戝叧淇℃伅. + /// <summary> + /// 缃戝叧鐗堟湰淇℃伅,缃戝叧鍙嶉淇℃伅 + /// </summary> + public GetGwVersionAllData getGwVersionAllData; + /// <summary> + /// 缃戝叧鐗堟湰淇℃伅,缃戝叧鍙嶉淇℃伅 + /// </summary> + [System.Serializable] + public class GetGwVersionAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 缃戝叧鐗堟湰淇℃伅 + /// </summary> + public GetGwVersionData getGwVersion; + } + + /// <summary> + /// 缃戝叧鐗堟湰淇℃伅 + /// </summary> + public GetGwVersionData getGwVersion; + /// <summary> + /// 缃戝叧鐗堟湰淇℃伅 + /// </summary> + [System.Serializable] + public class GetGwVersionData + { + /// <summary> + /// 璇ョ綉鍏冲簲鐢ㄧ▼搴忕増鏈� + /// </summary> + public long AppVersion; + /// <summary> + /// Zigbee鍗忚鍣ㄧ▼搴忕増鏈� + /// </summary> + public int ZigbeeVersion; + } + #endregion + + #region 鑾峰彇缃戝叧淇℃伅. + /// <summary> + /// 缃戝叧淇℃伅,缃戝叧鍙嶉鍏蜂綋淇℃伅. + /// </summary> + public GetGwAllData getGwAllData; + /// <summary> + /// 缃戝叧淇℃伅,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + [System.Serializable] + public class GetGwAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 缃戝叧淇℃伅 + /// </summary> + public GetGwData getGwData; + } + + /// <summary> + /// 缃戝叧淇℃伅. + /// </summary> + public GetGwData getGwInfo; + /// <summary> + /// 缃戝叧淇℃伅 + /// </summary> + [System.Serializable] + public class GetGwData + { + ///<summary> + ///缃戝叧搴忓垪鍙凤紝璇ョ綉鍏冲敮涓�鏍囪瘑 + /// </summary> + public string GwId; + /// <summary> + ///缃戝叧缁戝畾缃戝崱鐨刴ac鍦板潃 + /// </summary> + public string GwMac; + /// <summary> + ///缃戝叧鍚嶇О + /// </summary> + public string GwName; + /// <summary> + /// 缃戝叧鐨勫簭鍒楀彿 + /// </summary> + public string GWSN = string.Empty; + /// <summary> + ///鏄惁涓轰富缃戝叧銆�(鍥犱负鍦ㄥ缃戠殑鎯呭喌涓嬶紝杩欎釜瀛楁鍙互鑾峰彇鍒帮紝鐢ㄦ潵鏇存柊灞�鍩熺綉涓熀鏈俊鎭殑瀵硅薄涓殑涓荤綉鍏充俊鎭級 + ///<para>0锛氬惁</para> + ///<para>1锛氭槸</para> + /// </summary> + public int IsDominant; + ///<summary> + ///utc鏃堕棿鎴筹紝绋嬪簭鍚姩鏃剁綉鍏崇殑绯荤粺鏃堕棿 + ///</summary> + public long StartTime; + /// <summary> + ///鍔犲叆灞�鍩熺綉妯″紡 + ///<para>0锛歸ifi杩炴帴灞�鍩熺綉</para> + ///<para>1锛氭湁绾胯繛鎺ュ眬鍩熺綉</para> + ///<para>2锛氭湭鍔犲叆灞�鍩熺綉</para> + /// </summary> + public int JoinMode; + /// <summary> + ///缃戝叧鎵�鍦ㄥ眬鍩熺綉鐨刬p鍦板潃 + /// </summary> + public string GwIP; + /// <summary> + /// 涓讳汉鐨凣uid(鍗充娇鏄鐞嗗憳,杩欓噷涔熸槸涓讳汉鐨凣uid) + /// </summary> + public string AccountId; + /// <summary> + ///褰撳墠灞�鍩熺綉缃戠粶鍙峰崰鐢ㄤ綅鏁帮紝鐢ㄤ簬璁$畻瀛愮綉鎺╃爜锛屽Mask=32锛屽垯瀛愮綉鎺╃爜涓�255.255.255.0 + /// </summary> + public int Mask; + /// <summary> + ///涓婄骇璺敱鍣ㄦ棤绾垮悕绉� + ///<para>褰� JoinMode = 0鏃跺瓨鍦� </para> + /// </summary> + public string RouteESSID; + /// <summary> + ///DNS鏈嶅姟鍣ㄥ湴鍧� + /// </summary> + public string DNSServer; + /// <summary> + /// 璇ョ綉鍏冲簲鐢ㄧ▼搴忕増鏈� + /// </summary> + public long AppVersion; + /// <summary> + /// Zigbee鍗忚鍣ㄧ▼搴忕増鏈� + /// </summary> + public int ZigbeeVersion; + /// <summary> + ///鍗忚皟鍣╩ac鍦板潃 + /// </summary> + public string ZigbeeMacAddr; + /// <summary> + ///缃戝叧瀹卛d + /// </summary> + public string HomeId; + /// <summary> + ///鏄惁宸茬粡杩炴帴浜戠mqtt + ///<para>0锛氬惁</para> + ///<para>1锛氭槸</para> + /// </summary> + public int IsConnectCloud; + /// <summary> + ///锛堢敤浜庣綉鍏崇▼搴忚皟璇曪級 + ///<para>https鐧婚檰浜戠鏃讹紝鏈�杩戜竴娆¤幏鍙栫殑鍝嶅簲鐘舵�佺爜銆傛牴鎹簯绔殑瀹氫箟锛屾湁濡備笅鐘舵�佺爜銆�</para> + ///<para>(1)Success锛屽垯[璋冪敤姝ゆ帴鍙f搷浣滄垚鍔焆</para> + ///<para>(2)ParameterOrEmpty,鍒欏搷搴斿瓧娈典腑[ErrorInfo] 涓洪敊璇俊鎭痆鎻愪氦閿欒淇℃伅]</para> + ///<para>(3)NoBind,鍒欏搷搴斿瓧娈典腑[ErrorInfo] 涓洪敊璇俊鎭痆鎮ㄦ墍鎻愪氦鐨刐GatewayUniqueId 缃戝叧鍞竴Id(MAC)]鍜孾浣忓畢涓婚敭Id]涓嶅瓨鍦ㄧ粦瀹氱殑鍏崇郴]</para> + ///<para>(4)YouDataNoIsLocalRegion,鍒欏搷搴斿瓧娈典腑[ErrorInfo] 涓洪敊璇俊鎭痆鎮ㄧ殑鐨勬暟鎹苟涓嶅湪姝DL鍖哄煙鏈嶅姟鍣�, 璇烽噸瀹氬悜鍒板涓婬DL鍖哄煙鏈嶅姟鍣ㄨ繘琛屽鐞�.]</para> + /// </summary> + public string StateCode; + /// <summary> + ///Linux缃戝叧绫诲瀷 + /// </summary> + public int LinuxImageType; + /// <summary> + ///Linux缃戝叧HW鐗堟湰 + /// </summary> + public int LinuxHWVersion; + /// <summary> + /// Linux缃戝叧FW鐗堟湰 + /// </summary> + public int LinuxFWVersion; + /// <summary> + /// 鍗忚皟鍣℉W鐗堟湰 + /// </summary> + public int ZbHWVersion; + /// <summary> + /// 鍗忚皟鍣‵W鐗堟湰 + /// </summary> + public int ZbFWVersion; + /// <summary> + /// 缃戝叧闀滃儚绫诲瀷 + /// </summary> + public int ZbImageType; + + /// <summary> + /// 铏氭嫙椹卞姩淇℃伅 + /// </summary> + public List <DriveCodeListObj> DriveCodeList = new List<DriveCodeListObj>(); + } + + public class DriveCodeListObj + { + /// <summary> + /// 椹卞姩浠e彿锛堢敱缃戝叧涓洪┍鍔ㄥ垎閰嶅敮涓�鏍囪瘑锛� + /// </summary> + public int DriveCode; + /// <summary> + /// 椹卞姩纭欢鐗堟湰 + /// </summary> + public int DriveHwVersion; + /// <summary> + /// 椹卞姩杞欢鐗� + /// </summary> + public int DriveFwVersion; + /// <summary> + /// 椹卞姩鍥轰欢绫诲瀷 + /// </summary> + public int DriveImageType; + /// <summary> + /// 椹卞姩id + /// </summary> + public int DriveId; + } + #endregion + + #region 淇敼缃戝叧鍚嶇О + /// <summary> + /// 淇敼缃戝叧鍚嶇О,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + public GwReNameAllData gwReNameAllData; + /// <summary> + /// 淇敼缃戝叧鍚嶇О,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + [System.Serializable] + public class GwReNameAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 淇敼缃戝叧鍚嶇О + /// </summary> + public GwReNameData gwReNameData; + } + + /// <summary> + /// 淇敼缃戝叧鍚嶇О + /// </summary> + public GwReNameData gwRename; + /// <summary> + /// 淇敼缃戝叧鍚嶇О + /// </summary> + [System.Serializable] + public class GwReNameData + { + /// <summary> + /// 淇敼鍚庣殑缃戝叧鍚嶇О + /// </summary> + public string GwName; + } + #endregion + + #region 璁惧畾缃戝叧浣忓畢id + /// <summary> + /// 缃戝叧浣忓畢id鏁版嵁,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + public GwSetHomeIdAllData gwSetHomeIdAllData; + /// <summary> + /// 缃戝叧浣忓畢id鏁版嵁,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + [System.Serializable] + public class GwSetHomeIdAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 缃戝叧浣忓畢id鏁版嵁 + /// </summary> + public GwSetHomeIdData gwSetHomeIdData; + } + + /// <summary> + /// 缃戝叧浣忓畢id鏁版嵁 + /// </summary> + public GwSetHomeIdData gwSetHomeId; + /// <summary> + /// 缃戝叧浣忓畢id鏁版嵁 + /// </summary> + [System.Serializable] + public class GwSetHomeIdData + { + /// <summary> + /// 浣忓畢id + /// </summary> + public string HomeId; + } + + /// <summary> + /// 骞挎挱鍙戠幇鍗忚 + /// </summary> + public GatewayBaseInfo getGatewayBaseInfo = new GatewayBaseInfo { }; + /// <summary> + /// 骞挎挱鍙戠幇鍗忚 + /// </summary> + [System.Serializable] + public class GatewayBaseInfo + { + /// <summary> + /// 缃戝叧Ip鍦板潃 + /// </summary> + public string IpAddress; + /// <summary> + /// 浣忓畢id锛�4瀛楄妭鏁村瀷銆傦紙灏忕缁撴瀯锛夊鏋滅綉鍏充笉璁剧疆瀹卛d锛屽皢榛樿涓�0 + /// </summary> + public string HomeId = string.Empty; + /// <summary> + /// 缃戝叧褰撳墠鏃堕棿鎴筹紙灏忕缁撴瀯锛� + /// </summary> + public int Time; + /// <summary> + /// 鏄惁涓轰富缃戝叧 + /// </summary> + public bool IsMainGateWay; + /// <summary> + /// 缃戝叧鍚嶇О + /// </summary> + public string GwName; + /// <summary> + /// RSA鍏挜 + /// </summary> + //public string PubKey; + //string id; + /// <summary> + /// 缃戝叧ID + /// </summary> + public string gwID; + //{ + // get{ + // return id; + // } + // set{ + // id = value; + // //System.Console.WriteLine("===========123456"); + // } + //} + + } + + /// <summary> + /// 缃戝叧鎴愪负涓荤綉鍏虫椂骞挎挱閫氱煡 + /// </summary> + public MainGatewayBaseInfo getMainGatewayBaseInfo; + /// <summary> + /// 缃戝叧鎴愪负涓荤綉鍏虫椂骞挎挱閫氱煡 + /// </summary> + [System.Serializable] + public class MainGatewayBaseInfo + { + /// <summary> + /// 鍙戦�佹柟鐨刬p鍦板潃 + /// </summary> + public string IpAddress; + /// <summary> + /// 浣忓畢id锛�4瀛楄妭鏁村瀷銆傦紙灏忕缁撴瀯锛夊鏋滅綉鍏充笉璁剧疆浣忓畢id锛屽皢榛樿涓�0 + /// </summary> + public string HomeId; + /// <summary> + /// 鏁版嵁鍛戒护鏍囪瘑 + /// </summary> + public int Command_Id = 0x03; + /// <summary> + /// 淇濈暀 + /// </summary> + public int Retain = 0x00; + /// <summary> + /// 缃戝叧褰撳墠鏃堕棿鎴筹紙灏忕缁撴瀯锛� + /// </summary> + public int Time; + /// <summary> + /// RSA鍏挜 + /// </summary> + public string PubKey; + /// <summary> + /// 缃戝叧鍚嶇О + /// </summary> + public string gwName; + + /// <summary> + /// 缃戝叧ID + /// </summary> + public string gwID; + + } + #endregion + + #region 鑾峰彇鎵�鏈夌綉鍏崇殑鑺傜偣璁惧淇℃伅锛堢敤浜庝富缃戝叧锛� + ///// <summary> + ///// 鑾峰彇鎵�鏈夌綉鍏崇殑鑺傜偣璁惧淇℃伅锛堢敤浜庝富缃戝叧锛� + ///// </summary> + //public static async System.Threading.Tasks.Task<List<CommonDevice>> GetAllGatewayDeviceInfoList() + //{ + // if (ZbGateway.MainGateWay == null) + // { + // return null; + // } + // ZbGateway.MainGateWay.AllGatewayDeviceList.Clear(); + // return await System.Threading.Tasks.Task.Run((Func<System.Threading.Tasks.Task<List<CommonDevice>>>)(async () => + // { + // var dateTime = DateTime.Now; + // Action<string, string> action = (topic, message) => + // { + + // var gatewayID = topic.Split('/')[0]; + // var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); + // if (topic == gatewayID + "/" + "DeviceInfoRespon") + // { + // dateTime = DateTime.Now; + // var deviceID = jobject.Value<int>("Device_ID"); + // switch ((DeviceType)(deviceID)) + // { + // case DeviceType.ColorDimmableLight: + // var dimmableLight = new ColorDimmableLight() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID") }; + // dimmableLight.getAllGatewayDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<ColorDimmableLight.AllGatewayDeviceInfo>(jobject["Data"].ToString()); + // if (dimmableLight.getAllGatewayDeviceInfo == null) + // { + // return; + // } + // dimmableLight.CurrentGateWayId = dimmableLight.getAllGatewayDeviceInfo.GwId; + // var light = ZbGateway.MainGateWay.AllGatewayDeviceList.Find(obj => obj.DeviceID == dimmableLight.DeviceID && obj.DeviceAddr == dimmableLight.DeviceAddr && obj.DeviceEpoint == dimmableLight.DeviceEpoint); + // if (light == null) + // { + // ZbGateway.MainGateWay.AllGatewayDeviceList.Add(dimmableLight); + // dimmableLight.DeviceName = dimmableLight.getAllGatewayDeviceInfo.MacName; + // dimmableLight.DeviceEpointName = dimmableLight.getAllGatewayDeviceInfo.DeviceName; + // dimmableLight.ImgVersion = dimmableLight.getAllGatewayDeviceInfo.ImgVersion; + // dimmableLight.IsOnline = dimmableLight.getAllGatewayDeviceInfo.IsOnline; + // dimmableLight.IasDeviceType = dimmableLight.getAllGatewayDeviceInfo.DeviceType; + // dimmableLight.Profile = dimmableLight.getAllGatewayDeviceInfo.Profile; + // dimmableLight.ImgTypeId = dimmableLight.getAllGatewayDeviceInfo.ImgTypeId; + // dimmableLight.InClusterList = dimmableLight.getAllGatewayDeviceInfo.InClusterList; + // dimmableLight.OutClusterList = dimmableLight.getAllGatewayDeviceInfo.OutClusterList; + // dimmableLight.AttributeStatus = dimmableLight.getAllGatewayDeviceInfo.AttributeStatus; + // dimmableLight.Save(); + // } + // else + // { + // light.getAllGatewayDeviceInfo = dimmableLight.getAllGatewayDeviceInfo; + // light.DeviceName = dimmableLight.getAllGatewayDeviceInfo.MacName; + // light.DeviceEpointName = dimmableLight.getAllGatewayDeviceInfo.DeviceName; + // light.ImgVersion = dimmableLight.getAllGatewayDeviceInfo.ImgVersion; + // light.IsOnline = dimmableLight.getAllGatewayDeviceInfo.IsOnline; + // light.IasDeviceType = dimmableLight.getAllGatewayDeviceInfo.DeviceType; + // light.Profile = dimmableLight.getAllGatewayDeviceInfo.Profile; + // light.ImgTypeId = dimmableLight.getAllGatewayDeviceInfo.ImgTypeId; + // light.InClusterList = dimmableLight.getAllGatewayDeviceInfo.InClusterList; + // light.OutClusterList = dimmableLight.getAllGatewayDeviceInfo.OutClusterList; + // light.AttributeStatus = dimmableLight.getAllGatewayDeviceInfo.AttributeStatus; + // light.ReSave(); + // } + // System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); + + // break; + // case DeviceType.OnOffOutput: + // var toggleLight = new ToggleLight() { Time = jobject.Value<int>("Time"), DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID") }; + // toggleLight.getAllGatewayDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<ToggleLight.AllGatewayDeviceInfo>(jobject["Data"].ToString()); + // if (toggleLight.getAllGatewayDeviceInfo == null) + // { + // return; + // } + // toggleLight.CurrentGateWayId = toggleLight.getAllGatewayDeviceInfo.GwId; + + // var localToggleLight = ZbGateway.MainGateWay.AllGatewayDeviceList.Find(obj => obj.DeviceID == toggleLight.DeviceID && obj.DeviceAddr == toggleLight.DeviceAddr && obj.DeviceEpoint == toggleLight.DeviceEpoint); + // if (localToggleLight == null) + // { + // toggleLight.DeviceName = toggleLight.getAllGatewayDeviceInfo.MacName; + // toggleLight.DeviceEpointName = toggleLight.getAllGatewayDeviceInfo.DeviceName; + // toggleLight.ImgVersion = toggleLight.getAllGatewayDeviceInfo.ImgVersion; + // toggleLight.IsOnline = toggleLight.getAllGatewayDeviceInfo.IsOnline; + // toggleLight.IasDeviceType = toggleLight.getAllGatewayDeviceInfo.DeviceType; + // toggleLight.Profile = toggleLight.getAllGatewayDeviceInfo.Profile; + // toggleLight.ImgTypeId = toggleLight.getAllGatewayDeviceInfo.ImgTypeId; + // toggleLight.InClusterList = toggleLight.getAllGatewayDeviceInfo.InClusterList; + // toggleLight.OutClusterList = toggleLight.getAllGatewayDeviceInfo.OutClusterList; + // toggleLight.AttributeStatus = toggleLight.getAllGatewayDeviceInfo.AttributeStatus; + // ZbGateway.MainGateWay.AllGatewayDeviceList.Add(toggleLight); + // toggleLight.Save(); + + // } + // else + // { + // localToggleLight.getAllGatewayDeviceInfo = toggleLight.getAllGatewayDeviceInfo; + // localToggleLight.DeviceName = toggleLight.getAllGatewayDeviceInfo.MacName; + // localToggleLight.DeviceEpointName = toggleLight.getAllGatewayDeviceInfo.DeviceName; + // localToggleLight.ImgVersion = toggleLight.getAllGatewayDeviceInfo.ImgVersion; + // localToggleLight.IsOnline = toggleLight.getAllGatewayDeviceInfo.IsOnline; + // localToggleLight.IasDeviceType = toggleLight.getAllGatewayDeviceInfo.DeviceType; + // localToggleLight.Profile = toggleLight.getAllGatewayDeviceInfo.Profile; + // localToggleLight.ImgTypeId = toggleLight.getAllGatewayDeviceInfo.ImgTypeId; + // localToggleLight.InClusterList = toggleLight.getAllGatewayDeviceInfo.InClusterList; + // localToggleLight.OutClusterList = toggleLight.getAllGatewayDeviceInfo.OutClusterList; + // localToggleLight.AttributeStatus = toggleLight.getAllGatewayDeviceInfo.AttributeStatus; + // localToggleLight.ReSave(); + // } + // System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); + + // break; + // case DeviceType.OnOffSwitch: + // var panel = new Panel() { Time = jobject.Value<int>("Time"), DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID") }; + // panel.getAllGatewayDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<Panel.AllGatewayDeviceInfo>(jobject["Data"].ToString()); + // if (panel.getAllGatewayDeviceInfo == null) + // { + // return; + // } + // panel.CurrentGateWayId = panel.getAllGatewayDeviceInfo.GwId; + + // var localPanel = ZbGateway.MainGateWay.AllGatewayDeviceList.Find(obj => obj.DeviceID == panel.DeviceID && obj.DeviceAddr == panel.DeviceAddr && obj.DeviceEpoint == panel.DeviceEpoint); + // if (localPanel == null) + // { + // panel.DeviceName = panel.getAllGatewayDeviceInfo.MacName; + // panel.DeviceEpointName = panel.getAllGatewayDeviceInfo.DeviceName; + // panel.ImgVersion = panel.getAllGatewayDeviceInfo.ImgVersion; + // panel.IsOnline = panel.getAllGatewayDeviceInfo.IsOnline; + // panel.IasDeviceType = panel.getAllGatewayDeviceInfo.DeviceType; + // panel.Profile = panel.getAllGatewayDeviceInfo.Profile; + // panel.ImgTypeId = panel.getAllGatewayDeviceInfo.ImgTypeId; + // panel.InClusterList = panel.getAllGatewayDeviceInfo.InClusterList; + // panel.OutClusterList = panel.getAllGatewayDeviceInfo.OutClusterList; + // panel.AttributeStatus = panel.getAllGatewayDeviceInfo.AttributeStatus; + // if (panel.DeviceAddr != null) + // { + // ZbGateway.MainGateWay.AllGatewayDeviceList.Add(panel); + // } + // panel.Save(); + // } + // else + // { + // localPanel.getAllGatewayDeviceInfo = panel.getAllGatewayDeviceInfo; + // localPanel.DeviceName = panel.getAllGatewayDeviceInfo.MacName; + // localPanel.DeviceEpointName = panel.getAllGatewayDeviceInfo.DeviceName; + // localPanel.ImgVersion = panel.getAllGatewayDeviceInfo.ImgVersion; + // localPanel.IsOnline = panel.getAllGatewayDeviceInfo.IsOnline; + // localPanel.IasDeviceType = panel.getAllGatewayDeviceInfo.DeviceType; + // localPanel.Profile = panel.getAllGatewayDeviceInfo.Profile; + // localPanel.ImgTypeId = panel.getAllGatewayDeviceInfo.ImgTypeId; + // localPanel.InClusterList = panel.getAllGatewayDeviceInfo.InClusterList; + // localPanel.OutClusterList = panel.getAllGatewayDeviceInfo.OutClusterList; + // localPanel.AttributeStatus = panel.getAllGatewayDeviceInfo.AttributeStatus; + // localPanel.ReSave(); + // } + // System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); + + // break; + // case DeviceType.WindowCoveringDevice: + // var windowCovering = new Rollershade() { DeviceID = jobject.Value<int>((object)"Device_ID"), DeviceAddr = jobject.Value<string>((object)"DeviceAddr"), DeviceEpoint = jobject.Value<int>((object)"Epoint"), DataID = jobject.Value<int>((object)"Data_ID") }; + // windowCovering.getAllGatewayDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<Rollershade.AllGatewayDeviceInfo>(jobject["Data"].ToString()); + // if (windowCovering.getAllGatewayDeviceInfo == null) + // { + // return; + // } + // windowCovering.CurrentGateWayId = windowCovering.getAllGatewayDeviceInfo.GwId; + + // var wc = ZbGateway.MainGateWay.AllGatewayDeviceList.Find(obj => obj.DeviceID == windowCovering.DeviceID && obj.DeviceAddr == windowCovering.DeviceAddr && obj.DeviceEpoint == windowCovering.DeviceEpoint); + // if (wc == null) + // { + // windowCovering.DeviceName = windowCovering.getAllGatewayDeviceInfo.MacName; + // windowCovering.DeviceEpointName = windowCovering.getAllGatewayDeviceInfo.DeviceName; + // windowCovering.ImgVersion = windowCovering.getAllGatewayDeviceInfo.ImgVersion; + // windowCovering.IsOnline = windowCovering.getAllGatewayDeviceInfo.IsOnline; + // windowCovering.IasDeviceType = windowCovering.getAllGatewayDeviceInfo.DeviceType; + // windowCovering.Profile = windowCovering.getAllGatewayDeviceInfo.Profile; + // windowCovering.ImgTypeId = windowCovering.getAllGatewayDeviceInfo.ImgTypeId; + // windowCovering.InClusterList = windowCovering.getAllGatewayDeviceInfo.InClusterList; + // windowCovering.OutClusterList = windowCovering.getAllGatewayDeviceInfo.OutClusterList; + // windowCovering.AttributeStatus = windowCovering.getAllGatewayDeviceInfo.AttributeStatus; + // ZbGateway.MainGateWay.AllGatewayDeviceList.Add(windowCovering); + // windowCovering.Save(); + + // } + // else + // { + // wc.getAllGatewayDeviceInfo = windowCovering.getAllGatewayDeviceInfo; + // wc.DeviceName = windowCovering.getAllGatewayDeviceInfo.MacName; + // wc.DeviceEpointName = windowCovering.getAllGatewayDeviceInfo.DeviceName; + // wc.ImgVersion = windowCovering.getAllGatewayDeviceInfo.ImgVersion; + // wc.IsOnline = windowCovering.getAllGatewayDeviceInfo.IsOnline; + // wc.IasDeviceType = windowCovering.getAllGatewayDeviceInfo.DeviceType; + // wc.Profile = windowCovering.getAllGatewayDeviceInfo.Profile; + // wc.ImgTypeId = windowCovering.getAllGatewayDeviceInfo.ImgTypeId; + // wc.InClusterList = windowCovering.getAllGatewayDeviceInfo.InClusterList; + // wc.OutClusterList = windowCovering.getAllGatewayDeviceInfo.OutClusterList; + // wc.AttributeStatus = windowCovering.getAllGatewayDeviceInfo.AttributeStatus; + // wc.ReSave(); + // } + // System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); + + // break; + // case DeviceType.IASZone: + // var ias = new IASZone() { Time = jobject.Value<int>("Time"), DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID") }; + // ias.getAllGatewayDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<IASZone.AllGatewayDeviceInfo>(jobject["Data"].ToString()); + // if (ias.getAllGatewayDeviceInfo == null) + // { + // return; + // } + // ias.CurrentGateWayId = ias.getAllGatewayDeviceInfo.GwId; + + // var infoIAS = ZbGateway.MainGateWay.AllGatewayDeviceList.Find(obj => obj.DeviceID == ias.DeviceID && obj.DeviceAddr == ias.DeviceAddr && obj.DeviceEpoint == ias.DeviceEpoint); + // if (infoIAS == null) + // { + // ZbGateway.MainGateWay.AllGatewayDeviceList.Add(ias); + // ias.DeviceName = ias.getAllGatewayDeviceInfo.MacName; + // ias.DeviceEpointName = ias.getAllGatewayDeviceInfo.DeviceName; + // ias.ImgVersion = ias.getAllGatewayDeviceInfo.ImgVersion; + // ias.IsOnline = ias.getAllGatewayDeviceInfo.IsOnline; + // ias.IasDeviceType = ias.getAllGatewayDeviceInfo.DeviceType; + // ias.Profile = ias.getAllGatewayDeviceInfo.Profile; + // ias.ImgTypeId = ias.getAllGatewayDeviceInfo.ImgTypeId; + // ias.InClusterList = ias.getAllGatewayDeviceInfo.InClusterList; + // ias.OutClusterList = ias.getAllGatewayDeviceInfo.OutClusterList; + // ias.AttributeStatus = ias.getAllGatewayDeviceInfo.AttributeStatus; + // ias.Save(); + // } + // else + // { + // infoIAS.DeviceName = ias.getAllGatewayDeviceInfo.MacName; + // infoIAS.DeviceEpointName = ias.getAllGatewayDeviceInfo.DeviceName; + // infoIAS.getAllGatewayDeviceInfo = ias.getAllGatewayDeviceInfo; + // infoIAS.ImgVersion = ias.getAllGatewayDeviceInfo.ImgVersion; + // infoIAS.IsOnline = ias.getAllGatewayDeviceInfo.IsOnline; + // infoIAS.IasDeviceType = ias.getAllGatewayDeviceInfo.DeviceType; + // infoIAS.Profile = ias.getAllGatewayDeviceInfo.Profile; + // infoIAS.ImgTypeId = ias.getAllGatewayDeviceInfo.ImgTypeId; + // infoIAS.InClusterList = ias.getAllGatewayDeviceInfo.InClusterList; + // infoIAS.OutClusterList = ias.getAllGatewayDeviceInfo.OutClusterList; + // infoIAS.AttributeStatus = ias.getAllGatewayDeviceInfo.AttributeStatus; + // ias.ReSave(); + // } + // System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); + // break; + // case DeviceType.OtaDevice: + // case DeviceType.OtaPanelDevice: + // var ota = new OTADevice() { Time = jobject.Value<int>("Time"), DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID") }; + // ota.getAllGatewayDeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<AllGatewayDeviceInfo>(jobject["Data"].ToString()); + // if (ota.getAllGatewayDeviceInfo == null) + // { + // return; + // } + // ota.CurrentGateWayId = ota.getAllGatewayDeviceInfo.GwId; + + // var infoOta = ZbGateway.MainGateWay.AllGatewayDeviceList.Find(obj => obj.DeviceID == ota.DeviceID && obj.DeviceAddr == ota.DeviceAddr && obj.DeviceEpoint == ota.DeviceEpoint); + // if (infoOta == null) + // { + // ZbGateway.MainGateWay.AllGatewayDeviceList.Add(ota); + // ota.DeviceName = ota.getAllGatewayDeviceInfo.MacName; + // ota.DeviceEpointName = ota.getAllGatewayDeviceInfo.DeviceName; + // ota.ImgVersion = ota.getAllGatewayDeviceInfo.ImgVersion; + // ota.IsOnline = ota.getAllGatewayDeviceInfo.IsOnline; + // ota.IasDeviceType = ota.getAllGatewayDeviceInfo.DeviceType; + // ota.Profile = ota.getAllGatewayDeviceInfo.Profile; + // ota.ImgTypeId = ota.getAllGatewayDeviceInfo.ImgTypeId; + // ota.InClusterList = ota.getAllGatewayDeviceInfo.InClusterList; + // ota.OutClusterList = ota.getAllGatewayDeviceInfo.OutClusterList; + // ota.AttributeStatus = ota.getAllGatewayDeviceInfo.AttributeStatus; + // ota.Save(); + // } + // else + // { + // infoOta.DeviceName = ota.getAllGatewayDeviceInfo.MacName; + // infoOta.DeviceEpointName = ota.getAllGatewayDeviceInfo.DeviceName; + // infoOta.getAllGatewayDeviceInfo = ota.getAllGatewayDeviceInfo; + // infoOta.ImgVersion = ota.getAllGatewayDeviceInfo.ImgVersion; + // infoOta.IsOnline = ota.getAllGatewayDeviceInfo.IsOnline; + // infoOta.IasDeviceType = ota.getAllGatewayDeviceInfo.DeviceType; + // infoOta.Profile = ota.getAllGatewayDeviceInfo.Profile; + // infoOta.ImgTypeId = ota.getAllGatewayDeviceInfo.ImgTypeId; + // infoOta.InClusterList = ota.getAllGatewayDeviceInfo.InClusterList; + // infoOta.OutClusterList = ota.getAllGatewayDeviceInfo.OutClusterList; + // infoOta.AttributeStatus = ota.getAllGatewayDeviceInfo.AttributeStatus; + // ota.ReSave(); + // } + // System.Console.WriteLine($"鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); + // break; + // //case DeviceType.Thermostat: + // //var thermostat = new ThermostatObj() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID }; + // //thermostat.DeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<ThermostatObj.DeviceInfoData>(jobject["Data"].ToString()); + // //if (thermostat.DeviceInfo == null) + // //{ + // // return; + // //} + // // var ther = ZbGateway.MainGateWay.AllGatewayDeviceList.Find(obj => obj.DeviceID == thermostat.DeviceID && obj.DeviceAddr == thermostat.DeviceAddr && obj.DeviceEpoint == thermostat.DeviceEpoint); + // //if (ther == null) + // //{ + // // thermostat.DeviceName = thermostat.DeviceInfo.DeviceName; + // // ZbGateway.MainGateWay.AllGatewayDeviceList.Add(thermostat); + // //} + // //else + // //{ + // // thermostat.DeviceName = thermostat.DeviceInfo.DeviceName; + // // ZigBee.IO.LocalFileUtils.SaveDeviceInfo(thermostat, thermostat.DeviceEpoint.ToString()); + // //} + // //break; + // //case DeviceType.TemperatureSensor: + // // var temperatureSensor = new TemperatureSensor() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo.gwID }; + // // temperatureSensor.DeviceInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<TemperatureSensor.DeviceInfoData>(jobject["Data"].ToString()); + // // if (temperatureSensor.DeviceInfo == null) + // // { + // // return; + // // } + // // var ts = ZbGateway.MainGateWay.AllGatewayDeviceList.Find(obj => obj.DeviceID == temperatureSensor.DeviceID && obj.DeviceAddr == temperatureSensor.DeviceAddr && obj.DeviceEpoint == temperatureSensor.DeviceEpoint); + // // if (ts == null) + // // { + // // temperatureSensor.DeviceName = temperatureSensor.DeviceInfo.DeviceName; + // // ZbGateway.MainGateWay.AllGatewayDeviceList.Add(temperatureSensor); + + // // } + // // else + // // { + // // temperatureSensor.DeviceName = temperatureSensor.DeviceInfo.DeviceName; + // // IO.LocalFileUtils.SaveDeviceInfo(temperatureSensor, temperatureSensor.DeviceEpoint.ToString()); + // // } + // // break; + + // } + // } + // }; + + // ZbGateway.MainGateWay.Actions += action; + // System.Console.WriteLine("MainGatewayDeviceInfo_Actions 鍚姩" + System.DateTime.Now.ToString()); + + // var jObject = new JObject { { "Cluster_ID", 0 }, { "Command", 90 } }; + // ZbGateway.MainGateWay.CurrentGateWayId = ZbGateway.MainGateWay.getGatewayBaseInfo?.gwID; + // ZbGateway.MainGateWay.Send("GetAllDeviceInfo", Common.SecuritySet.Encryption(jObject.ToString())); + + // while ((DateTime.Now - dateTime).TotalMilliseconds < 4000) + // { + // await System.Threading.Tasks.Task.Delay(100); + // } + + // ZbGateway.MainGateWay.Actions -= action; + // System.Console.WriteLine("MainGatewayDeviceInfo_Actions 閫�鍑�" + System.DateTime.Now.ToString()); + // return ZbGateway.MainGateWay.AllGatewayDeviceList; + // })); + //} + #endregion + + #region 缃戝叧鎭㈠鍑哄巶璁剧疆 + /// <summary> + /// 缃戝叧鎭㈠鍑哄巶璁剧疆杩斿洖鐨勬暟鎹�. + /// </summary> + public GwLinuxResetResponData gwLinuxResetResponData; + /// <summary> + /// 缃戝叧鎭㈠鍑哄巶璁剧疆杩斿洖鐨勬暟鎹�. + /// </summary> + [System.Serializable] + public class GwLinuxResetResponData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>缃戝叧鎭㈠鍑哄巶璁剧疆</para> + /// </summary> + public ErrorResponData errorResponData; + ///<summary > + /// <para>0锛氬懡浠ゅ凡鎺ユ敹锛岀郴缁熷嵆灏嗘仮澶嶅嚭鍘傚苟閲嶅惎銆�</para> + /// </summary> + public int Result = 2; + } + #endregion + + #region 閲嶅惎缃戝叧绯荤粺 + + /// <summary> + /// 閲嶅惎缃戝叧绯荤粺杩斿洖鏁版嵁 + /// </summary> + public GwRebootResponAllData gwRebootResponAllData; + /// <summary> + /// 閲嶅惎缃戝叧绯荤粺杩斿洖鏁版嵁 + /// </summary> + [System.Serializable] + public class GwRebootResponAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + ///<summary > + /// <para>杩斿洖鍊兼槸0:鍛戒护宸叉帴鏀讹紝绯荤粺鍗冲皢閲嶅惎銆�</para> + /// </summary> + public int Result = 999; + } + + /// <summary> + /// 閲嶅惎缃戝叧绯荤粺杩斿洖鏁版嵁 + /// </summary> + public GwRebootResponData gwRebootResponData; + /// <summary> + /// 閲嶅惎缃戝叧绯荤粺杩斿洖鏁版嵁 + /// </summary> + [System.Serializable] + public class GwRebootResponData + { + ///<summary > + /// 0锛氬懡浠ゅ凡鎺ユ敹锛岀郴缁熷嵆灏嗛噸鍚�� + /// </summary> + public int Result = 999; + } + + #endregion + + #region 缃戝叧鍜屽崗璋冨櫒鍗囩骇 + /// <summary> + /// 淇濆瓨zigbee鍗忚皟鍣ㄧ粍缃戜俊鎭�,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + public SaveNVFileResponseAllData saveNVFileResponseData; + /// <summary> + /// 淇濆瓨zigbee鍗忚皟鍣ㄧ粍缃戜俊鎭�,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + [System.Serializable] + public class SaveNVFileResponseAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 淇濆瓨zigbee鍗忚皟鍣ㄧ粍缃戜俊鎭� + /// </summary> + public SaveNVFileResponseData saveNVFileResponseData; + } + + /// <summary> + /// 淇濆瓨zigbee鍗忚皟鍣ㄧ粍缃戜俊鎭� + /// </summary> + public SaveNVFileResponseData zbGwOperationSaveNVFileData; + /// <summary> + /// 淇濆瓨zigbee鍗忚皟鍣ㄧ粍缃戜俊鎭� + /// </summary> + [System.Serializable] + public class SaveNVFileResponseData + { + /// <summary> + /// 淇敼鍚庣殑缃戝叧鍚嶇О + ///<para>0锛氫繚瀛樻垚鍔�</para> + ///<para>1锛氭枃浠跺垱寤哄け璐�</para> + ///<para>2锛歂V鍒嗗尯璇诲彇鍑洪敊 </para> + /// </summary> + public int Flag = 999; + } + #endregion + + #region 鍗忚皟鍣ㄦ仮澶嶇粍缃戜俊鎭� + /// <summary> + /// 鍗忚皟鍣ㄦ仮澶嶇粍缃戜俊鎭�,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + public RestoreNVAllDtta restoreNVAllDtta; + /// <summary> + /// 鍗忚皟鍣ㄦ仮澶嶇粍缃戜俊鎭�,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + [System.Serializable] + public class RestoreNVAllDtta + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 鍗忚皟鍣ㄦ仮澶嶇粍缃戜俊鎭� + /// </summary> + public RestoreNVDtta restoreNVDtta; + } + + /// <summary> + /// 鍗忚皟鍣ㄦ仮澶嶇粍缃戜俊鎭� + /// </summary> + public RestoreNVDtta restoreNVDtta; + /// <summary> + /// 鍗忚皟鍣ㄦ仮澶嶇粍缃戜俊鎭� + /// </summary> + [System.Serializable] + public class RestoreNVDtta + { + /// <summary> + /// 淇敼鍚庣殑缃戝叧鍚嶇О + /// <para>0锛氭仮澶嶆垚鍔�</para> + ///<para>1锛氭枃浠朵笉瀛樺湪锛屾仮澶嶅け璐�</para> + ///<para>2锛歂V鍒嗗尯鍐欏叆閿欒锛屾仮澶嶅け璐�</para> + ///<para>7锛氭枃浠朵笉鍚堟硶</para> + /// </summary> + public int Flag = 999; + } + #endregion + + #region 鍗忚皟鍣ㄥ崌绾� + /// <summary> + /// 鍗忚皟鍣ㄥ崌绾�,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + public ZbGwOperationUpgradeAllData zbGwOperationUpgradeAllData; + /// <summary> + /// 鍗忚皟鍣ㄥ崌绾�,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + [System.Serializable] + public class ZbGwOperationUpgradeAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 鍗忚皟鍣ㄥ崌绾� + /// </summary> + public ZbGwOperationUpgradeData bGwOperationUpgradeData; + } + + /// <summary> + /// 鍗忚皟鍣ㄥ崌绾� + /// </summary> + public ZbGwOperationUpgradeData zbGwOperationUpgradeData; + /// <summary> + /// 鍗忚皟鍣ㄥ崌绾� + /// </summary> + [System.Serializable] + public class ZbGwOperationUpgradeData + { + /// <summary> + /// 淇敼鍚庣殑缃戝叧鍚嶇О + /// <para>0锛氬崌绾у畬鎴�</para> + ///<para>1锛氭病鏈夋壘鍒板崌绾ф枃浠讹紝鎴栧崌绾ф枃浠舵墦寮�澶辫触銆�</para> + ///<para>2锛氭鍦ㄥ崌绾�</para> + ///<para>3锛氬啓鍏ュ垎鍖哄嚭閿�</para> + ///<para>7锛氬崌绾ф枃浠朵笉鍚堟硶銆�</para> + ///<para>8锛氭湭鐭ラ敊璇�</para> + ///<para>9锛氬崌绾ф枃浠跺悕绉颁腑鏃犫�淶BMODULE鈥濇爣璇嗐��</para> + /// </summary> + public int Flag = 999; + /// <summary> + /// 淇敼鍚庣殑缃戝叧鍚嶇О + /// <para>鍗囩骇杩涘害銆�0-100琛ㄧず0-100% ,璇ュ瓧娈靛湪Flag =2鏃舵墠瀛樺湪</para> + /// </summary> + public int Percent; + } + #endregion + + #region 鍗囩骇铏氭嫙椹卞姩璁惧鏁版嵁 + /// <summary> + /// 鍗囩骇铏氭嫙椹卞姩璁惧,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + public VirtualDriveUpgradeResponseAllData virtualDriveUpgradeResponseAllData; + /// <summary> + /// 鍗囩骇铏氭嫙椹卞姩璁惧,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + [System.Serializable] + public class VirtualDriveUpgradeResponseAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 鍗囩骇铏氭嫙椹卞姩璁惧 + /// </summary> + public VirtualDriveUpgradeResponData virtualDriveUpgradeResponData; + } + /// <summary> + /// 鍗囩骇铏氭嫙椹卞姩璁惧 + /// </summary> + public VirtualDriveUpgradeResponData virtualDriveUpgradeResponData; + [System.Serializable] + public class VirtualDriveUpgradeResponData + { + /// 0锛氬崌绾у畬鎴� + ///<para>1锛氭病鏈夋壘鍒板崌绾ф枃浠讹紝鎴栧崌绾ф枃浠舵墦寮�澶辫触銆倂 + ///<para>2锛氭鍦ㄥ崌绾�</para> + ///<para>3锛氬啓鍏ュ垎鍖哄嚭閿�</para> + ///<para>7锛氬崌绾ф枃浠朵笉鍚堟硶銆�</para> + ///<para>8锛氭湭鐭ラ敊璇�</para> + ///<para>10锛氶敊璇紝椹卞姩浠e彿涓嶅瓨鍦�</para> + public int Flag; + + /// <summary> + ///椹卞姩浠e彿 + /// </summary> + public int DriveCode; + + /// <summary> + ///鍗囩骇杩涘害銆�0-100琛ㄧず0-100%(璇ュ瓧娈靛湪Flag =2鏃舵墠鏈夋晥) + /// </summary> + public int Percent; + } + #endregion + + #region 鏌ョ湅缃戝叧璁板綍鐨勮櫄鎷熼┍鍔ㄦ暟鎹� + /// <summary> + /// 鏌ョ湅缃戝叧璁板綍鐨勮櫄鎷熼┍鍔�,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + public CheckVDDriveCodeResponseAllData checkVDDriveCodeResponseAllData; + /// <summary> + /// 鏌ョ湅缃戝叧璁板綍鐨勮櫄鎷熼┍鍔�,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + [System.Serializable] + public class CheckVDDriveCodeResponseAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 鏌ョ湅缃戝叧璁板綍鐨勮櫄鎷熼┍鍔� + /// </summary> + public VDriveDriveCodeResponData vDriveDriveCodeResponData; + } + /// <summary> + /// 鏌ョ湅缃戝叧璁板綍鐨勮櫄鎷熼┍鍔� + /// </summary> + public VDriveDriveCodeResponData vDriveDriveCodeResponData; + [System.Serializable] + public class VDriveDriveCodeResponData + { + /// <summary> + /// 椹卞姩浠e彿鍒楄〃 + /// </summary> + public List<DriveCodeObj> DriveCodeList = new List<DriveCodeObj>(); + } + /// <summary> + /// 铏氭嫙椹卞姩 + /// </summary> + [System.Serializable] + public class DriveCodeObj + { + /// <summary> + /// 椹卞姩浠e彿 + /// </summary> + public int DriveCode; + /// <summary> + /// 椹卞姩纭欢鐗堟湰 + /// </summary> + public int DriveHwVersion; + /// <summary> + /// 椹卞姩杞欢鐗堟湰 + /// </summary> + public int DriveFwVersion; + /// <summary> + /// 椹卞姩鍥轰欢绫诲瀷 + /// </summary> + public int DriveImageType; + /// <summary> + /// 椹卞姩鏍囪瘑绗� + /// </summary> + public int DriveId; + } + #endregion + + #region 缃戝叧绯荤粺鍗囩骇 + /// <summary> + /// 缃戝叧绯荤粺鍗囩骇,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + public LinuxUpgradeAllData linuxUpgradeAllData; + /// <summary> + /// 缃戝叧绯荤粺鍗囩骇,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + [System.Serializable] + public class LinuxUpgradeAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 0锛氭甯革紙榛樿鍥炲锛� + ///<para>1锛氭壘涓嶅埌鍗囩骇鍥轰欢锛岃矾寰勬垨鍗囩骇鍥轰欢鍚嶇О閿欒銆�</para> + ///<para>2锛氬浐浠朵笉鍚堟硶銆傦紙濡傛灉寮哄埗鍗囩骇锛屽垯杩斿洖姝e父锛孯esult=0锛�</para> + ///<para>3锛氬崌绾у浐浠惰繃澶э紙浣跨敤16MFlash鏃跺浐浠跺ぇ灏忎笉寰楄秴杩�16449536B锛�</para> + ///<para>4锛氬崌绾ф枃浠跺悕绉颁腑鏃犫�淟INUXMODULE鈥濇爣璇嗐��</para> + ///</summary> + public int Result = 999; + } + #endregion + + #region 鑾峰彇鍗忚皟鍣ㄥ綋鍓嶄俊閬�. + /// <summary> + /// 鑾峰彇鍗忚皟鍣ㄥ綋鍓嶄俊閬�,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + public GwGetChannelResponData zbGwGetChannelResponData; + /// <summary> + /// 鑾峰彇鍗忚皟鍣ㄥ綋鍓嶄俊閬�,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + [System.Serializable] + public class GwGetChannelResponData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 鍗忚皟鍣ㄥ綋鍓嶄俊閬� + /// </summary> + public int channel = 999; + } + + #endregion + + #region 鏇存敼鍗忚皟鍣ㄥ綋鍓嶄俊閬�. + /// <summary> + /// 鏇存敼鍗忚皟鍣ㄥ綋鍓嶄俊閬�,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + public ChangeChannelResponAllData changeChannelResponAllData; + /// <summary> + /// 鏇存敼鍗忚皟鍣ㄥ綋鍓嶄俊閬�,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + [System.Serializable] + public class ChangeChannelResponAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 鏇存敼鍗忚皟鍣ㄥ綋鍓嶄俊閬撴暟鎹� + /// </summary> + public ChangeChannelResponData changeChannelResponData; + } + + /// <summary> + /// 鏇存敼鍗忚皟鍣ㄥ綋鍓嶄俊閬撴暟鎹� + /// </summary> + public ChangeChannelResponData changeChannelResponData; + /// <summary> + /// 鏇存敼鍗忚皟鍣ㄥ綋鍓嶄俊閬撴暟鎹� + /// </summary> + [System.Serializable] + public class ChangeChannelResponData + { + /// <summary> + /// 鏄惁閰嶇疆鎴愬姛 + ///<para>0锛氭垚鍔�</para> + ///<para>1锛氬け璐�</para> + ///<para>2锛氶厤缃殑淇¢亾涓烘棤鏁堝��</para> + /// </summary> + public int Status = 999; + /// <summary> + /// 鍗忚皟鍣ㄥ綋鍓嶄俊閬� + /// </summary> + public int Channel = 999; + } + #endregion + + //#region 鑾峰彇鍗忚皟鍣ㄨ幏鍙栧崗璋冨櫒褰撳墠鍙戝皠鍔熺巼. + /////<summary > + ///// 鑾峰彇鍗忚皟鍣ㄨ幏鍙栧崗璋冨櫒褰撳墠鍙戝皠鍔熺巼 + ///// </summary> + //public static async System.Threading.Tasks.Task<GwGetPowerResponData> GetPowerAsync(ZigBee.Device.ZbGateway gateway) + //{ + // if (gateway == null) + // { + // return null; + // } + // return await System.Threading.Tasks.Task.Run(async () => + // { + // GwGetPowerResponData d = null; + // Action<string, string> action = (topic, message) => + // { + // var gatewayID = topic.Split('/')[0]; + // var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); + + // if (topic == gatewayID + "/" + "Error_Respon") + // { + // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; + // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + + // if (temp == null) + // { + // d = new GwGetPowerResponData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; + // } + // else + // { + // d = new GwGetPowerResponData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + + // } + // } + + // if (topic == gatewayID + "/" + "ZbGw/GetPower_Respon") + // { + // var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; + // var power = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["Power"].ToString()); + + // if (power == 0) + // { + // d = new GwGetPowerResponData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; + // } + // else + // { + // d = new GwGetPowerResponData { power = power }; + // DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); + // } + // } + // }; + + // gateway.Actions += action; + // System.Console.WriteLine("GetPower_Actions 鍚姩" + "_" + System.DateTime.Now.ToString()); + + // var jObject = new JObject { { "Cluster_ID", 64512 }, { "Command", 10 } }; + // gateway.Send(("ZbGw/GetPower"), Common.SecuritySet.Encryption((jObject.ToString()))); + + // var dateTime = DateTime.Now; + // while ((DateTime.Now - dateTime).TotalMilliseconds < 1000) + // { + // await System.Threading.Tasks.Task.Delay(10); + // if (d != null) + // { + // break; + // } + // } + // if ((DateTime.Now - dateTime).TotalMilliseconds > 1000) + // { + // d = new GwGetPowerResponData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; + + // } + // gateway.Actions -= action; + // System.Console.WriteLine("GetPower_Actions 閫�鍑�" + "_" + System.DateTime.Now.ToString()); + + // return d; + // }); + //} + + ///// <summary> + ///// 鑾峰彇鍗忚皟鍣ㄨ幏鍙栧崗璋冨櫒褰撳墠鍙戝皠鍔熺巼,缃戝叧鍙嶉鍏蜂綋淇℃伅 + ///// </summary> + //public GwGetPowerResponData gwGetPowerResponData; + ///// <summary> + ///// 鑾峰彇鍗忚皟鍣ㄨ幏鍙栧崗璋冨櫒褰撳墠鍙戝皠鍔熺巼,缃戝叧鍙嶉鍏蜂綋淇℃伅 + ///// </summary> + //[System.Serializable] + //public class GwGetPowerResponData + //{ + // /// <summary> + // /// 閿欒淇℃伅 + // /// </summary> + // public string errorMessageBase; + // /// <summary> + // /// 缃戝叧淇℃伅閿欒鍙嶉 + // /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + // /// </summary> + // public ErrorResponData errorResponData; + // /// <summary> + // /// 鍗忚皟鍣ㄥ彂灏勫姛鐜� + // /// </summary> + // public int power = 999; + //} + + //#endregion + + //#region 璁剧疆鍙戝皠鍔�. + /////<summary > + /////璁剧疆鍙戝皠鍔熺巼 + ///// <para>power:瑕佹洿鏀圭殑璁惧鍙戝皠鍔熺巼锛屽彲璁剧疆8,10,11,13,15,16,18,19,20,21,22(dBm)</para> + ///// </summary> + //public static async System.Threading.Tasks.Task<SetPowerResponAllData> GwSetPowerAsync(ZigBee.Device.ZbGateway gateway, int power) + //{ + // if (gateway == null) + // { + // return null; + // } + // return await System.Threading.Tasks.Task.Run(async () => + // { + // SetPowerResponAllData d = null; + // Action<string, string> action = (topic, message) => + // { + // var gatewayID = topic.Split('/')[0]; + // var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); + + // if (topic == gatewayID + "/" + "Error_Respon") + // { + // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; + // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + + // if (temp == null) + // { + // d = new SetPowerResponAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; + // } + // else + // { + // d = new SetPowerResponAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + // } + // } + + // if (topic == gatewayID + "/" + "ZbGw/SetPower_Respon") + // { + // var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; + // var tempInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<SetPoweResponData>(jobject["Data"].ToString()); + + // if (tempInfo == null) + // { + // d = new SetPowerResponAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; + // } + // else + // { + // d = new SetPowerResponAllData { setPoweResponData = tempInfo }; + // DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); + // } + // } + // }; + + // gateway.Actions += action; + // System.Console.WriteLine("ZbGw/SetPower_Actions 鍚姩" + "_" + System.DateTime.Now.ToString()); + + // var jObject = new JObject { { "Cluster_ID", 64512 }, { "Command", 11 } }; + // var data = new JObject { { "Power", power } }; + // jObject.Add("Data", data); + // gateway.Send(("ZbGw/SetPower"), Common.SecuritySet.Encryption(jObject.ToString(),Password)); + + // var dateTime = DateTime.Now; + // while ((DateTime.Now - dateTime).TotalMilliseconds < 1000) + // { + // await System.Threading.Tasks.Task.Delay(10); + // if (d != null) + // { + // break; + // } + // } + // if ((DateTime.Now - dateTime).TotalMilliseconds > 1000) + // { + // d = new SetPowerResponAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; + // } + // gateway.Actions -= action; + // System.Console.WriteLine("ZbGw/SetPower_Actions閫�鍑�" + "_" + System.DateTime.Now.ToString()); + + // return d; + // }); + //} + + ///// <summary> + ///// 璁剧疆鍙戝皠鍔熺巼,缃戝叧鍙嶉鍏蜂綋淇℃伅 + ///// </summary> + //public SetPowerResponAllData setPoweResponAllData; + ///// <summary> + ///// 璁剧疆鍙戝皠鍔熺巼,缃戝叧鍙嶉鍏蜂綋淇℃伅 + ///// </summary> + //[System.Serializable] + //public class SetPowerResponAllData + //{ + // /// <summary> + // /// 閿欒淇℃伅 + // /// </summary> + // public string errorMessageBase; + // /// <summary> + // /// 缃戝叧淇℃伅閿欒鍙嶉 + // /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + // /// </summary> + // public ErrorResponData errorResponData; + // /// <summary> + // /// 璁剧疆鍙戝皠鍔熺巼鏁版嵁 + // /// </summary> + // public SetPoweResponData setPoweResponData; + //} + + ///// <summary> + ///// 璁剧疆鍙戝皠鍔熺巼鏁版嵁 + ///// </summary> + //public SetPoweResponData setPoweResponData; + ///// <summary> + ///// 璁剧疆鍙戝皠鍔熺巼鏁版嵁 + ///// </summary> + //[System.Serializable] + //public class SetPoweResponData + //{ + // /// <summary> + // /// 鏄惁閰嶇疆鎴愬姛 + // ///<para>0锛氭垚鍔�</para> + // ///<para>2锛氶厤缃殑淇¢亾涓烘棤鏁堝��</para> + // /// </summary> + // public int Status = 999; + // /// <summary> + // /// 鍔熺巼 + // /// </summary> + // public int Power = 999; + //} + //#endregion + + //#region 璇诲彇褰撳墠灞�鍩熺綉鐨凱ANID. + /////<summary > + ///// 璇诲彇褰撳墠灞�鍩熺綉鐨凱ANID + ///// </summary> + //public static async System.Threading.Tasks.Task<GetPanIdResponData> ReadPanIdAsync(ZigBee.Device.ZbGateway gateway) + //{ + // if (gateway == null) + // { + // return null; + // } + // return await System.Threading.Tasks.Task.Run(async () => + // { + // GetPanIdResponData d = null; + // Action<string, string> action = (topic, message) => + // { + // var gatewayID = topic.Split('/')[0]; + // var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); + + // if (topic == gatewayID + "/" + "Error_Respon") + // { + // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; + // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + + // if (temp == null) + // { + // d = new GetPanIdResponData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; + // } + // else + // { + // d = new GetPanIdResponData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + // } + // } + + // if (topic == gatewayID + "/" + "ZbGw/GetPanId_Respon") + // { + // var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; + // var panID = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"]["PANID"].ToString()); + + // if (panID == null) + // { + // d = new GetPanIdResponData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; + + // } + // else + // { + // d = new GetPanIdResponData { panID = panID }; + // DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); + // } + // } + // }; + + // gateway.Actions += action; + // System.Console.WriteLine("ZbGw/GetPanId_Actions 鍚姩" + "_" + System.DateTime.Now.ToString()); + + // var jObject = new JObject { { "Cluster_ID", 64512 }, { "Command", 12 } }; + // gateway.Send(("ZbGw/GetPanId"), Common.SecuritySet.Encryption((jObject.ToString()))); + + // var dateTime = DateTime.Now; + // while ((DateTime.Now - dateTime).TotalMilliseconds < 1000) + // { + // await System.Threading.Tasks.Task.Delay(10); + // if (d != null) + // { + // break; + // } + // } + // if ((DateTime.Now - dateTime).TotalMilliseconds > 1000) + // { + // d = new GetPanIdResponData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; + // } + // gateway.Actions -= action; + // System.Console.WriteLine("ZbGw/GetPanId_Actions 閫�鍑�" + "_" + System.DateTime.Now.ToString()); + + // return d; + // }); + //} + + ///// <summary> + ///// 璇诲彇褰撳墠灞�鍩熺綉鐨凱ANID,缃戝叧鍙嶉鍏蜂綋淇℃伅 + ///// </summary> + //public GetPanIdResponData getPanIdResponData; + ///// <summary> + ///// 璇诲彇褰撳墠灞�鍩熺綉鐨凱ANID,缃戝叧鍙嶉鍏蜂綋淇℃伅 + ///// </summary> + //[System.Serializable] + //public class GetPanIdResponData + //{ + // /// <summary> + // /// 閿欒淇℃伅 + // /// </summary> + // public string errorMessageBase; + // /// <summary> + // /// 缃戝叧淇℃伅閿欒鍙嶉 + // /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + // /// </summary> + // public ErrorResponData errorResponData; + // /// <summary> + // /// 褰撳墠缃戠粶鐨凱ANID + // /// </summary> + // public int panID = 999; + //} + + //#endregion + + //#region 璇诲彇鍗忚皟鍣∕AC鍦板潃. + /////<summary > + ///// 璇诲彇鍗忚皟鍣∕AC鍦板潃 + ///// </summary> + //public static async System.Threading.Tasks.Task<GetMacResponData> ReadMacAsync(ZigBee.Device.ZbGateway gateway) + //{ + // if (gateway == null) + // { + // return null; + // } + // return await System.Threading.Tasks.Task.Run(async () => + // { + // GetMacResponData d = null; + // Action<string, string> action = (topic, message) => + // { + // var gatewayID = topic.Split('/')[0]; + // var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); + + // if (topic == gatewayID + "/" + "Error_Respon") + // { + // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; + // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + + // if (temp == null) + // { + // d = new GetMacResponData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" }; + // } + // else + // { + // d = new GetMacResponData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) }; + // } + // } + + // if (topic == gatewayID + "/" + "ZbGw/GetMac_Respon") + // { + // var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; + // var tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<MacAddrData>(jobject["Data"].ToString()); + + // if (tempData == null) + // { + // d = new GetMacResponData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" }; + // } + // else + // { + // d = new GetMacResponData { macAddrData = tempData }; + // DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); + // } + // } + // }; + + // gateway.Actions += action; + // var jObject = new JObject { { "Cluster_ID", 64512 }, { "Command", 13 } }; + // gateway.Send(("ZbGw/GetMac"), Common.SecuritySet.Encryption((jObject.ToString()))); + + // var dateTime = DateTime.Now; + // while ((DateTime.Now - dateTime).TotalMilliseconds < 1000) + // { + // await System.Threading.Tasks.Task.Delay(10); + // if (d != null) + // { + // break; + // } + // } + // if ((DateTime.Now - dateTime).TotalMilliseconds > 10000) + // { + // d = new GetMacResponData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" }; + // } + // gateway.Actions -= action; + // return d; + // }); + //} + + /// <summary> + /// 璇诲彇鍗忚皟鍣∕AC鍦板潃,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + public GetMacResponData getMacResponData; + /// <summary> + /// 璇诲彇鍗忚皟鍣∕AC鍦板潃,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + [System.Serializable] + public class GetMacResponData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 鍗忚皟鍣╩ac鍦板潃 + /// </summary> + public MacAddrData macAddrData; + } + /// <summary> + /// 璇诲彇鍗忚皟鍣∕AC鍦板潃,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + [System.Serializable] + public class MacAddrData + { + /// <summary> + /// 鍗忚皟鍣╩ac鍦板潃 + /// </summary> + public string MacAddr; + } + + //#endregion + + #region 娣诲姞Install Codes鐮� + /////<summary > + /////娣诲姞Install Codes鐮� + ///// <para>installCode:InstallCode鐮� 36涓瓧绗�</para> + ///// <para>installCodeAddr:InstallCodes鐮佽澶囩殑mac鍦板潃16涓瓧绗�</para> + ///// </summary> + //public static async System.Threading.Tasks.Task<InstallCodeResponData> InstallCodeAsync(ZigBee.Device.ZbGateway gateway, string installCode, string installCodeAddr) + //{ + // if (gateway == null) + // { + // return null; + // } + // return await System.Threading.Tasks.Task.Run(async () => + // { + // var d = new InstallCodeResponData { }; + // Action<string, string> action = (topic, message) => + // { + // var gatewayID = topic.Split('/')[0]; + // var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); + + // if (topic == gatewayID + "/" + "Error_Respon") + // { + // var gatewayTemp = new ZbGateway() { Time = jobject.Value<int>("Time"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; + // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + + // if (temp == null) + // { + // d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖"; + // } + // else + // { + // d.errorResponData = temp; + // d.errorMessageBase = ErrorMess(temp.Error); + // } + // } + + // if (topic == gatewayID + "/" + "ZbGw/InstallCode_Respon") + // { + // var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") }; + // var code = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(jobject["Data"].ToString()); + + // if (code == null) + // { + // d.errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�"; + // } + // else + // { + // d.Status = code; + // DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); + // } + // } + // }; + + // gateway.Actions += action; + // var jObject = new JObject { { "Cluster_ID", 64512 }, { "Command", 13 } }; + // gateway.Send(("ZbGw/GetMac"), Common.SecuritySet.Encryption((jObject.ToString()))); + + // var dateTime = DateTime.Now; + // while ((DateTime.Now - dateTime).TotalMilliseconds < 1000) + // { + // await System.Threading.Tasks.Task.Delay(10); + // //if (d.Status != 999) + // //{ + // // break; + // //} + // } + // if ((DateTime.Now - dateTime).TotalMilliseconds > 1000) + // { + // d.errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔"; + // } + // gateway.Actions -= action; + // return d; + // }); + //} + + /// <summary> + /// 娣诲姞Install Codes鐮�,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + public InstallCodeResponData installCodeResponData; + /// <summary> + /// 娣诲姞Install Codes鐮�,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + [System.Serializable] + public class InstallCodeResponData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 0:鎴愬姛锛�1:澶辫触 + /// </summary> + public int Status = 999; + } + + #endregion + + #region 鍚敤鎴栧叧闂�忎紶鏁版嵁涓婁紶鎺ュ彛 + /// <summary> + /// 閫忎紶鏁版嵁涓婁紶鎺ュ彛,缃戝叧鍙嶉淇℃伅 + /// </summary> + public PassthroughAllData passthroughAllData; + /// <summary> + /// 閫忎紶鏁版嵁涓婁紶鎺ュ彛,缃戝叧鍙嶉淇℃伅 + /// </summary> + [System.Serializable] + public class PassthroughAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 宸茬粡杞崲鎴愬瓧绗︽牸寮忕殑16杩涘埗鐨勯�忎紶鏁版嵁 + /// </summary> + public string passData; + } + #endregion + + //#region 鍗忚皟鍣ㄩ�氱敤鍔熻兘鎿嶄綔鎺ュ彛 + ///// <summary> + ///// 鍗忚皟鍣ㄩ�氱敤鍔熻兘鎿嶄綔鎺ュ彛 + ///// </summary> + ///// <returns>The or get all data async.</returns> + ///// <param name="gateway">Gateway.</param> + ///// <param name="commandID">Command identifier.</param> + ///// <param name="payload">Payload.</param> + //public static async System.Threading.Tasks.Task<SetOrGetAllData> SetOrGetAllDataAsync(ZigBee.Device.ZbGateway gateway, int commandID, string payload) + //{ + // if (gateway == null) + // { + // return null; + // } + // return await System.Threading.Tasks.Task.Run(async () => + // { + // var d = new SetOrGetAllData { }; + // Action<string, string> action = (topic, message) => + // { + // var gatewayID = topic.Split('/')[0]; + // var jobject = Newtonsoft.Json.Linq.JObject.Parse(message); + + // if (topic == gatewayID + "/" + "Error_Respon") + // { + // var gatewayTemp = new ZbGateway() { DeviceID = jobject.Value<int>("Device_ID"), DeviceAddr = jobject.Value<string>("DeviceAddr"), DeviceEpoint = jobject.Value<int>("Epoint"), DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; + // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<ZbGateway.ErrorResponData>(jobject["Data"].ToString()); + + // if (temp == null) + // { + // d.errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖"; + // } + // else + // { + // d.errorResponData = temp; + // d.errorMessageBase = ErrorMess(temp.Error); + // } + // } + + // if (topic == gatewayID + "/" + "ZbGw/SetOrGetData_Respon") + // { + // var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID"), CurrentGateWayId = gateway.getGatewayBaseInfo.gwID }; + // var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<SetOrGetData>(jobject["Data"].ToString()); + + // if (gatewayTemp.getGwVersion == null) + // { + // d.errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�"; + // } + // else + // { + // d.setOrGetData = temp; + // DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}"); + // } + // } + // }; + // gateway.Actions += action; + // System.Console.WriteLine("ZbDataPassthrough_Actions 鍚姩" + "_" + System.DateTime.Now.ToString()); + + // var jObject = new JObject { { "Cluster_ID", 64512 }, { "Command", 2 } }; + // var data = new JObject { { "Command_ID", commandID }, { "Payload", payload } }; + // jObject.Add("Data", data); + // gateway.Send("ZbGw/SetOrGetData", Common.SecuritySet.Encryption(jObject.ToString())); + // var dateTime = DateTime.Now; + // while ((DateTime.Now - dateTime).TotalMilliseconds < 1000) + // { + // await System.Threading.Tasks.Task.Delay(10); + // if (d.setOrGetData != null) + // { + // break; + // } + // } + // if ((DateTime.Now - dateTime).TotalMilliseconds > 10000) + // { + // d.errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔"; + // } + // gateway.Actions -= action; + // System.Console.WriteLine("GetGwVersionData_Actions 閫�鍑�" + System.DateTime.Now.ToString()); + + // return d; + // }); + //} + + ///// <summary> + ///// BDB鎺ュ彛,缃戝叧鍙嶉淇℃伅 + ///// </summary> + //public SetOrGetAllData setOrGetAllData; + ///// <summary> + ///// BDB鎺ュ彛,缃戝叧鍙嶉淇℃伅 + ///// </summary> + //[System.Serializable] + //public class SetOrGetAllData + //{ + // /// <summary> + // /// 閿欒淇℃伅 + // /// </summary> + // public string errorMessageBase; + // /// <summary> + // /// 缃戝叧淇℃伅閿欒鍙嶉 + // /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + // /// </summary> + // public ErrorResponData errorResponData; + // /// <summary> + // /// BDB鏁版嵁 + // /// </summary> + // public SetOrGetData setOrGetData; + + //} + + ///// <summary> + ///// BDB鏁版嵁 + ///// </summary> + //public SetOrGetData setOrGetData; + ///// <summary> + ///// BDB鏁版嵁 + ///// </summary> + //[System.Serializable] + //public class SetOrGetData + //{ + // /// <summary> + // /// 鍗忚皟鍣ㄦ寚浠ょ殑command_ID銆傚搴斻�婂崗璋冨櫒涓插彛閫氫俊鍗忚瑙勮寖銆嬬2绔犺妭鎸囦护鐨刢ommand_ID + // /// </summary> + // public int commandID; + // /// <summary> + // /// 宸茬粡杞崲鎴愬瓧绗︽牸寮忕殑16杩涘埗鐨刣ata鏁版嵁銆傚搴斻�婂崗璋冨櫒涓插彛閫氫俊鍗忚瑙勮寖銆嬬2绔犺妭鎸囦护鐨勨�滄暟鎹�濆唴瀹� + // /// </summary> + // public string payload; + //} + //#endregion + + #region 瀹㈡埛绔彂閫佹枃浠舵祦鍒扮綉鍏� + /// <summary> + /// 瀹㈡埛绔彂閫佹枃浠舵祦鍒扮綉鍏� + /// </summary> + [System.Serializable] + public class SendFileResponseAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 0: 鏁版嵁鍐欏叆鎴愬姛,璇锋眰鍙戦�佷笅涓�涓暟鎹寘 + ///<para>1锛氭暟鎹啓鍏ュけ璐�</para> + ///<para>2锛氭暟鎹В鏋愰敊璇�</para> + ///<para>3锛氬彂閫佹暟鎹ぇ灏忚秴鍑洪檺鍒�</para> + /// </summary> + public int Result = -1; + + } + + #endregion + + #region 瀹㈡埛绔彂閫佸垱寤烘枃浠跺懡浠� + /// <summary> + /// 瀹㈡埛绔彂閫佸垱寤烘枃浠跺懡浠�,缃戝叧鍙嶉淇℃伅 + /// </summary> + public CreateFileResponseAllData createFileResponseAllData; + /// <summary> + /// 瀹㈡埛绔彂閫佸垱寤烘枃浠跺懡浠�,缃戝叧鍙嶉淇℃伅 + /// </summary> + [System.Serializable] + public class CreateFileResponseAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 0锛氬垱寤烘垚鍔� + ///<para>1锛氬け璐ワ紝鏃犳硶鍒涘缓鏂囦欢</para> + ///<para>2锛氬け璐ワ紝璇ュ鎴风鏈夋枃浠惰繕娌′笂浼犲畬鎴愶紝璇风瓑寰呮枃浠朵笂浼犲畬姣曪紙涓�涓鎴风鍙兘鍚屾椂涓婁紶涓�涓枃浠讹級</para> + /// </summary> + public int Result = 999; + } + #endregion + + #region 鏌ョ湅缃戝叧鐩綍鏂囦欢淇℃伅 + /// <summary> + /// 鏌ョ湅缃戝叧鐩綍鏂囦欢淇℃伅,缃戝叧鍙嶉淇℃伅 + /// </summary> + public FileTransferLsDiResponseAllData fileTransferLsDiResponseAllData; + /// <summary> + /// 鏌ョ湅缃戝叧鐩綍鏂囦欢淇℃伅,缃戝叧鍙嶉淇℃伅 + /// </summary> + [System.Serializable] + public class FileTransferLsDiResponseAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 鏌ョ湅缃戝叧鐩綍鏂囦欢淇℃伅 + /// </summary> + public FileTransferLsDiResponseData fileTransferLsDiResponseData; + } + + /// <summary> + /// 鏌ョ湅缃戝叧鐩綍鏂囦欢淇℃伅,缃戝叧鍙嶉淇℃伅 + /// </summary> + public FileTransferLsDiResponseData fileTransferLsDiResponseData; + /// <summary> + /// 瀹㈡埛绔彂閫佸垱寤烘枃浠跺懡浠�,缃戝叧鍙嶉淇℃伅 + /// </summary> + [System.Serializable] + public class FileTransferLsDiResponseData + { + /// <summary> + ///0: 鎴愬姛 + ///<para>1锛氭煡鐪嬪け璐�</para> + /// </summary> + public int Result; + /// <summary> + /// 鐩綍鏂囦欢鍒楄〃 + /// </summary> + public List<DriObj> Dir = new List<DriObj>(); + } + + /// <summary> + /// 鐩綍鏂囦欢 + /// </summary> + [System.Serializable] + public class DriObj + { + /// <summary> + ///鏂囦欢锛堝寘鍚墍鍦ㄨ矾寰勫拰鏂囦欢鍚嶇О:濡�/usr/sbin/aa.txt锛� + /// </summary> + public string File; + + /// <summary> + ///鏂囦欢澶у皬锛坆yte锛� + /// </summary> + public int FileSize; + + /// <summary> + ///鏂囦欢鏈�鍚庝慨鏀圭殑utc鏃堕棿鎴� + /// </summary> + public int LastModifyTime; + } + #endregion + + #region 瀹㈡埛绔瀹氳涓嬭浇鐨勬枃浠跺悕绉板拰璺緞 + /// <summary> + /// 瀹㈡埛绔瀹氳涓嬭浇鐨勬枃浠跺悕绉板拰璺緞,缃戝叧鍙嶉淇℃伅 + /// </summary> + public SetDownloadFileResponseAllData setDownloadFileResponseAllData; + /// <summary> + /// 瀹㈡埛绔瀹氳涓嬭浇鐨勬枃浠跺悕绉板拰璺緞,缃戝叧鍙嶉淇℃伅 + /// </summary> + [System.Serializable] + public class SetDownloadFileResponseAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 瀹㈡埛绔瀹氳涓嬭浇鐨勬枃浠跺悕绉板拰璺緞 + /// </summary> + public SetDownloadFileResponseData setDownloadFileResponseData; + } + + /// <summary> + /// 瀹㈡埛绔瀹氳涓嬭浇鐨勬枃浠跺悕绉板拰璺緞,缃戝叧鍙嶉淇℃伅 + /// </summary> + public SetDownloadFileResponseData setDownloadFileResponseData; + /// <summary> + /// 瀹㈡埛绔瀹氳涓嬭浇鐨勬枃浠跺悕绉板拰璺緞,缃戝叧鍙嶉淇℃伅 + /// </summary> + [System.Serializable] + public class SetDownloadFileResponseData + { + /// <summary> + ///0锛氶粯璁� + ///<para>1锛氬け璐ワ紝鏂囦欢涓嶅瓨鍦ㄣ��</para> + ///<para>2锛欱lockStartAddress璁剧疆涓嶅悎鐞嗭紝瓒呭嚭鏂囦欢澶у皬鑼冨洿銆�</para> + ///<para>3锛氬綋鍓嶆湁鏂囦欢鍦ㄤ笅杞斤紝闇�瑕佺瓑寰呮鍦ㄨ繘琛岀殑涓嬭浇浠诲姟缁撴潫銆�</para> + /// </summary> + public int Result = -1; + /// <summary> + /// 缃戝叧鏂囦欢鍚嶇О + /// </summary> + //public string BackupFileName ; + /// <summary> + /// 缃戝叧涓搴旀枃浠朵腑鐨勬暟鎹唴瀹� + /// </summary> + //public byte[] BackupFileContent; + } + + #endregion + + #region 鏌ョ湅鍗曚釜鏂囦欢淇℃伅 + /// <summary> + /// 鏌ョ湅鍗曚釜鏂囦欢淇℃伅鏁版嵁 + /// </summary> + public FileTransferGetFileInfoResponseAllData fileTransferGetFileInfoResponseAllData; + /// <summary> + /// 鏌ョ湅鍗曚釜鏂囦欢淇℃伅鏁版嵁 + /// </summary> + [System.Serializable] + public class FileTransferGetFileInfoResponseAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 鏌ョ湅鍗曚釜鏂囦欢淇℃伅杩斿洖鐨勬暟鎹� + /// </summary> + public FileTransferGetFileInfoResponseData fileTransferGetFileInfoResponseData; + } + + /// <summary> + /// 鏌ョ湅鍗曚釜鏂囦欢淇℃伅杩斿洖鐨勬暟鎹� + /// </summary> + public FileTransferGetFileInfoResponseData fileTransferGetFileInfoResponseData; + /// <summary> + /// 鏌ョ湅鍗曚釜鏂囦欢淇℃伅杩斿洖鐨勬暟鎹� + /// </summary> + [System.Serializable] + public class FileTransferGetFileInfoResponseData + { + /// <summary> + /// 0: 鎴愬姛 + ///<para>1锛氭煡鐪嬪け璐ワ紝鏂囦欢涓嶅瓨鍦�</para> + /// </summary> + public int Result = -1; + /// <summary> + ///鏂囦欢锛堝寘鍚墍鍦ㄨ矾寰勫拰鏂囦欢鍚嶇О:濡�/etc/hdlDat/aa.txt锛� + /// </summary> + public string File; + /// <summary> + /// 鏂囦欢澶у皬锛坆yte锛�(褰揜esult = 0 鏃跺瓨鍦�) + /// </summary> + public int FileSize; + /// <summary> + /// 鏂囦欢鏈�鍚庝慨鏀圭殑utc鏃堕棿鎴�(褰揜esult = 0 鏃跺瓨鍦�) + /// </summary> + public int LastModifyTime; + } + #endregion + + #region 瀹㈡埛绔帴鏀跺埌缃戝叧鍙戣壊鏁版嵁鏍煎紡鍚庡簲鍙嶉缁欑綉鍏冲埌鏍煎紡鏁版嵁 + /// <summary> + /// 瀹㈡埛绔帴鏀跺埌缃戝叧鍙戣壊鏁版嵁鏍煎紡鍚庡簲鍙嶉缁欑綉鍏冲埌鏍煎紡鏁版嵁 + /// </summary> + public DownloadFileResponseAllData downloadFileResponseAllData; + /// <summary> + /// 瀹㈡埛绔帴鏀跺埌缃戝叧鍙戣壊鏁版嵁鏍煎紡鍚庡簲鍙嶉缁欑綉鍏冲埌鏍煎紡鏁版嵁 + /// </summary> + [System.Serializable] + public class DownloadFileResponseAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 0: 鏁版嵁鍐欏叆鎴愬姛,璇锋眰鍙戦�佷笅涓�涓暟鎹寘 + ///<para>1锛氱粓姝笅杞姐�傚綋涓嬭浇鍑虹幇閿欒锛屾垨鑰呬笅杞藉凡缁忓畬鎴愬彲浠ュ彂閫佽鍊笺��</para> + /// </summary> + public int Result = -1; + } + + /// <summary> + /// 瀹㈡埛绔帴鏀跺埌缃戝叧鍙戣壊鏁版嵁鏍煎紡鍚庡簲鍙嶉缁欑綉鍏� + /// </summary> + public FileTransferDownloadFileRespon fileTransferDownloadFileRespon; + /// <summary> + /// 瀹㈡埛绔帴鏀跺埌缃戝叧鍙戣壊鏁版嵁鏍煎紡鍚庡簲鍙嶉缁欑綉鍏� + /// </summary> + [System.Serializable] + public class FileTransferDownloadFileRespon + { + /// <summary> + /// 0: 鏁版嵁鍐欏叆鎴愬姛,璇锋眰鍙戦�佷笅涓�涓暟鎹寘 + ///<para>1锛氱粓姝笅杞姐�傚綋涓嬭浇鍑虹幇閿欒锛屾垨鑰呬笅杞藉凡缁忓畬鎴愬彲浠ュ彂閫佽鍊笺��</para> + /// </summary> + public int Result = -1; + } + #endregion + + #region 鍒犻櫎鏂囦欢鎴栫洰褰� + /// <summary> + /// 鍒犻櫎鏂囦欢鎴栫洰褰�,缃戝叧鍙嶉淇℃伅 + /// </summary> + public DelFileOrDirResponseAllData delFileOrDirResponseAllData; + /// <summary> + /// 鍒犻櫎鏂囦欢鎴栫洰褰�,缃戝叧鍙嶉淇℃伅 + /// </summary> + [System.Serializable] + public class DelFileOrDirResponseAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 鍒犻櫎鏂囦欢鎴栫洰褰� + /// </summary> + public DelFileOrDirResponseData delFileOrDirResponseData; + } + + /// <summary> + /// 鍒犻櫎鏂囦欢鎴栫洰褰�,缃戝叧鍙嶉淇℃伅 + /// </summary> + public DelFileOrDirResponseData delFileOrDirResponseData; + /// <summary> + /// 鍒犻櫎鏂囦欢鎴栫洰褰�,缃戝叧鍙嶉淇℃伅 + /// </summary> + [System.Serializable] + public class DelFileOrDirResponseData + { + /// <summary> + ///0: 鍒犻櫎鎴愬姛 + ///<para>1锛氬垹闄ゅけ璐ワ紝璺緞涓嶅瓨鍦�</para> + ///<para>2锛氭棤娉曞垹闄ゃ��</para> + /// </summary> + public int Result; + + /// <summary> + ///鐩綍鎴栨枃浠剁殑璺緞 + /// </summary> + public string Path; + } + #endregion + + #region 鍒涘缓涓�涓洰褰� + /// <summary> + /// 鍒涘缓涓�涓洰褰�,缃戝叧鍙嶉淇℃伅 + /// </summary> + public CreateDirResponseAllData createDirResponseAllData; + /// <summary> + /// 鍒涘缓涓�涓洰褰�,缃戝叧鍙嶉淇℃伅 + /// </summary> + [System.Serializable] + public class CreateDirResponseAllData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 鍒涘缓涓�涓洰褰� + /// </summary> + public CreateDirResponseData createDirResponseData; + } + + /// <summary> + /// 鍒涘缓涓�涓洰褰�,缃戝叧鍙嶉淇℃伅 + /// </summary> + public CreateDirResponseData createDirResponseData; + /// <summary> + /// 鍒涘缓涓�涓洰褰�,缃戝叧鍙嶉淇℃伅 + /// </summary> + [System.Serializable] + public class CreateDirResponseData + { + /// <summary> + ///0: 鍒涘缓鎴愬姛 + ///<para>1锛氬垱寤哄け璐�</para> + /// </summary> + public int Result; + + /// <summary> + ///鐩綍鎴栨枃浠剁殑璺緞 + /// </summary> + public string Path; + } + #endregion + + #region 瀹㈡埛绔彂閫丏ES瀵嗛挜鍒扮綉鍏� + /// <summary> + /// 瀹㈡埛绔彂閫丏ES瀵嗛挜鍒扮綉鍏�,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + public SendKeyResponData sendDESKeyResponData; + /// <summary> + /// 瀹㈡埛绔彂閫丏ES瀵嗛挜鍒扮綉鍏�,缃戝叧鍙嶉鍏蜂綋淇℃伅 + /// </summary> + [System.Serializable] + public class SendKeyResponData + { + /// <summary> + /// 閿欒淇℃伅 + /// </summary> + public string errorMessageBase; + /// <summary> + /// 缃戝叧淇℃伅閿欒鍙嶉 + /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para> + /// </summary> + public ErrorResponData errorResponData; + /// <summary> + /// 0锛氭垚鍔� + ///<para>1锛氬け璐ワ紝RSA绉侀挜瑙e瘑澶辫触</para> + /// </summary> + public int Result = -1; + } + + #endregion + } +} -- Gitblit v1.8.0