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/DoorLock.cs | 2943 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 2,943 insertions(+), 0 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs
new file mode 100755
index 0000000..0735d15
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs
@@ -0,0 +1,2943 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using Shared;
+using Shared.Common;
+using Shared.Common.ResponseEntity;
+using Shared.Phone.UserCenter;
+
+namespace ZigBee.Device
+{
+    public class DoorLock : Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo
+    {
+        public DoorLock()
+        {
+            this.Type = DeviceType.DoorLock;
+        }
+
+        #region 闂ㄩ攣鏈湴鍙橀噺
+        /// <summary>
+        /// 鏈湴闂ㄩ攣鐢ㄦ埛鍜岃处鎴峰垪琛�
+        /// key:闂ㄩ攣鐢ㄦ埛ID
+        /// </summary>
+        /// <returns></returns>
+        public Dictionary<int, LocaDoorLockObj> localDoorLockUserList = new Dictionary<int, LocaDoorLockObj>();
+        /// <summary>
+        /// 鏈湴闂ㄨ处鎴峰垪琛�
+        /// key:璐︽埛ID锛堜富璐︽埛鏄疓UID锛屽瓙璐︽埛鏄垎浜繃鏉ョ殑璐︽埛ID锛�
+        /// </summary>
+        /// <returns></returns>
+        public Dictionary<string, LocaDoorLockObj> localDoorLockAccountList = new Dictionary<string, LocaDoorLockObj>();
+
+        public string currentUserDisplayMethod = string.Empty;//褰撳墠鐢ㄦ埛鏄剧ず鏂瑰紡
+        //鏈湴鎵�鏈夎处鎴峰垪琛�
+        public List<Shared.Phone.UserCenter.MemberInfoRes> localAllAccountList = new List<Shared.Phone.UserCenter.MemberInfoRes> { };
+        /// <summary>
+        /// 鏄惁甯稿紑妯″紡[褰撴暟鎹幏鍙栧け璐ワ紝杩斿洖绌篯 
+        /// </summary>
+        public Dictionary<string, bool> IsDoorLockNormallyMode = new Dictionary<string, bool> { };//鏄惁鍐荤粨瀛愯处鎴�
+        public string LocalTempPassword = string.Empty;//鏈湴鐢熸垚鐨勪复鏃跺瘑鐮�
+        public Dictionary<string, bool> IsFreezeAccount = new Dictionary<string, bool> { };//鏄惁鍐荤粨瀛愯处鎴�
+        public Dictionary<string, bool> HasRemoteUnlockAccess = new Dictionary<string, bool> { };//鏄惁缁欏瓙璐︽埛鎷ユ湁杩滅▼寮�閿佺殑鏉′欢
+        public Dictionary<string, bool> IsFailedToGetDoorLockInfo = new Dictionary<string, bool> { };//鏄惁鑾峰彇闂ㄩ攣鏁版嵁澶辫触
+        public string RemoteUnlockPassword = string.Empty;//杩滅▼寮�閿佸瘑鐮�
+
+        public static int RemoteUnlockCount = 5;//杩滅▼寮�閿佹鏁伴檺鍒�
+        public static int failedCount = 3;//杩滅▼寮�閿佸け璐ユ鏁�
+        public static DateTime maxValue = DateTime.MaxValue;
+        public static DateTime minValue = DateTime.MinValue;
+
+        #region 涓存椂瀵嗙爜淇℃伅
+        /// <summary>
+        /// 鐢ㄦ埛绠$悊鍙戦�佹暟鎹洖澶�
+        /// </summary>
+        public TempPasswordObject tempPasswordObject;
+        /// <summary>
+        /// 涓存椂瀵嗙爜鏈湴瀵硅薄
+        /// </summary>
+        [System.Serializable]
+        public class TempPasswordObject
+        {
+            /// <summary>
+            ///  涓存椂瀵嗙爜ID
+            /// </summary>
+            public int UserId;
+            /// <summary>
+            /// PrimaryId 闂ㄩ攣浜戠涓� 閿�(闈炴洿鏂板瓧娈�,浠ヤ笅鍧囦负鏇存柊瀛楁) -->閿悕 : PrimaryId榛樿鍊�: null
+            /// </summary>
+            //public string PrimaryId;
+            /// <summary>
+            ///  6浣嶆湁鍔ㄦ�佷复鏃跺瘑鐮�
+            /// </summary>
+            public string TempPassword;
+            /// <summary>
+            /// 闂ㄩ攣鏈夋晥鏃堕棿
+            /// </summary>
+            public DateTime ValidTime;
+            /// <summary>
+            /// 闂ㄩ攣澶辨晥鏃堕棿
+            /// </summary>
+            public DateTime InValidTime;
+        }
+        #endregion
+
+        #endregion
+
+        #region 涓庝簯绔�氳鎺ュ彛
+        #region 闂ㄩ攣鏈嶅姟鍣ㄥ彂閫佸熀鏈俊鎭�
+        /// <summary>
+        ///  娣诲姞闂ㄩ攣
+        /// </summary>
+        public class BaseDoorLockServerData
+        {
+            /// <summary>
+            /// RequestVersion
+            /// </summary>
+            public string RequestVersion = Shared.Common.CommonPage.RequestVersion;
+            /// <summary>
+            /// LoginAccessToken
+            /// </summary>
+            public string LoginAccessToken = Shared.Common.Config.Instance.Token;
+            /// <summary>
+            /// 浣忓畢Id -->閿悕 : HomeId
+            /// </summary>
+            public string HomeId = Shared.Common.Config.Instance.HomeId;
+            /// <summary>
+            /// 闂ㄩ攣Id -->閿悕 : DoorLockId
+            /// </summary>
+            public string DoorLockId = "";
+            /// <summary>
+            /// 闂ㄩ攣鏈湴鐢ㄦ埛Id -->閿悕 : DoorLockLocalUserId
+            /// </summary>
+            public string DoorLockLocalUserId = "";
+
+            /// <summary>
+            /// IsOtherAccountCtrl 鏄惁涓哄瓙甯愬彿鎺у埗杩囨潵 -->閿悕 : IsOtherAccountCtrl
+            /// </summary>
+            public bool IsOtherAccountCtrl = false;
+        }
+        #endregion
+
+        #region 娣诲姞闂ㄩ攣
+        /// <summary>
+        ///  娣诲姞闂ㄩ攣
+        /// </summary>
+        public class AddDoorLockData : BaseDoorLockServerData
+        {
+            /// <summary>
+            /// 浜戠甯愬彿Id -->閿悕 : CloudAccountId
+            /// </summary>
+            public string CloudAccountId = "";
+            /// <summary>
+            /// OpenLockMode 寮�閿佹柟寮�(瀵嗙爜銆佹寚绾广�両C鍗�) -->閿悕 : OpenLockMode (鍙��)
+            /// </summary>
+            public int OpenLockMode = 0;
+            /// <summary>
+            /// Data 鐩稿叧鍐呭(濡�:瀵嗙爜銆佹寚绾广�両C鍗� 鐨勪簩杩涘埗) -->閿悕 : Data (鍙��)
+            public byte[] Data = null;
+            /// <summary>
+            /// 鐢ㄦ埛Id澶囨敞 -->閿悕 : UserIdRemarks
+            /// </summary>
+            public string UserIdRemarks = "";
+            /// <summary>
+            /// IsFreezeUser 鏄惁鍐荤粨鐢ㄦ埛 -->閿悕 : IsFreezeUser (鍙��)
+            /// </summary>
+            public bool IsFreezeUser = false;
+            /// <summary>
+            /// IsTempUnlockAuthority 鏄惁涓存椂寮�閿佹潈闄� -->閿悕 : IsTempUnlockAuthority(鍙��)
+            /// </summary>
+            public bool IsTempUnlockAuthority = false;
+            /// <summary>
+            /// EntryTime 褰曞叆鏃堕棿 -->閿悕 : EntryTime(鍙��)
+            /// </summary>
+            public DateTime EntryTime = System.DateTime.Now;
+        }
+
+        /// <summary>
+        /// 娣诲姞闂ㄩ攣缁撴灉
+        /// </summary>
+        public class AddDoorLockDataRes
+        {
+            /// <summary>
+            /// 鍝嶅簲鐨勭増鏈彿,涓�鑸姹備粈涔堢増鏈彿锛岃繖閲屼笌涔嬭姹傜浉鍚�
+            /// </summary>
+            public string ResponseVersion = string.Empty;
+            /// <summary>
+            /// 鍝嶅簲鐘舵�佺爜:
+            ///<para>(1)Success 鍒橻璋冪敤姝ゆ帴鍙f搷浣滄垚鍔焆, ResponseData鍒欎负null</para>
+            ///<para>(2)ParameterOrEmpty,鍒欏搷搴斿瓧娈典腑[ErrorInfo] 涓洪敊璇俊鎭�, ResponseData鍒欎负null</para>
+            ///(<para>3)NoLogin,鍒欏搷搴斿瓧娈典腑[ErrorInfo] 涓洪敊璇俊鎭负[鏃犳晥鐧诲綍Token!]</para>
+            ///<para>(4)NoRecord,鍒欏搷搴斿瓧娈典腑[ErrorInfo] 涓洪敊璇俊鎭负[褰撳墠鎻愪氦DoorLockId鍊煎湪浜戠涓嶅瓨鍦紝璇风‘璁ゅ�兼槸鍚︽纭�!]</para>
+            ///<para>(5)DoorLockIdNoIsYou,鍒欏搷搴斿瓧娈典腑[ErrorInfo] 涓洪敊璇俊鎭负[褰撳墠鎻愪氦DoorLockId骞朵笉灞炰簬浣犲綋鍓嶅笎鍙风殑锛岃纭鍊兼槸鍚︽纭�!]</para>
+            /// </summary>
+            public string StateCode = string.Empty;
+        }
+        #endregion
+
+        #region 鏇存柊闂ㄩ攣
+        /// <summary>
+        ///   鏇存柊闂ㄩ攣
+        /// </summary>
+        public class RefreshDoorLockData : BaseDoorLockServerData
+        {
+            /// <summary>
+            /// PrimaryId 闂ㄩ攣浜戠涓� 閿�(闈炴洿鏂板瓧娈�,浠ヤ笅鍧囦负鏇存柊瀛楁) -->閿悕 : PrimaryId榛樿鍊�: null
+            /// </summary>
+            public string PrimaryId = "";
+            /// <summary>
+            /// OpenLockMode 寮�閿佹柟寮�(瀵嗙爜銆佹寚绾广�両C鍗�) -->閿悕 : OpenLockMode (鍙��)
+            /// </summary>
+            public int OpenLockMode = 0;
+
+            /// <summary>
+            /// 浣忓畢Id (鍙��)
+            /// </summary>
+            public byte[] Data;
+            /// <summary>
+            /// 鐢ㄦ埛Id澶囨敞
+            /// </summary>
+            public string UserIdRemarks = "";
+            /// <summary>
+            /// 鏄惁涓虹鐞嗗憳闂ㄩ攣
+            /// </summary>
+            public bool IsFreezeUser;
+            /// <summary>
+            /// 鏄惁涓虹鐞嗗憳闂ㄩ攣
+            /// </summary>
+            public bool IsTempUnlockAuthority;
+        }
+        #endregion
+
+        #region 鍒犻櫎闂ㄩ攣
+        /// <summary>
+        /// 鍒犻櫎闂ㄩ攣
+        /// </summary>
+        public class DeleteDoorLockData : BaseDoorLockServerData
+        {
+            /// <summary>
+            /// PrimaryId 闂ㄩ攣浜戠涓� 閿�(闈炴洿鏂板瓧娈�,浠ヤ笅鍧囦负鏇存柊瀛楁) -->閿悕 : PrimaryId榛樿鍊�: null
+            /// </summary>
+            public string PrimaryId = "";
+            /// <summary>
+            /// 闂ㄩ攣Id -->閿悕 : DoorLockId (鍙��)
+            /// DelDoorLockDelType 闂ㄩ攣鍒犻櫎绫诲瀷(0: 鏍规闂ㄩ攣涓婚敭(浜戠涓婚敭)鍒犻櫎(鍗曟潯鍒犻櫎)銆�1:鏍规闂ㄩ攣Id鎵归噺鍒犻櫎(鍑℃槸涓庨棬閿両d鐩稿悓閮戒細鍒犻櫎)銆�2锛氭牴妞愰棬閿両d鍙婇棬閿佹湰鍦扮敤鎴稩d鎵归噺鍒犻櫎(杩欎釜闂ㄩ攣Id杩欎釜闂ㄩ攣鏈湴鐢ㄦ埛Id鍧囦細琚垹闄�)) -->閿悕 : DelDoorLockDelType 榛樿鍊�: 0
+            /// </summary>
+            public int DelDoorLockDelType;
+        }
+        #endregion
+
+        #region 娣诲姞闂ㄩ攣涓存椂瀵嗙爜
+        /// <summary>
+        ///  娣诲姞闂ㄩ攣
+        /// </summary>
+        public class AddDoorLockTempPasswordData
+        {
+            /// <summary>
+            /// RequestVersion
+            /// </summary>
+            public string RequestVersion = Shared.Common.CommonPage.RequestVersion;
+            /// <summary>
+            /// LoginAccessToken
+            /// </summary>
+            public string LoginAccessToken = Shared.Common.Config.Instance.Token;
+            /// <summary>
+            /// 浣忓畢Id -->閿悕 : HomeId
+            /// </summary>
+            public string HomeId = Shared.Common.Config.Instance.HomeId;
+            /// <summary>
+            /// 闂ㄩ攣Id -->閿悕 : DoorLockId
+            /// </summary>
+            public string LocalDoorLockId = "";
+            /// <summary>
+            /// 涓存椂瀵嗙爜Id -->閿悕 : TempPwdId
+            /// </summary>
+            public string TempPwdId = "";
+            /// <summary>
+            /// 涓存椂瀵嗙爜 -->閿悕 : TempPwd
+            /// </summary>
+            public string TempPwd = "";
+            /// <summary>
+            /// 0:00:00] ValidBeginTime 鏈夋晥寮�濮嬫椂闂� -->閿悕 : ValidBeginTime  榛樿鍊�: 0001/1/1
+            /// </summary>
+            public DateTime ValidBeginTime;
+            /// <summary>
+            /// 0:00:00] ValidEndTime 鏈夋晥缁撴潫鏃堕棿 -->閿悕 : ValidEndTime
+            /// </summary>
+            public DateTime ValidEndTime;
+            /// <summary>
+            /// IsOtherAccountCtrl 鏄惁涓哄瓙甯愬彿鎺у埗杩囨潵 -->閿悕 : IsOtherAccountCtrl
+            /// </summary>
+            public bool IsOtherAccountCtrl = false;
+        }
+
+        /// <summary>
+        /// 娣诲姞闂ㄩ攣缁撴灉
+        /// </summary>
+        public class AddDoorLockTempPasswordDataRes : AddDoorLockDataRes
+        {
+        }
+        #endregion
+
+        #region 鍒犻櫎闂ㄩ攣涓存椂瀵嗙爜
+        /// <summary>
+        ///  鍒犻櫎闂ㄩ攣
+        /// </summary>
+        public class DelDoorLockTempPasswordData
+        {
+            /// <summary>
+            /// RequestVersion
+            /// </summary>
+            public string RequestVersion = Shared.Common.CommonPage.RequestVersion;
+            /// <summary>
+            /// LoginAccessToken
+            /// </summary>
+            public string LoginAccessToken = Shared.Common.Config.Instance.Token;
+            /// <summary>
+            /// 浣忓畢Id -->閿悕 : HomeId
+            /// </summary>
+            public string HomeId = Shared.Common.Config.Instance.HomeId;
+            /// <summary>
+            /// LocalDoorLockId 鎼滅储鏈湴闂ㄩ攣Id -->閿悕 : LocalDoorLockId  榛樿鍊�: null
+            /// </summary>
+            public string LocalDoorLockId = "";
+            /// <summary>
+            /// IsOtherAccountCtrl 鏄惁涓哄瓙甯愬彿鎺у埗杩囨潵 -->閿悕 : IsOtherAccountCtrl
+            /// </summary>
+            public bool IsOtherAccountCtrl = false;
+        }
+
+        /// <summary>
+        /// 鍒犻櫎闂ㄩ攣缁撴灉
+        /// </summary>
+        public class DelDoorLockTempPasswordDataRes : AddDoorLockDataRes
+        {
+        }
+        #endregion
+
+        #region 鏇存柊闂ㄩ攣涓存椂瀵嗙爜
+        /// <summary>
+        ///  鏇存柊闂ㄩ攣
+        /// </summary>
+        public class ModifyDoorLockTempPasswordData
+        {
+            /// <summary>
+            /// RequestVersion
+            /// </summary>
+            public string RequestVersion = Shared.Common.CommonPage.RequestVersion;
+            /// <summary>
+            /// LoginAccessToken
+            /// </summary>
+            public string LoginAccessToken = Shared.Common.Config.Instance.Token;
+            /// <summary>
+            /// 浣忓畢Id -->閿悕 : HomeId
+            /// </summary>
+            public string HomeId = Shared.Common.Config.Instance.HomeId;
+            /// <summary>
+            /// 闂ㄩ攣瀵嗙爜涓婚敭(鑾峰彇闂ㄩ攣瀵嗙爜鍒嗛〉涓殑Id) -->閿悕 : DoorLockPwdId
+            /// </summary>
+            public string DoorLockPwdId = "";
+            /// <summary>
+            /// 闂ㄩ攣Id -->閿悕 : DoorLockId
+            /// </summary>
+            public string LocalDoorLockId = "";
+            /// <summary>
+            /// 涓存椂瀵嗙爜Id -->閿悕 : TempPwdId
+            /// </summary>
+            public string TempPwdId = "";
+            /// <summary>
+            /// 涓存椂瀵嗙爜 -->閿悕 : TempPwd
+            /// </summary>
+            public string TempPwd = "";
+            /// <summary>
+            /// 0:00:00] ValidBeginTime 鏈夋晥寮�濮嬫椂闂� -->閿悕 : ValidBeginTime  榛樿鍊�: 0001/1/1
+            /// </summary>
+            public DateTime ValidBeginTime;
+            /// <summary>
+            /// 0:00:00] ValidEndTime 鏈夋晥缁撴潫鏃堕棿 -->閿悕 : ValidEndTime
+            /// </summary>
+            public DateTime ValidEndTime;
+            /// <summary>
+            /// IsOtherAccountCtrl 鏄惁涓哄瓙甯愬彿鎺у埗杩囨潵 -->閿悕 : IsOtherAccountCtrl
+            /// </summary>
+            public bool IsOtherAccountCtrl = false;
+        }
+
+        /// <summary>
+        /// 娣诲姞闂ㄩ攣缁撴灉
+        /// </summary>
+        public class ModigDoorLockTempPasswordDataRes : AddDoorLockDataRes
+        {
+        }
+        #endregion
+
+        #region 鑾峰彇闂ㄩ攣涓存椂瀵嗙爜
+        /// <summary>
+        ///  鑾峰彇闂ㄩ攣
+        /// </summary>
+        public class GetDoorLockTempPasswordData
+        {
+            /// <summary>
+            /// RequestVersion
+            /// </summary>
+            public string RequestVersion = Shared.Common.CommonPage.RequestVersion;
+            /// <summary>
+            /// LoginAccessToken
+            /// </summary>
+            public string LoginAccessToken = Shared.Common.Config.Instance.Token;
+            /// <summary>
+            /// 浣忓畢Id -->閿悕 : HomeId
+            /// </summary>
+            public string HomeId = Shared.Common.Config.Instance.HomeId;
+            /// <summary>
+            /// 闂ㄩ攣Id -->閿悕 : DoorLockId
+            /// </summary>
+            public string LocalDoorLockId = "";
+            /// <summary>
+            /// 涓存椂瀵嗙爜Id -->閿悕 : TempPwdId
+            /// </summary>
+            public string TempPwdId = "";
+            /// <summary>
+            /// 涓存椂瀵嗙爜 -->閿悕 : TempPwd
+            /// </summary>
+            public string TempPwd = "";
+            /// <summary>
+            /// 0:00:00] ValidBeginTime 鏈夋晥寮�濮嬫椂闂� -->閿悕 : ValidBeginTime  榛樿鍊�: 0001/1/1
+            /// </summary>
+            public DateTime? ValidBeginTime;
+            /// <summary>
+            /// 0:00:00] ValidEndTime 鏈夋晥缁撴潫鏃堕棿 -->閿悕 : ValidEndTime
+            /// </summary>
+            public DateTime? ValidEndTime;
+            /// <summary>
+            /// IsOtherAccountCtrl 鏄惁涓哄瓙甯愬彿鎺у埗杩囨潵 -->閿悕 : IsOtherAccountCtrl
+            /// </summary>
+            public bool IsOtherAccountCtrl = false;
+        }
+
+        /// <summary>
+        /// 鑾峰彇闂ㄩ攣涓存椂瀵嗙爜缁撴灉
+        /// </summary>
+        [Serializable]
+        public class GetDoorLockTempPasswordDataRes
+        {
+            public List<CloudDoorLockTempPasswordObj> PageData = new List<CloudDoorLockTempPasswordObj>();
+            public int PageIndex;
+            public int PageSize;
+            public int TotalCount;
+            public int TotalPages;
+            public bool HasPreviousPage;
+            public bool HasNextPage;
+        }
+        [Serializable]
+        public class CloudDoorLockTempPasswordObj
+        {
+            /// <summary>
+            /// 闂ㄩ攣Id -->閿悕 : DoorLockId
+            /// </summary>
+            public string LocalDoorLockId = "";
+            /// <summary>
+            /// 涓存椂瀵嗙爜Id -->閿悕 : TempPwdId
+            /// </summary>
+            public string TempPwdId = "";
+            /// <summary>
+            /// 涓存椂瀵嗙爜 -->閿悕 : TempPwd
+            /// </summary>
+            public string TempPwd = "";
+            /// <summary>
+            /// 0:00:00] ValidBeginTime 鏈夋晥寮�濮嬫椂闂� -->閿悕 : ValidBeginTime  榛樿鍊�: 0001/1/1
+            /// </summary>
+            public DateTime ValidBeginTime;
+            /// <summary>
+            /// 0:00:00] ValidEndTime 鏈夋晥缁撴潫鏃堕棿 -->閿悕 : ValidEndTime
+            /// </summary>
+            public DateTime ValidEndTime;
+            /// <summary>
+            /// 銆愰棬閿佷簯绔富閿��,鐢ㄤ簬銆愭坊鍔犻棬閿佸巻鍙层�戞帴鍙d腑鐨凞oorLockId鍙傛暟鍙娿�愬垹闄ら棬閿併�戞帴鍙d腑鐨凱rimaryId鍙傛暟,娉ㄦ剰涓嶆槸缃戝叧涓殑銆愰棬閿両d
+            /// </summary>
+            public string Id;
+            /// <summary>
+            /// 鍒涘缓鏃堕棿
+            /// </summary>
+            public DateTime CreatedOnUtc;
+        }
+
+        /// <summary>
+        /// 浠庝簯鏈嶅姟鍣ㄤ腑鑾峰彇闂ㄩ攣涓存椂瀵嗙爜
+        /// </summary>
+        public static async System.Threading.Tasks.Task<GetDoorLockTempPasswordDataRes> GetDoorLockTempPasswordFromServer(string RequestName, GetDoorLockTempPasswordData getDoorLockTempPasswordData)
+        {
+            return await System.Threading.Tasks.Task.Run((Func<System.Threading.Tasks.Task<GetDoorLockTempPasswordDataRes>>)(async () =>
+            {
+                GetDoorLockTempPasswordDataRes listInfo = null;
+                var revertObj = await SendDoorLockToServer(RequestName, getDoorLockTempPasswordData);
+                if (revertObj != null && revertObj.ResponseData != null)
+                {
+                    var result = revertObj.ResponseData.ToString();
+                    if (result != null)
+                    {
+                        listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<GetDoorLockTempPasswordDataRes>(result);
+                    }
+                }
+                return listInfo;
+            }));
+        }
+        #endregion
+
+        #region 鑾峰彇闂ㄩ攣
+        /// <summary>
+        ///  鑾峰彇闂ㄩ攣
+        /// </summary>
+        public class GetDoorLockData : BaseDoorLockServerData
+        {
+            /// <summary>
+            /// 浜戠甯愬彿Id -->閿悕 : CloudAccountId (鍙��)
+            /// </summary>
+            public string CloudAccountId = "";
+            /// <summary>
+            /// 绗嚑椤�
+            /// </summary>
+            public PageSetting pageSetting = new PageSetting();
+        }
+
+        /// <summary>
+        ///  鑾峰彇闂ㄩ攣
+        /// </summary>
+        public class PageSetting
+        {
+            /// <summary>
+            /// 绗嚑椤�
+            /// </summary>
+            public int Page = 1;
+            /// <summary>
+            /// 绗嚑椤�
+            /// </summary>
+            public int PageSize = 10;
+        }
+
+        [Serializable]
+        public class GetDoorLockDataRes
+        {
+            public List<CloudDoorLockObj> PageData = new List<CloudDoorLockObj>();
+            public int PageIndex;
+            public int PageSize;
+            public int TotalCount;
+            public int TotalPages;
+            public bool HasPreviousPage;
+            public bool HasNextPage;
+        }
+        [Serializable]
+        public class CloudDoorLockObj
+        {
+            /// <summary>
+            /// 闂ㄩ攣Id
+            /// </summary>
+            public string DoorLockId;
+            /// <summary>
+            /// 浜戠甯愬彿Id
+            /// </summary>
+            public string CloudAccountId;
+            /// <summary>
+            /// OpenLockMode 寮�閿佹柟寮�(瀵嗙爜銆佹寚绾广�両C鍗�)
+            /// </summary>
+            public int OpenLockMode;
+            /// <summary>
+            /// 闂ㄩ攣鏈湴鐢ㄦ埛Id
+            /// </summary>
+            public string DoorLockLocalUserId;
+            /// <summary>
+            /// 浣忓畢Id
+            /// </summary>
+            public byte[] Data;
+            /// <summary>
+            /// 鐢ㄦ埛Id澶囨敞
+            /// </summary>
+            public string UserIdRemarks;
+            /// <summary>
+            /// 鏄惁涓虹鐞嗗憳闂ㄩ攣
+            /// </summary>
+            public bool IsAdminDoorLock;
+            /// <summary>
+            /// 鏄惁涓虹鐞嗗憳闂ㄩ攣
+            /// </summary>
+            public bool IsFreezeUser;
+            /// <summary>
+            /// 鏄惁涓虹鐞嗗憳闂ㄩ攣
+            /// </summary>
+            public bool IsTempUnlockAuthority;
+            /// <summary>
+            /// 褰曞叆鏃堕棿
+            /// </summary>
+            public DateTime EntryTime;
+            /// <summary>
+            /// 鏈�鍚庢洿鏂版椂闂�
+            /// </summary>
+            public string LastChangeTime;
+            /// <summary>
+            /// 銆愰棬閿佷簯绔富閿��,鐢ㄤ簬銆愭坊鍔犻棬閿佸巻鍙层�戞帴鍙d腑鐨凞oorLockId鍙傛暟鍙娿�愬垹闄ら棬閿併�戞帴鍙d腑鐨凱rimaryId鍙傛暟,娉ㄦ剰涓嶆槸缃戝叧涓殑銆愰棬閿両d
+            /// </summary>
+            public string Id;
+            /// <summary>
+            /// 鍒涘缓鏃堕棿
+            /// </summary>
+            public DateTime CreatedOnUtc;
+        }
+
+        /// <summary>
+        /// 鑾峰彇闂ㄩ攣浜戞湇鍔″櫒
+        /// </summary>
+        public static async System.Threading.Tasks.Task<GetDoorLockDataRes> GetDoorLockInfoFromServer(string RequestName, GetDoorLockData getDoorLockData)
+        {
+            return await System.Threading.Tasks.Task.Run((Func<System.Threading.Tasks.Task<GetDoorLockDataRes>>)(async () =>
+            {
+                GetDoorLockDataRes listInfo = null;
+                var revertObj = await SendDoorLockToServer(RequestName, getDoorLockData);
+                if (revertObj != null && revertObj.ResponseData != null)
+                {
+                    var result = revertObj.ResponseData.ToString();
+                    if (result != null)
+                    {
+                        listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<GetDoorLockDataRes>(result);
+                    }
+                }
+                return listInfo;
+            }));
+        }
+        #endregion
+
+        /// <summary>
+        /// 鍙戦�侀棬閿佹暟鎹埌鏈嶅姟鍣紝鍙洖澶嶇姸鎬侊紝娌℃湁鏁版嵁澶勭悊
+        /// </summary>
+        /// <returns>鑾峰彇浠庢帴鍙i偅閲屽彇鍒扮殑ResponsePack</returns>
+        /// <param name="RequestName">璁块棶鍦板潃</param>
+        /// <param name="obj">涓�涓被</param>
+        public static async Task<ResponsePack> SendDoorLockToServer(string RequestName, object obj)
+        {
+            try
+            {
+                //搴忓垪鍖栧璞�
+                var requestJson = JsonConvert.SerializeObject(obj);
+                var byteData = System.Text.Encoding.UTF8.GetBytes(requestJson);
+                byte[] result1 = null;
+                //璁块棶鎺ュ彛
+                if (UserCenterResourse.UserInfo.AuthorityNo == 1)
+                {
+                    result1 = await CommonPage.Instance.RequestHttpsZigbeeBytesResultAsync(RequestName, byteData);
+                }
+                else
+                {
+                    result1 = await CommonPage.Instance.RequestZigbeeHttpsByAdmin(RequestName, byteData);
+                }
+                if (result1 != null)
+                {
+                    var result2 = Encoding.UTF8.GetString(result1);
+                    if (result2 != null)
+                    {
+                        var result = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.ResponsePack>(result2);
+                        return result;
+                    }
+                }
+                return null;
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex.Message);
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// 鑾峰彇瀛愯处鎴蜂俊鎭�
+        /// </summary>
+        static List<Shared.Phone.UserCenter.MemberInfoRes> DoorLockAccountList = new List<Shared.Phone.UserCenter.MemberInfoRes> { };
+        public static async System.Threading.Tasks.Task<List<Shared.Phone.UserCenter.MemberInfoRes>> GetSubAccountByDistributedMark()
+        {
+            DoorLockAccountList.Clear();
+            return await System.Threading.Tasks.Task.Run((Func<System.Threading.Tasks.Task<List<Shared.Phone.UserCenter.MemberInfoRes>>>)(async () =>
+           {
+               var pra = new Shared.Phone.UserCenter.MemberListInfoPra();
+               string result = await UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra);
+               var listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Shared.Phone.UserCenter.MemberInfoRes>>(result);
+               return listInfo;
+           }));
+        }
+
+        /// <summary>
+        /// 鏈嶅姟鍣ㄨ幏鍙栨暟鎹け璐ユ彁绀�
+        /// </summary>
+        public void FailureToServer()
+        {
+            Application.RunOnMainThread(() =>
+            {
+                var alert = new Alert(Language.StringByID(Shared.R.MyInternationalizationString.TIP), Language.StringByID(Shared.R.MyInternationalizationString.RequestServerFailed), Language.StringByID(Shared.R.MyInternationalizationString.Confrim));
+                alert.Show();
+            });
+        }
+        #endregion
+
+        #region  涓庣綉鍏抽�氳鎺ュ彛
+        #region 闂ㄩ攣鎿嶄綔浜嬩欢閫氱煡
+        /// <summary>
+        /// 闂ㄩ攣鎿嶄綔浜嬩欢閫氱煡
+        /// </summary>
+        public DoorLockOperatingEventNotificationCommand doorLockOperatingEventNotificationCommand;
+        /// <summary>
+        /// 闂ㄩ攣鎿嶄綔浜嬩欢閫氱煡
+        /// </summary>
+        [System.Serializable]
+        public class DoorLockOperatingEventNotificationCommand
+        {
+            /// <summary>
+            /// 鐢ㄦ埛id
+            ///闂ㄩ攣鏈湴褰曞叆鐨勫瘑鐮併�佹寚绾广�佹劅搴斿崱閮芥湁鍞竴瀵瑰簲鐨勭敤鎴稩d
+            /// </summary>
+            public int UserID;
+            /// <summary>
+            /// 浜嬩欢瑙﹀彂婧�
+            /// 甯哥敤锛�
+            /// 0:Keypad(閿洏/瀵嗙爜)锛�3:RFID(灏勯鍗�)锛�15:鎸囩汗
+            ///涓嶅父鐢細
+            /// 1:RF(Zigbee鏃犵嚎)锛�2:Manual(鎵嬪姩)锛�255:Indeterminate(涓嶇‘瀹�)
+            /// </summary>
+            public int OperationEventSoure;
+            /// <summary>
+            /// 浜嬩欢鐮�
+            /// 甯哥敤锛�
+            /// 閿洏/瀵嗙爜锛屾寚绾广�佹劅搴斿崱锛�1:Lock鍛戒护鎴愬姛浜嬩欢锛�2:Unlock鍛戒护鎴愬姛浜嬩欢
+            ///涓嶅父鐢細
+            /// 璇锋煡鐪嬫灇涓�
+            /// </summary>
+            public int OperationEventCode;
+            /// <summary>
+            /// 淇濈暀锛岄粯璁�0
+            /// </summary>
+            public int PIN;
+            /// <summary>
+            /// 闂ㄩ攣鏈湴褰撳墠鏃堕棿鐨勬椂闂存埑
+            /// </summary>
+            public int ZigbeeLocalTime;
+        }
+
+        public class AccountsObj
+        {
+            /// <summary>
+            /// 鍏宠仈app璐﹀彿
+            /// </summary>
+            public string Account;
+            /// <summary>
+            /// 淇濈暀
+            /// </summary>
+            public int Type;
+            /// <summary>
+            ///  淇濈暀
+            /// </summary>
+            public int Status;
+        }
+
+        /// <summary>
+        /// 鈥淥perationEventSoure鈥濆垪琛�
+        /// </summary>
+        public enum OperationEventSoure
+        {
+            /// <summary>
+            /// 閿洏/瀵嗙爜
+            /// </summary>
+            Keypad = 0,
+            /// <summary>
+            /// Zigbee鏃犵嚎
+            /// </summary>
+            RF = 1,
+            /// <summary>
+            /// 鎵嬪姩
+            /// </summary>
+            Manual = 2,
+            /// <summary>
+            /// 灏勯鍗�
+            /// </summary>
+            RFID = 3,
+            /// <summary>
+            /// 鎸囩汗
+            /// </summary>
+            Fingerprint = 15,
+            /// <summary>
+            /// Indeterminate(涓嶇‘瀹�)
+            /// </summary>
+            Indeterminate = 255,
+        }
+
+        /// <summary>
+        /// 鈥淥perationEventSoure鈥濈被鍨嬩负鈥淜eypad鈥濆嵆瀵嗙爜 鐨勨�淥perationEventCode鈥濅簨浠�
+        /// </summary>
+        public enum KeypadEventDescription
+        {
+            /// <summary>
+            /// 鏈煡浜嬩欢
+            /// </summary>
+            UnknownEvent = 0,
+            /// <summary>
+            /// Lock鍛戒护鎴愬姛浜嬩欢
+            /// </summary>
+            LockSuccessEvent = 1,
+            /// <summary>
+            /// Unlock鍛戒护鎴愬姛浜嬩欢
+            /// </summary>
+            UnlockSuccessEvent = 2,
+            /// <summary>
+            /// Lock鍛戒护锛歟rror,invalid PIN浜嬩欢
+            /// </summary>
+            LockInvalidPinEvent = 3,
+            /// <summary>
+            /// Lock鍛戒护锛歟rror,invalid schedule浜嬩欢
+            /// </summary>
+            LockInvalidScheduleEvent = 4,
+            /// <summary>
+            /// Unlock鍛戒护锛歟rror,invalid PIN浜嬩欢
+            /// </summary>
+            UnlockInvalidPinEvent = 5,
+            /// <summary>
+            /// Unlock鍛戒护锛歟rror,invalid schedule浜嬩欢Unlock鍛戒护锛歟rror,invalid schedule浜嬩欢
+            /// </summary>
+            UnlockInvalidScheduleEvent = 6,
+            /// <summary>
+            /// 闈炶闂敤鎴锋搷浣滀簨浠�
+            /// </summary>
+            NonAccess = 15,
+        }
+
+        /// <summary>
+        /// 鈥淥perationEventSoure鈥濈被鍨嬩负鈥淩F鈥� 鐨勨�淥perationEventCode鈥濅簨浠�
+        /// </summary>
+        public enum RfEventDescription
+        {
+            /// <summary>
+            /// 鏈煡浜嬩欢
+            /// </summary>
+            UnknownEvent = 0,
+            /// <summary>
+            /// Lock鍛戒护鎴愬姛浜嬩欢
+            /// </summary>
+            LockSuccessEvent = 1,
+            /// <summary>
+            /// Unlock鍛戒护鎴愬姛浜嬩欢
+            /// </summary>
+            UnlockSuccessEvent = 2,
+            /// <summary>
+            /// Lock鍛戒护锛歟rror,invalid code浜嬩欢
+            /// </summary>
+            LockInvalidPinEvent = 3,
+            /// <summary>
+            /// Lock鍛戒护锛歟rror,invalid schedule浜嬩欢
+            /// </summary>
+            LockInvalidScheduleEvent = 4,
+            /// <summary>
+            /// Unlock鍛戒护锛歟rror,invalid code浜嬩欢
+            /// </summary>
+            UnlockInvalidPinEvent = 5,
+            /// <summary>
+            /// Unlock鍛戒护锛歟rror,invalid schedule浜嬩欢
+            /// </summary>
+            UnlockInvalidScheduleEvent = 6,
+        }
+
+        /// <summary>
+        /// 鈥淥perationEventSoure鈥濈被鍨嬩负鈥淢anual鈥� 鐨勨�淥perationEventCode鈥濅簨浠�
+        /// </summary>
+        public enum ManualEventDescription
+        {
+            /// <summary>
+            /// 鏈煡浜嬩欢
+            /// </summary>
+            UnknownEvent = 0,
+            /// <summary>
+            /// Thumbturn Lock锛涙墜鍔ㄨ浆鍔ㄤ笂閿�
+            /// </summary>
+            ThumbturnLockEvent = 1,
+            /// <summary>
+            /// Thumbturn Unlock锛涙墜鍔ㄨ浆鍔ㄨВ閿�
+            /// </summary>
+            UnlockSuccessEvent = 2,
+            /// <summary>
+            /// One touch Lock锛涗竴閿笂閿�
+            /// </summary>
+            LockInvalidPinEvent = 7,
+            /// <summary>
+            ///Key Lock锛涙寜閿笂閿�
+            /// </summary>
+            LockInvalidScheduleEvent = 8,
+            /// <summary>
+            /// Key Unlock锛涙寜閿В閿�
+            /// </summary>
+            UnlockInvalidPinEvent = 9,
+            /// <summary>
+            /// Auto lock锛涜嚜鍔ㄤ笂閿�
+            /// </summary>
+            UnlockInvalidScheduleEvent = 10,
+            /// <summary>
+            /// Schedule Lock锛涙椂闂磋〃涓婇攣
+            /// </summary>
+            ScheduleLockEvent = 11,
+            /// <summary>
+            /// Schedule Unlock锛涙椂闂磋〃瑙i攣
+            /// </summary>
+            ScheduleUnlockEvent = 12,
+            /// <summary>
+            /// Manual Lock(Key or Thumbturn)锛涙墜鍔ㄤ笂閿�
+            /// </summary>
+            ManualLockEvent = 13,
+            /// <summary>
+            ///anual Unlock(Key or Thumbturn)锛涙墜鍔ㄨВ閿�
+            /// </summary>
+            ManualUnlockEvent = 14,
+        }
+
+        /// <summary>
+        /// 鈥淥perationEventSoure鈥濈被鍨嬩负鈥淩FID鈥� 鐨勨�淥perationEventCode鈥濅簨浠�
+        /// </summary>
+        public enum RfidEventDescription
+        {
+            /// <summary>
+            /// 鏈煡浜嬩欢
+            /// </summary>
+            UnknownEvent = 0,
+            /// <summary>
+            /// Lock鍛戒护鎴愬姛浜嬩欢
+            /// </summary>
+            LockSuccessEvent = 1,
+            /// <summary>
+            /// Unlock鍛戒护鎴愬姛浜嬩欢
+            /// </summary>
+            UnlockSuccessEvent = 2,
+            /// <summary>
+            /// Lock鍛戒护锛歟rror,invalid RFID ID浜嬩欢
+            /// </summary>
+            LockInvalidRfidIdEvent = 3,
+            /// <summary>
+            /// Lock鍛戒护锛歟rror,invalid schedule浜嬩欢
+            /// </summary>
+            LockInvalidScheduleEvent = 4,
+            /// <summary>
+            /// Unlock鍛戒护锛歟rror,invalid RFID ID浜嬩欢
+            /// </summary>
+            UnlockInvalidRfidIdEvent = 5,
+            /// <summary>
+            /// Unlock鍛戒护锛歟rror,invalid schedule浜嬩欢
+            /// </summary>
+            UnlockInvalidScheduleEvent = 6,
+        }
+        #endregion
+
+        #region 闂ㄩ攣缂栫▼浜嬩欢閫氱煡
+        /// <summary>
+        /// 闂ㄩ攣缂栫▼浜嬩欢閫氱煡
+        /// </summary>
+        public DoorLockProgrammingEventNotificationCommand doorLockProgrammingEventNotificationCommand;
+        /// <summary>
+        /// 闂ㄩ攣缂栫▼浜嬩欢閫氱煡
+        /// </summary>
+        [System.Serializable]
+        public class DoorLockProgrammingEventNotificationCommand
+        {
+            /// <summary>
+            /// 鐢ㄦ埛id
+            ///闂ㄩ攣鏈湴褰曞叆鐨勫瘑鐮併�佹寚绾广�佹劅搴斿崱閮芥湁鍞竴瀵瑰簲鐨勭敤鎴稩d
+            /// </summary>
+            public int UserID;
+            /// <summary>
+            /// 淇濈暀
+            /// </summary>
+            public int UserType;
+            /// <summary>
+            ///  淇濈暀
+            /// </summary>
+            public int UserStatus;
+            /// <summary>
+            /// 缂栫▼浜嬩欢瑙﹀彂婧�
+            /// 甯哥敤锛�
+            /// 0:Keypad(閿洏/瀵嗙爜)锛�3:RFID(灏勯鍗�)锛�15:鎸囩汗
+            ///涓嶅父鐢細
+            /// 1:RF(Zigbee鏃犵嚎)锛�2:Manual(鎵嬪姩)锛�255:Indeterminate(涓嶇‘瀹�)
+            /// </summary>
+            public int ProgramEventSoure;
+            /// <summary>
+            /// 缂栫▼浜嬩欢鐮�
+            /// 甯哥敤锛�
+            /// 閿洏/瀵嗙爜锛屾寚绾广�佹劅搴斿崱锛�1:Lock鍛戒护鎴愬姛浜嬩欢锛�2:Unlock鍛戒护鎴愬姛浜嬩欢
+            ///涓嶅父鐢細
+            /// 璇锋煡鐪嬫灇涓�
+            /// </summary>
+            public int ProgramEventCode;
+            /// <summary>
+            /// 淇濈暀锛岄粯璁�0
+            /// </summary>
+            public int PIN;
+            /// <summary>
+            /// 闂ㄩ攣鏈湴褰撳墠鏃堕棿鐨勬椂闂存埑
+            /// </summary>
+            public int ZigbeeLocalTime;
+        }
+        #endregion
+
+        #region 鐭闂ㄩ攣鏃堕棿
+        /// <summary>
+        /// 鐭闂ㄩ攣鏃堕棿
+        /// </summary>
+        /// <param name="timestamp"></param>
+        /// <returns></returns>
+        public async System.Threading.Tasks.Task<SetWritableValueResponAllData> RectifyDoorLockTimeAsync(int timestamp)
+        {
+            if (Gateway == null)
+            {
+                return null;
+            }
+            return await System.Threading.Tasks.Task.Run(async () =>
+            {
+                SetWritableValueResponAllData 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 SetWritableValueResponAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
+                        }
+                        else
+                        {
+                            d = new SetWritableValueResponAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
+                        }
+                    }
+
+                    if (topic == gatewayID + "/" + "SetWritableValue_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 tempData = Newtonsoft.Json.JsonConvert.DeserializeObject<SetWritableValueResponData>(jobject["Data"].ToString());
+
+                        if (tempData == null)
+                        {
+                            d = new SetWritableValueResponAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
+                        }
+                        else
+                        {
+                            d = new SetWritableValueResponAllData { setWritableValueResponData = tempData };
+                            DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_{ topic}");
+                        }
+                    }
+                };
+                Gateway.Actions += action;
+                DebugPrintLog("SetWritableValue_Actions 鍚姩" + "_" + System.DateTime.Now.ToString());
+
+                try
+                {
+                    var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", DeviceEpoint }, { "Cluster_ID", 10 }, { "Command", 120 } };
+                    var data = new JObject { { "Undivided", 0 }, { "AttributeId", 0 }, { "AttributeDataType", 226 }, { "AttributeData", timestamp } };
+                    jObject.Add("Data", data);
+                    Gateway.Send("SetWritableValue", jObject.ToString());
+                }
+                catch { }
+
+                var dateTime = DateTime.Now;
+                while ((DateTime.Now - dateTime).TotalMilliseconds < WaitReceiveDataTime)
+                {
+                    await System.Threading.Tasks.Task.Delay(10);
+                    if (d != null)
+                    {
+                        break;
+                    }
+                }
+                if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime)
+                {
+                    d = new SetWritableValueResponAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
+                }
+                Gateway.Actions -= action;
+                DebugPrintLog("SetWritableValue_Actions 閫�鍑�" + System.DateTime.Now.ToString());
+
+                return d;
+            });
+        }
+
+        /// <summary>
+        /// 缃戝叧鐗堟湰淇℃伅,缃戝叧鍙嶉淇℃伅
+        /// </summary>
+        public SetWritableValueResponAllData setWritableValueResponAllData;
+        /// <summary>
+        /// 缃戝叧鐗堟湰淇℃伅,缃戝叧鍙嶉淇℃伅
+        /// </summary>
+        [System.Serializable]
+        public class SetWritableValueResponAllData
+        {
+            /// <summary>
+            /// 閿欒淇℃伅
+            /// </summary>
+            public string errorMessageBase;
+            /// <summary>
+            /// 缃戝叧淇℃伅閿欒鍙嶉
+            /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
+            /// </summary>
+            public ErrorResponData errorResponData;
+            /// <summary>
+            /// 缃戝叧鐗堟湰淇℃伅
+            /// </summary>
+            public SetWritableValueResponData setWritableValueResponData;
+        }
+
+        /// <summary>
+        /// 璁剧疆鍙啓灞炴�х殑鍊肩殑鏁版嵁
+        /// </summary>
+        [System.Serializable]
+        public class SetWritableValueResponData
+        {
+            /// <summary>
+            /// 閰嶇疆灞炴�ф墍鍦ㄧ殑cluster
+            /// </summary>
+            public int Cluster;
+            /// <summary>
+            /// 0锛氶厤缃垚鍔燂紙鑻ラ厤缃垚鍔燂紝涓嬮潰鐨凙ttributeId瀛楁涓嶅瓨鍦級
+            ///<para>134锛氫笉鏀寔璇ュ睘鎬�</para>
+            ///<para>135锛氭棤鏁堢殑灞炴�у��</para>
+            ///<para>141锛氭棤鏁堢殑鏁版嵁绫诲瀷</para>
+            /// </summary>
+            public int Status;
+
+        }
+        #endregion
+        #endregion
+
+        #region 涓庤澶囬�氳鎺ュ彛锛堢鏈夊懡浠わ級
+
+        #region 鐢ㄦ埛绠$悊鎺у埗
+        ///<summary >
+        ///鐢ㄦ埛绠$悊鎺у埗
+        /// <para>passData:閫忎紶鏁版嵁</para>
+        /// </summary>
+        public async System.Threading.Tasks.Task<DefaultControlResponseAllData> DefaultControlAsync(string passData)
+        {
+            DefaultControlResponseAllData result = null;
+            if (Gateway == null)
+            {
+                result = new DefaultControlResponseAllData { errorMessageBase = "褰撳墠娌℃湁缃戝叧" };
+                return result;
+            }
+            return await System.Threading.Tasks.Task.Run(async () =>
+            {
+                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)
+                        {
+                            result = new DefaultControlResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
+                        }
+
+                        else
+                        {
+                            result = new DefaultControlResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
+                        }
+                    }
+                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
+                    {
+                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
+                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
+
+                        if (gatewayTemp.clientDataPassthroughResponseData == null)
+                        {
+                            result = new DefaultControlResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
+                        }
+                        else
+                        {
+                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
+                            {
+                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
+                                if (data.Length == 16)
+                                {
+                                    var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
+                                    if (command == "0002")
+                                    {
+                                        var tempD = new DefaultControlResponseData();
+                                        tempD.command = data[12].ToString() + data[13].ToString() + data[10].ToString() + data[11].ToString();
+                                        tempD.status = Convert.ToInt32(data[14].ToString() + data[15].ToString(), 16);
+                                        if (tempD.command == "0450")
+                                        {
+                                            result = new DefaultControlResponseAllData { defaultControlResponseData = tempD };
+                                            DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0450_{ topic}");
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                };
+
+                Gateway.Actions += action;
+                DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString());
+
+                try
+                {
+                    var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
+                    var data = new JObject { { "PassData", passData } };
+                    jObject.Add("Data", data);
+                    Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
+                }
+                catch { }
+
+                var dateTime = DateTime.Now;
+                while ((DateTime.Now - dateTime).TotalMilliseconds < 9000)// WaitReceiveDataTime)
+                {
+                    await System.Threading.Tasks.Task.Delay(10);
+                    if (result != null)
+                    {
+                        break;
+                    }
+                }
+                if ((DateTime.Now - dateTime).TotalMilliseconds > 9000)
+                {
+                    result = new DefaultControlResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
+                }
+                Gateway.Actions -= action;
+                DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString());
+
+                return result;
+            });
+        }
+
+        /// <summary>
+        /// 鐢ㄦ埛绠$悊鍙戦�佹暟鎹�
+        /// userIdList:涓暟涓嶈兘瓒呰繃10涓�
+        /// </summary>
+        public string FreezeAccountData(List<int> userIdList, AccessType accessType)
+        {
+            string data = "";
+            string dataLength = "";
+            string dataComand1 = "50";
+            string dataComand2 = "04";
+            string dataSerialNum = "01";
+            string addDataLength = "";
+            string delUserTypeStr = "";
+            string userIdStr = "";
+            try
+            {
+                if (userIdList.Count == 0)
+                {
+                    return null;
+                }
+                if (userIdList.Count > 9)
+                {
+                    return null;
+                }
+                var tempLength = 5 + userIdList.Count * 2;
+                string tempLength1 = Convert.ToString(tempLength, 16);
+                switch (tempLength1.Length)
+                {
+                    case 1:
+                        dataLength = "0" + tempLength1.ToUpper();
+                        break;
+                    case 2:
+                        dataLength = tempLength1.ToUpper();
+                        break;
+                }
+
+                var tempAddDataLength = 1 + userIdList.Count * 2;
+                string tempAddDataLength1 = Convert.ToString(tempAddDataLength, 16);
+                switch (tempAddDataLength1.Length)
+                {
+                    case 1:
+                        addDataLength = "0" + tempAddDataLength1.ToUpper();
+                        break;
+                    case 2:
+                        addDataLength = tempAddDataLength1.ToUpper();
+                        break;
+                }
+
+                switch ((int)accessType)
+                {
+                    case 0:
+                        delUserTypeStr = "00";
+                        break;
+                    case 1:
+                        delUserTypeStr = "01";
+                        break;
+                    case 2:
+                        delUserTypeStr = "20";
+                        break;
+                    case 3:
+                        delUserTypeStr = "21";
+                        break;
+                    case 4:
+                        delUserTypeStr = "10";
+                        break;
+                    case 5:
+                        delUserTypeStr = "30";
+                        break;
+                    case 6:
+                        delUserTypeStr = "31";
+                        break;
+                }
+
+                var sbString = new System.Text.StringBuilder();
+                foreach (var userId in userIdList)
+                {
+                    string temp = Convert.ToString(userId, 16);
+                    switch (temp.Length)
+                    {
+                        case 1:
+                            userIdStr = "0" + temp + "00";
+                            break;
+                        case 2:
+                            userIdStr = temp + "00";
+                            break;
+                        case 3:
+                            var thirdBit = temp.Substring(temp.Length - 2, 1);
+                            userIdStr = temp + "0" + thirdBit;
+                            break;
+                        case 4:
+                            userIdStr = temp;
+                            break;
+                    }
+                    sbString.Append(userIdStr.ToString().ToUpper());
+                }
+                data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
+                   delUserTypeStr + sbString;
+            }
+            catch { };
+
+            return data;
+        }
+
+        /// <summary>
+        /// 鐢ㄦ埛绠$悊鍙戦�佹暟鎹�
+        /// </summary>
+        public string SetUserAccessData(int userId, AccessType accessType)
+        {
+            string data = "";
+            string dataLength = "07";
+            string dataComand1 = "50";
+            string dataComand2 = "04";
+            string dataSerialNum = "01";
+            string addDataLength = "03";
+            string delUserTypeStr = "";
+            string userIdStr = "";
+            try
+            {
+                switch ((int)accessType)
+                {
+                    case 0:
+                        delUserTypeStr = "00";
+                        break;
+                    case 1:
+                        delUserTypeStr = "01";
+                        break;
+                    case 2:
+                        delUserTypeStr = "20";
+                        break;
+                    case 3:
+                        delUserTypeStr = "21";
+                        break;
+                }
+                var sbString = new System.Text.StringBuilder();
+                string temp = Convert.ToString(userId, 16);
+
+                switch (temp.Length)
+                {
+                    case 1:
+                        userIdStr = "0" + temp + "00";
+                        break;
+                    case 2:
+                        userIdStr = temp + "00";
+                        break;
+                    case 3:
+                        var thirdBit = temp.Substring(temp.Length - 2, 1);
+                        userIdStr = temp + "0" + thirdBit;
+                        break;
+                    case 4:
+                        userIdStr = temp;
+                        break;
+                }
+                sbString.Append(userIdStr.ToString().ToUpper());
+                data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
+                   delUserTypeStr + sbString;
+            }
+            catch { };
+
+            return data;
+        }
+
+        /// <summary>
+        /// 鐢ㄦ埛绠$悊鍙戦�佹暟鎹洖澶�
+        /// </summary>
+        public DefaultControlResponseAllData defaultControlResponseAllData;
+        [System.Serializable]
+        public class DefaultControlResponseAllData
+        {
+            /// <summary>
+            /// 閿欒淇℃伅
+            /// </summary>
+            public string errorMessageBase;
+            /// <summary>
+            /// 缃戝叧淇℃伅閿欒鍙嶉
+            /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
+            /// </summary>
+            public ErrorResponData errorResponData;
+            /// <summary>
+            /// 鐢ㄦ埛绠$悊鏁版嵁鍥炲
+            /// </summary>
+            public DefaultControlResponseData defaultControlResponseData;
+        }
+
+        /// <summary>
+        /// 鐢ㄦ埛绠$悊鏁版嵁鍥炲
+        /// </summary>
+        [System.Serializable]
+        public class DefaultControlResponseData
+        {
+            /// <summary>
+            ///鍝嶅簲鎿嶄綔鐮侊紙0-ffff锛�
+            /// </summary>
+            public string command = "";
+            /// <summary>
+            /// 鐘舵�佸��
+            /// <para>榛樿鍝嶅簲缁撴灉锛�
+            ///<para>0 鎴愬姛</para>
+            ///<para>1 澶辫触</para>
+            ///<para>2 鐢ㄦ埛涓嶅瓨鍦�</para>
+            ///<para>32 鍐荤粨鎴愬姛</para>
+            ///<para>34 鍐荤粨澶辫触</para>
+            ///<para>33 瑙e喕鎴愬姛</para>
+            ///<para>35 瑙e喕澶辫触</para>
+            /// </summary>
+            public int status = -1;
+        }
+
+        public enum AccessType
+        {
+            /// <summary>
+            /// 0x00 鍒犻櫎鍏ㄩ儴涓存椂鐢ㄦ埛
+            /// </summary>
+            DelAllUsers = 0,
+            /// <summary>
+            /// 0x01 鍒犻櫎鎸囧畾鐢ㄦ埛(鎸夌紪鍙�)
+            /// </summary>
+            DelCurrentUser = 1,
+            /// <summary>
+            /// 0x20 鍐荤粨鎸囧畾鐢ㄦ埛
+            /// </summary>
+            DisEnable = 2,
+            /// <summary>
+            /// 0x21 瑙e喕鎸囧畾鐢ㄦ埛
+            /// </summary>
+            Enable = 3,
+            /// <summary>
+            /// 0x10 澶氫釜鎸囧畾鐢ㄦ埛鍒犻櫎
+            /// </summary>
+            DelMoreUsers = 4,
+            /// <summary>
+            /// 0x30 澶氫釜鎸囧畾鐢ㄦ埛鍐荤粨
+            /// </summary>
+            DisEnableMoreUsers = 5,
+            /// <summary>
+            /// 0x31 澶氫釜鎸囧畾鐢ㄦ埛瑙e喕
+            /// </summary>
+            EnableMoreUsers = 6,
+        }
+        #endregion
+
+        #region 楠岃瘉闂ㄩ攣瀵嗙爜
+        ///<summary >
+        ///楠岃瘉闂ㄩ攣瀵嗙爜
+        ///<para>inputPassword:杈撳叆鐨勯棬閿佸瘑鐮�</para>
+        /// </summary>
+        public async System.Threading.Tasks.Task<VerifyPasswordResponseAllData> VerifyPasswordAsync(string inputPassword)
+        {
+            VerifyPasswordResponseAllData result = null;
+            if (Gateway == null)
+            {
+                result = new VerifyPasswordResponseAllData { errorMessageBase = "褰撳墠娌℃湁缃戝叧" };
+                return result;
+            }
+            return await System.Threading.Tasks.Task.Run(async () =>
+            {
+                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)
+                        {
+                            result = new VerifyPasswordResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
+                        }
+
+                        else
+                        {
+                            result = new VerifyPasswordResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
+                        }
+                    }
+                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
+                    {
+                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
+                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
+
+                        if (gatewayTemp.clientDataPassthroughResponseData == null)
+                        {
+                            result = new VerifyPasswordResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
+                        }
+                        else
+                        {
+                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
+                            {
+                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
+                                if (data.Length == 12)
+                                {
+                                    var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
+                                    if (command == "0454")
+                                    {
+                                        var result1 = Convert.ToInt32(data[10].ToString() + data[11].ToString(), 16);
+                                        result = new VerifyPasswordResponseAllData { result = result1 };
+                                        DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0454_{ topic}");
+                                    }
+                                }
+                            }
+                        }
+                    }
+                };
+
+                Gateway.Actions += action;
+                DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString());
+
+                try
+                {
+                    var getPw = await GetkeyPassword();
+                    var passData = VerifyPasswordData(inputPassword, getPw);
+                    var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
+                    var data = new JObject { { "PassData", passData } };
+                    jObject.Add("Data", data);
+                    Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
+                }
+                catch { }
+
+                var dateTime = DateTime.Now;
+                while ((DateTime.Now - dateTime).TotalMilliseconds < 9000)// WaitReceiveDataTime)
+                {
+                    await System.Threading.Tasks.Task.Delay(10);
+                    if (result != null && result.result == 0)
+                    {
+                        break;
+                    }
+                }
+                if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime)
+                {
+                    result = new VerifyPasswordResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
+                }
+                Gateway.Actions -= action;
+                DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString());
+
+                return result;
+            });
+        }
+        /// <summary>
+        /// 楠岃瘉闂ㄩ攣瀵嗙爜
+        /// </summary>
+        public string VerifyPasswordData(string keyPassword, int password, int fixedPassword = 0x190605)
+        {
+            string data = "";
+            string dataLength = "08";
+            string dataComand1 = "53";
+            string dataComand2 = "04";
+            string dataSerialNum = "01";
+            string addDataLength = "04";
+            string passwordStr = "";
+            try
+            {
+                int keyPasswordInt = System.Convert.ToInt32(keyPassword, 16);
+                var pawStr = System.Convert.ToString((keyPasswordInt ^ password) + fixedPassword, 16);
+                pawStr = pawStr.PadLeft(8, '0');
+                for (int i = 6; i >= 0; i = i - 2)
+                {
+                    passwordStr += pawStr.Substring(i, 2);
+                }
+                data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
+                 passwordStr;
+            }
+            catch { };
+            return data;
+        }
+
+        /// <summary>
+        /// 鐢ㄦ埛绠$悊鍙戦�佹暟鎹洖澶�
+        /// </summary>
+        public VerifyPasswordResponseAllData verifyPasswordResponseAllData;
+        [System.Serializable]
+        public class VerifyPasswordResponseAllData
+        {
+            /// <summary>
+            /// 閿欒淇℃伅
+            /// </summary>
+            public string errorMessageBase;
+            /// <summary>
+            /// 缃戝叧淇℃伅閿欒鍙嶉
+            /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
+            /// </summary>
+            public ErrorResponData errorResponData;
+            /// <summary>
+            /// 鐢ㄦ埛绠$悊鏁版嵁鍥炲
+            /// <para>0:鎴愬姛</para>
+            ///<para>1:澶辫触</para>
+            /// </summary>
+            public int result = -1;
+        }
+        #endregion
+
+        #region 杩滅▼寮�閿�
+        ///<summary >
+        ///杩滅▼寮�閿�
+        ///<para>inputPassword: 杈撳叆瀵嗙爜/para>
+        /// </summary>
+        public async System.Threading.Tasks.Task<RemoteResponseAllData> RemoteControlAsync(string inputPassword)
+        {
+            RemoteResponseAllData result = null;
+            if (Gateway == null)
+            {
+                result = new RemoteResponseAllData { errorMessageBase = "褰撳墠娌℃湁缃戝叧" };
+                return result;
+            }
+            return await System.Threading.Tasks.Task.Run(async () =>
+            {
+                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)
+                        {
+                            result = new RemoteResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
+                        }
+
+                        else
+                        {
+                            result = new RemoteResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
+                        }
+                    }
+                    else if (topic == $"{gatewayID}/DoorLock/DoorLockOperatingEventNotificationCommand")
+                    {
+                        var OperatingEventNotificationDatad = Newtonsoft.Json.JsonConvert.DeserializeObject<ZigBee.Device.DoorLock.DoorLockOperatingEventNotificationCommand>(jobject["Data"].ToString());
+                        if (OperatingEventNotificationDatad != null)
+                        {
+                            if (OperatingEventNotificationDatad.OperationEventSoure == 1 && OperatingEventNotificationDatad.OperationEventCode == 5)
+                            {
+                                result = new RemoteResponseAllData { IsPawDispear = true };
+                            }
+                        }
+                    }
+                    else if (topic == gatewayID + "/" + "ZbDataPassthrough")
+                    {
+                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
+                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
+
+                        if (gatewayTemp.clientDataPassthroughResponseData == null)
+                        {
+                            result = new RemoteResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
+                        }
+                        else
+                        {
+                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
+                            {
+                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
+                                if (data.Length == 16)
+                                {
+                                    var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
+                                    if (command == "0002")
+                                    {
+                                        var tempD = new RemoteResponseData();
+                                        tempD.command = data[12].ToString() + data[13].ToString() + data[10].ToString() + data[11].ToString();
+                                        tempD.status = Convert.ToInt32(data[14].ToString() + data[15].ToString(), 16);
+                                        if (tempD.command == "0462")
+                                        {
+                                            result = new RemoteResponseAllData { responseData = tempD };
+                                            DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0462_{ topic}");
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                };
+                Gateway.Actions += action;
+                DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString());
+
+                try
+                {
+                    var getPw = await GetkeyPassword();
+                    var passData = RemoteData(inputPassword, getPw);
+                    var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
+                    var data = new JObject { { "PassData", passData } };
+                    jObject.Add("Data", data);
+                    Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
+                }
+                catch { }
+
+                var dateTime = DateTime.Now;
+                while ((DateTime.Now - dateTime).TotalMilliseconds < 5000)// WaitReceiveDataTime)
+                {
+                    await System.Threading.Tasks.Task.Delay(10);
+                    if (result == null)
+                    {
+                        continue;
+                    }
+                    if (result.responseData != null && result.responseData.command == "0462")
+                    {
+                        break;
+                    }
+                    if (result.IsPawDispear == true)
+                    {
+                        break;
+                    }
+                }
+                if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime)
+                {
+                    result = new RemoteResponseAllData { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
+                }
+                Gateway.Actions -= action;
+                DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString());
+
+                return result;
+            });
+        }
+        /// <summary>
+        /// 杩滅▼鍙戦�佹暟鎹�
+        /// </summary>
+        string RemoteData(string keyPassword, int password, int fixedPassword = 0x190605)
+        {
+            string data = "";
+            string dataLength = "08";
+            string dataComand1 = "62";
+            string dataComand2 = "04";
+            string dataSerialNum = "01";
+            string addDataLength = "04";
+            string passwordStr = "";
+            try
+            {
+                int keyPasswordInt = System.Convert.ToInt32(keyPassword, 16);
+                var pawStr = System.Convert.ToString((keyPasswordInt ^ password) + fixedPassword, 16);
+                pawStr = pawStr.PadLeft(8, '0');
+                for (int i = 6; i >= 0; i = i - 2)
+                {
+                    passwordStr += pawStr.Substring(i, 2);
+                }
+                data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
+                 passwordStr;
+            }
+            catch { };
+
+            return data;
+        }
+
+        /// <summary>
+        ///  杩滅▼鍥炲鏁版嵁
+        /// </summary>
+        public RemoteResponseAllData remoteResponseAllData;
+        [System.Serializable]
+        public class RemoteResponseAllData
+        {
+            /// <summary>
+            /// 閿欒淇℃伅
+            /// </summary> 
+            public string errorMessageBase;
+            /// <summary>
+            /// 缃戝叧淇℃伅閿欒鍙嶉
+            /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
+            /// </summary>
+            public ErrorResponData errorResponData;
+            /// <summary>
+            /// 涓存椂瀵嗙爜鍥炲鏁版嵁
+            /// </summary>
+            public RemoteResponseData responseData;
+            /// <summary>
+            /// 鏄惁瀵嗙爜琚垹闄�
+            /// </summary>
+            public bool IsPawDispear = false;
+        }
+
+        /// <summary>
+        /// 鐢ㄦ埛绠$悊鏁版嵁鍥炲
+        /// </summary>
+        [System.Serializable]
+        public class RemoteResponseData
+        {
+            /// <summary>
+            ///鍝嶅簲鎿嶄綔鐮侊紙0-ffff锛�
+            /// </summary>
+            public string command = "";
+            /// <summary>
+            /// 鐘舵�佸��
+            /// <para>榛樿鍝嶅簲缁撴灉锛�
+            ///<para>0 鎴愬姛</para>
+            ///<para>1 澶辫触</para> 
+            /// </summary>
+            public int status = -1;
+        }
+        #endregion
+
+        #region 涓存椂瀵嗙爜鍙戦�佹暟鎹�
+        ///<summary >
+        ///涓存椂瀵嗙爜
+        ///<para>inputPassword: 杈撳叆瀵嗙爜/para>
+        /// </summary>
+        public async System.Threading.Tasks.Task<TempPasswordResponseAllData> TempPasswordAsync(string inputPassword, System.DateTime startTime, System.DateTime endTime, string fixedPassword = "190605")
+        {
+            TempPasswordResponseAllData result = null;
+            if (Gateway == null)
+            {
+                result = new TempPasswordResponseAllData { errorMessageBase = "褰撳墠娌℃湁缃戝叧" };
+                return result;
+            }
+            return await System.Threading.Tasks.Task.Run(async () =>
+            {
+                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)
+                        {
+                            result = new TempPasswordResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
+                        }
+
+                        else
+                        {
+                            result = new TempPasswordResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
+                        }
+                    }
+                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
+                    {
+                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
+                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
+
+                        if (gatewayTemp.clientDataPassthroughResponseData == null)
+                        {
+                            result = new TempPasswordResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
+                        }
+                        else
+                        {
+                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
+                            {
+                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
+                                if (data.Length == 16)
+                                {
+                                    var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
+                                    if (command == "0002")
+                                    {
+                                        var tempD = new TempPasswordResponseData();
+                                        tempD.command = data[12].ToString() + data[13].ToString() + data[10].ToString() + data[11].ToString();
+                                        tempD.status = Convert.ToInt32(data[14].ToString() + data[15].ToString(), 16);
+                                        if (tempD.command == "0463")
+                                        {
+                                            result = new TempPasswordResponseAllData { responseData = tempD };
+                                            DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0463_{ topic}");
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                };
+
+                Gateway.Actions += action;
+                DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString());
+
+                try
+                {
+                    var getPw = await GetkeyPassword();
+                    var passData = TempPasswordData(inputPassword, getPw, startTime, endTime);
+                    var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
+                    var data = new JObject { { "PassData", passData } };
+                    jObject.Add("Data", data);
+                    Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
+                }
+                catch { }
+
+                var dateTime = DateTime.Now;
+                while ((DateTime.Now - dateTime).TotalMilliseconds < 9000)// WaitReceiveDataTime)
+                {
+                    await System.Threading.Tasks.Task.Delay(10);
+                    if (result != null && result.responseData != null && result.responseData.command == "0463")
+                    {
+                        break;
+                    }
+                }
+                if ((DateTime.Now - dateTime).TotalMilliseconds > 9000)
+                {
+                    result = new TempPasswordResponseAllData
+                    { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
+                }
+                Gateway.Actions -= action;
+                DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString());
+
+                return result;
+            });
+        }
+        /// <summary>
+        /// 涓存椂瀵嗙爜鍙戦�佹暟鎹�
+        /// </summary>
+        public string TempPasswordData(string keyPassword, int password, System.DateTime startTime, System.DateTime endTime)
+        {
+            string data = "";
+            string dataLength = "10";
+            string dataComand1 = "63";
+            string dataComand2 = "04";
+            string dataSerialNum = "01";
+            string addDataLength = "0c";
+            string passwordStr = "";
+            string vaildTimeStr = "";
+            string invalidTimeStr = "";
+            try
+            {
+                int keyPasswordInt = System.Convert.ToInt32(keyPassword, 16);
+                var pawStr = System.Convert.ToString((keyPasswordInt ^ password) + 0x190605, 16);
+                pawStr = pawStr.PadLeft(8, '0');
+                for (int i = 6; i >= 0; i = i - 2)
+                {
+                    passwordStr += pawStr.Substring(i, 2);
+                }
+
+                var startTimeStr = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetUnixTimeStamp(startTime);
+                var endTimeStr = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetUnixTimeStamp(endTime);
+                startTimeStr = string.Format("{0:X}", System.Convert.ToInt64(startTimeStr));
+                endTimeStr = string.Format("{0:X}", System.Convert.ToInt64(endTimeStr));
+                for (int i = 6; i >= 0; i = i - 2)
+                {
+                    vaildTimeStr += startTimeStr.Substring(i, 2);
+                    invalidTimeStr += endTimeStr.Substring(i, 2);
+                }
+
+                data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
+                   passwordStr + vaildTimeStr + invalidTimeStr;
+            }
+            catch (Exception ex)
+            {
+                var mess = ex.Message;
+            };
+            return data;
+        }
+
+        /// <summary>
+        /// 涓存椂瀵嗙爜鍥炲鏁版嵁
+        /// </summary>
+        public TempPasswordResponseAllData tempPasswordResponseAllData;
+        [System.Serializable]
+        public class TempPasswordResponseAllData
+        {
+            /// <summary>
+            /// 閿欒淇℃伅
+            /// </summary> 
+            public string errorMessageBase;
+            /// <summary>
+            /// 缃戝叧淇℃伅閿欒鍙嶉
+            /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
+            /// </summary>
+            public ErrorResponData errorResponData;
+            /// <summary>
+            /// 涓存椂瀵嗙爜鍥炲鏁版嵁
+            /// </summary>
+            public TempPasswordResponseData responseData;
+        }
+
+        /// <summary>
+        /// 涓存椂瀵嗙爜鍥炲鏁版嵁
+        /// </summary>
+        [System.Serializable]
+        public class TempPasswordResponseData
+        {
+            /// <summary>
+            ///鍝嶅簲鎿嶄綔鐮侊紙0-ffff锛�
+            /// </summary>
+            public string command = "";
+            /// <summary>
+            /// 鐘舵�佸��
+            /// <para>0--娉ㄥ唽鎴愬姛</para>
+            /// <para>1--娉ㄥ唽澶辫触</para>
+            /// <para>2--鐢ㄦ埛宸插瓨鍦�(閲嶅瀵嗙爜)</para>
+            /// <para>3-- 鐢ㄦ埛宸叉弧(+宸叉弧绫诲瀷鍥炲)</para>
+            /// <para>4--鏈夋晥鏃堕棿閲嶅彔</para>
+            /// </summary>
+            public int status = -1;
+        }
+        #endregion
+
+        #region 鑾峰彇闂ㄩ攣瀵嗛挜
+        /// <summary>
+        /// 闂ㄩ攣闅忔満瀵嗙爜
+        /// <para>鑾峰彇鍔犲瘑鐨勯殢鏈哄瘑閽ワ紝杩斿洖鐨勫瘑閽ョ粡杩囦竴涓畝鍗曠殑鍔犳硶鍔犲瘑鍔犱笂0x190605锛屽洜姝よ幏鍙栫殑瀵嗛挜闇�瑕佸噺涓�0x190605</para>
+        /// </summary>
+        /// <returns></returns>
+        async System.Threading.Tasks.Task<int> GetkeyPassword()
+        {
+            string passwordStr = "";
+            var result = await GetKeyPassworAsync();
+            //杩斿洖灏忕
+            if (result == null || result.keyPassword == null)
+            {
+                return 0;
+            }
+
+            for (int i = 6; i >= 0; i = i - 2)
+            {
+                passwordStr += result.keyPassword.Substring(i, 2);
+            }
+            var keyPasswordInt = System.Convert.ToInt32(passwordStr, 16);
+            return keyPasswordInt - 0x190605;
+        }
+
+        ///<summary >
+        ///鑾峰彇闂ㄩ攣瀵嗛挜
+        /// </summary>
+        async System.Threading.Tasks.Task<KeyPasswordInfo> GetKeyPassworAsync(int keyType = 0)
+        {
+            KeyPasswordInfo result = null;
+            if (Gateway == null)
+            {
+                result = new KeyPasswordInfo { errorMessageBase = "褰撳墠娌℃湁缃戝叧" };
+                return result;
+            }
+            return await System.Threading.Tasks.Task.Run(async () =>
+            {
+                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)
+                        {
+                            result = new KeyPasswordInfo { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
+                        }
+
+                        else
+                        {
+                            result = new KeyPasswordInfo { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
+                        }
+                    }
+
+                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
+                    {
+                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
+                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
+
+                        if (gatewayTemp.clientDataPassthroughResponseData == null)
+                        {
+                            result = new KeyPasswordInfo { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
+                        }
+                        else
+                        {
+                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
+                            {
+                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
+                                if (data.Length == 20)
+                                {
+                                    var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
+
+                                    if (command == "0461")
+                                    {
+                                        var kType = Convert.ToInt32(data[10].ToString() + data[11].ToString(), 16);
+                                        var keyPassword = data[12].ToString() + data[13].ToString() + data[14].ToString() + data[15].ToString() + data[16].ToString() + data[17].ToString() + data[18].ToString() + data[19].ToString();
+                                        result = new KeyPasswordInfo { keyType = kType, keyPassword = keyPassword };
+                                        DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0460_{ topic}");
+                                    }
+                                }
+                            }
+                        }
+                    }
+                };
+
+                Gateway.Actions += action;
+                DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString());
+
+                try
+                {
+                    var passData = KeyPasswordData(keyType);
+                    var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
+                    var data = new JObject { { "PassData", passData } };
+                    jObject.Add("Data", data);
+                    Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
+                }
+                catch { }
+
+                var dateTime = DateTime.Now;
+                while ((DateTime.Now - dateTime).TotalMilliseconds < 9000)//WaitReceiveDataTime)
+                {
+                    await System.Threading.Tasks.Task.Delay(10);
+                    if (result != null)
+                    {
+                        break;
+                    }
+                }
+                if ((DateTime.Now - dateTime).TotalMilliseconds > WaitReceiveDataTime)
+                {
+                    result = new KeyPasswordInfo { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
+                }
+                Gateway.Actions -= action;
+                DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString());
+
+                return result;
+            });
+        }
+
+        /// <summary>
+        /// 鑾峰彇闂ㄩ攣瀵嗛挜
+        /// </summary>
+        string KeyPasswordData(int keyType)
+        {
+            string data = "";
+            string dataLength = "05";
+            string dataComand1 = "60";
+            string dataComand2 = "04";
+            string dataSerialNum = "01";
+            string addDataLength = "01";
+            string keyTypeData = "";
+
+            try
+            {
+                var tempTypeString = new System.Text.StringBuilder();
+                var temp = Convert.ToString(keyType, 16);
+                switch (temp.Length)
+                {
+                    case 1:
+                        keyTypeData = "0" + temp;
+                        break;
+                    case 2:
+                        keyTypeData = temp;
+                        break;
+                }
+                tempTypeString.Append(keyTypeData.ToString().ToUpper());
+                data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
+            tempTypeString;
+            }
+            catch { };
+
+            return data;
+        }
+
+        /// <summary>
+        /// 鑾峰彇闂ㄩ攣瀵嗛挜鍥炲
+        /// </summary>
+        [System.Serializable]
+        public class KeyPasswordInfo
+        {
+            /// <summary>
+            /// 閿欒淇℃伅
+            /// </summary>
+            public string errorMessageBase;
+            /// <summary>
+            /// 缃戝叧淇℃伅閿欒鍙嶉
+            /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
+            /// </summary>
+            public ErrorResponData errorResponData;
+            /// <summary>
+            ///瀵嗛挜绫诲瀷
+            ///<apra></apra>
+            /// </summary>
+            public int keyType = -1;
+
+            /// <summary>
+            /// 瀵嗛挜
+            /// </summary>
+            public string keyPassword;
+        }
+        #endregion
+
+        #region 璇诲彇閿佷笂淇℃伅
+        ///<summary >
+        ///璇诲彇閿佷笂淇℃伅
+        /// </summary>
+        public async System.Threading.Tasks.Task<DoorlockUserInfo> GetDoorlockUserInfoAsync()
+        {
+            DoorlockUserInfo result = null;
+            int totalNum = 0;
+            int currentNum = -1;
+            DoorLockUserDetailData doorLockUserDetailData = new DoorLockUserDetailData { };
+            if (Gateway == null)
+            {
+                result = new DoorlockUserInfo { errorMessageBase = "褰撳墠娌℃湁缃戝叧" };
+                return result;
+            }
+            return await System.Threading.Tasks.Task.Run(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 + "/" + "ZbDataPassthrough")
+                    {
+                        var clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
+
+                        if (clientDataPassthroughResponseData != null)
+                        {
+                            if (clientDataPassthroughResponseData.PassData != null)
+                            {
+                                var data = clientDataPassthroughResponseData.PassData;
+                                var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
+                                if (command == "0452")
+                                {
+                                    dateTime = DateTime.Now;
+                                    int returnAllLength = 2 + 2 * Convert.ToInt32(data[0].ToString() + data[1].ToString(), 16);
+                                    int usefulLength = (returnAllLength - 16);
+                                    int tempCount = 0;
+                                    var listData = new List<string>();
+                                    while (tempCount < usefulLength)
+                                    {
+                                        listData.Add(data[16 + tempCount].ToString());
+                                        tempCount++;
+                                    }
+                                    for (int j = 0; j < listData.Count / 4; j++)
+                                    {
+                                        int curIndex = 4 * j;
+                                        var userInfo = new UserObj();
+                                        userInfo.UserType = Convert.ToInt32(listData[curIndex + 2].ToString(), 16);
+                                        userInfo.UserId = Convert.ToInt32(listData[curIndex + 3].ToString() + listData[curIndex].ToString() + listData[curIndex + 1].ToString(), 16);
+                                        doorLockUserDetailData.UserObjList.Add(userInfo);
+                                    }
+                                    doorLockUserDetailData.userType = Convert.ToInt32(data[10].ToString() + data[11].ToString(), 16);
+                                    doorLockUserDetailData.totalNum = Convert.ToInt32(data[12].ToString() + data[13].ToString(), 16);
+                                    doorLockUserDetailData.currentNum = Convert.ToInt32(data[14].ToString() + data[15].ToString(), 16);
+                                    totalNum = doorLockUserDetailData.totalNum;
+                                    currentNum = doorLockUserDetailData.currentNum;
+                                    result = new DoorlockUserInfo { doorLockUserDetailData = doorLockUserDetailData };
+                                    DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0451_{ topic}");
+                                }
+                            }
+                        }
+                    }
+                };
+
+                Gateway.Actions += action;
+                DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString());
+
+                try
+                {
+                    var passData = DoorlockUserData();
+                    var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
+                    var data = new JObject { { "PassData", passData } };
+                    jObject.Add("Data", data);
+                    Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
+                }
+                catch { }
+
+                //鎺ユ敹涓�涓寘鏈�澶氱瓑3绉掞紝娌℃湁鏀跺埌灏遍��鍑�,鍗曟鏁版嵁鍖呬笉瓒呰繃30涓敤鎴�
+                while ((DateTime.Now - dateTime).TotalMilliseconds < 3000)
+                {
+                    await System.Threading.Tasks.Task.Delay(100);
+                    if (totalNum == currentNum)
+                    {
+                        break;
+                    }
+                }
+                //if ((DateTime.Now - dateTime).TotalMilliseconds > 3000)
+                //{
+                //    result = new DoorlockUserInfo { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
+                //}
+                Gateway.Actions -= action;
+                DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString());
+
+                return result;
+            });
+        }
+
+        /// <summary>
+        /// 璇诲彇閿佷笂淇℃伅
+        /// </summary>
+        string DoorlockUserData()
+        {
+            string data = "";
+            string dataLength = "05";
+            string dataComand1 = "51";
+            string dataComand2 = "04";
+            string dataSerialNum = "01";
+            string addDataLength = "01";
+            string keyTypeData = "01";
+
+            try
+            {
+                data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength + keyTypeData;
+            }
+            catch { };
+
+            return data;
+        }
+
+        /// <summary>
+        /// 璇诲彇閿佷笂淇℃伅鍥炲
+        /// </summary>
+        [System.Serializable]
+        public class DoorlockUserInfo
+        {
+            /// <summary>
+            /// 閿欒淇℃伅
+            /// </summary>
+            public string errorMessageBase;
+            /// <summary>
+            /// 缃戝叧淇℃伅閿欒鍙嶉
+            /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
+            /// </summary>
+            public ErrorResponData errorResponData;
+            /// <summary>
+            /// 闂ㄩ攣璁惧杩斿洖淇℃伅
+            /// </summary>
+            public DoorLockUserDetailData doorLockUserDetailData;
+        }
+
+        /// <summary>
+        /// 闂ㄩ攣璁惧杩斿洖淇℃伅
+        /// </summary>
+        public class DoorLockUserDetailData
+        {
+            /// <summary>
+            /// 绫诲瀷(璇诲彇閿佷笂宸叉湁鐢ㄦ埛)
+            /// </summary>
+            public int userType;
+            /// <summary>
+            /// 鏁版嵁鍖呮�绘暟
+            /// </summary>
+            public int totalNum;
+            /// <summary>
+            /// 鏁版嵁鍖呭簭鍙�
+            /// </summary>
+            public int currentNum;
+
+            /// <summary>
+            /// 铏氭嫙椹卞姩淇℃伅
+            /// </summary>
+            public List<UserObj> UserObjList = new List<UserObj>();
+        }
+
+        public class UserObj
+        {
+            /// <summary>
+            /// 闂ㄩ攣鐢ㄦ埛绫诲瀷
+            /// </summary>
+            public int UserType;
+
+            /// <summary>
+            /// 闂ㄩ攣鐢ㄦ埛Id鍙�
+            /// </summary>
+            public int UserId;
+        }
+        #endregion
+
+        #region 闊抽噺
+        ///<summary >
+        ///鑾峰彇闊抽噺
+        /// </summary>
+        public async System.Threading.Tasks.Task<VolumeResponseAllData> GetVolumeAsync()
+        {
+            VolumeResponseAllData result = null;
+            if (Gateway == null)
+            {
+                result = new VolumeResponseAllData { errorMessageBase = "褰撳墠娌℃湁缃戝叧" };
+                return result;
+            }
+            return await System.Threading.Tasks.Task.Run(async () =>
+            {
+                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)
+                        {
+                            result = new VolumeResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
+                        }
+
+                        else
+                        {
+                            result = new VolumeResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
+                        }
+                    }
+                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
+                    {
+                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
+                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
+
+                        if (gatewayTemp.clientDataPassthroughResponseData == null)
+                        {
+                            result = new VolumeResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
+                        }
+                        else
+                        {
+                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
+                            {
+                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
+                                if (data.Length == 14)
+                                {
+                                    var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
+                                    if (command == "0456")
+                                    {
+                                        var tempD = new VolumeResponseData();
+                                        tempD.command = data[10].ToString() + data[11].ToString();
+                                        tempD.value = Convert.ToInt32(data[12].ToString() + data[13].ToString(), 16);
+                                        result = new VolumeResponseAllData { volumeResponseData = tempD };
+                                        DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0456_{ topic}");
+                                    }
+                                }
+                            }
+                        }
+                    }
+                };
+
+                Gateway.Actions += action;
+                DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString());
+
+                try
+                {
+                    var passData = VolumeData(-1);
+                    var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
+                    var data = new JObject { { "PassData", passData } };
+                    jObject.Add("Data", data);
+                    Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
+                }
+                catch { }
+
+                var dateTime = DateTime.Now;
+                while ((DateTime.Now - dateTime).TotalMilliseconds < 9000)// WaitReceiveDataTime)
+                {
+                    await System.Threading.Tasks.Task.Delay(10);
+                    if (result != null && result.volumeResponseData != null)
+                    {
+                        break;
+                    }
+                }
+                if ((DateTime.Now - dateTime).TotalMilliseconds > 9000)
+                {
+                    result = new VolumeResponseAllData
+                    { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
+                }
+                Gateway.Actions -= action;
+                DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString());
+
+                return result;
+            });
+        }
+
+        ///<summary >
+        ///闊抽噺
+        ///<para>鍛戒护鍊�: comandValue</para>
+        ///<para>comandValue: 0-0x64 闊抽噺</para> 
+        /// </summary>
+        public async System.Threading.Tasks.Task<DefaultControlResponseAllData> SetVolumeAsync(int comandValue)
+        {
+            DefaultControlResponseAllData result = null;
+            if (Gateway == null)
+            {
+                result = new DefaultControlResponseAllData { errorMessageBase = "褰撳墠娌℃湁缃戝叧" };
+                return result;
+            }
+            return await System.Threading.Tasks.Task.Run(async () =>
+            {
+                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)
+                        {
+                            result = new DefaultControlResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
+                        }
+
+                        else
+                        {
+                            result = new DefaultControlResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
+                        }
+                    }
+                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
+                    {
+                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
+                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
+
+                        if (gatewayTemp.clientDataPassthroughResponseData == null)
+                        {
+                            result = new DefaultControlResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
+                        }
+                        else
+                        {
+                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
+                            {
+                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
+                                if (data.Length == 16)
+                                {
+                                    var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
+                                    if (command == "0002")
+                                    {
+                                        var tempD = new DefaultControlResponseData();
+                                        tempD.command = data[12].ToString() + data[13].ToString() + data[10].ToString() + data[11].ToString();
+                                        tempD.status = Convert.ToInt32(data[14].ToString() + data[15].ToString(), 16);
+                                        if (tempD.command == "0455")
+                                        {
+                                            result = new DefaultControlResponseAllData { defaultControlResponseData = tempD };
+                                            DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0455_{ topic}");
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                };
+
+                Gateway.Actions += action;
+                DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString());
+
+                try
+                {
+                    var passData = VolumeData(comandValue);
+                    var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
+                    var data = new JObject { { "PassData", passData } };
+                    jObject.Add("Data", data);
+                    Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
+                }
+                catch { }
+
+                var dateTime = DateTime.Now;
+                while ((DateTime.Now - dateTime).TotalMilliseconds < 9000)// WaitReceiveDataTime)
+                {
+                    await System.Threading.Tasks.Task.Delay(10);
+                    if (result != null && result.defaultControlResponseData != null)
+                    {
+                        break;
+                    }
+                }
+                if ((DateTime.Now - dateTime).TotalMilliseconds > 9000)
+                {
+                    result = new DefaultControlResponseAllData
+                    { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
+                }
+                Gateway.Actions -= action;
+                DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString());
+
+                return result;
+            });
+        }
+
+        /// <summary>
+        /// 闊抽噺鍙戦�佹暟鎹�
+        ///<para>comandValue: 0-100 闊抽噺</para> 
+        /// </summary>
+        public string VolumeData(int comandValue)
+        {
+            string data = "";
+            string dataLength = "05";
+            string dataComand1 = "55";
+            string dataComand2 = "04";
+            string dataSerialNum = "01";
+            string addDataLength = "01";
+            string cValue = "";
+            try
+            {
+                if (comandValue >= 1)
+                {
+                    cValue = Convert.ToString(comandValue, 16).ToUpper();
+                    if (cValue.Length == 1)
+                    {
+                        cValue = "0" + cValue;
+                    }
+                    else
+                    {
+                        cValue = cValue;
+                    }
+
+                }
+                else
+                {
+                    switch (comandValue)
+                    {
+                        case -1:
+                            cValue = "AA";
+                            break;
+                        case 0:
+                            cValue = "EB";
+                            break;
+                    }
+                }
+                data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
+                   cValue;
+            }
+            catch (Exception ex)
+            {
+                var mess = ex.Message;
+            };
+            return data;
+        }
+
+        /// <summary>
+        /// 闊抽噺鍥炲鏁版嵁
+        /// </summary>
+        public VolumeResponseAllData volumeResponseAllData;
+        [System.Serializable]
+        public class VolumeResponseAllData
+        {
+            /// <summary>
+            /// 閿欒淇℃伅
+            /// </summary> 
+            public string errorMessageBase;
+            /// <summary>
+            /// 缃戝叧淇℃伅閿欒鍙嶉
+            /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
+            /// </summary>
+            public ErrorResponData errorResponData;
+            /// <summary>
+            /// 闊抽噺鍥炲鏁版嵁
+            /// </summary>
+            public VolumeResponseData volumeResponseData;
+        }
+
+        /// <summary>
+        /// 闊抽噺鍥炲鏁版嵁
+        /// </summary>
+        [System.Serializable]
+        public class VolumeResponseData
+        {
+            /// <summary>
+            ///鍛戒护
+            ///<para>0x00 鎺ユ敹鎴愬姛</para>
+            ///<para>0xea 璇煶妯″紡</para>
+            ///<para>0xeb 闈欓煶妯″紡</para>
+            /// </summary>
+            public string command = "";
+            /// <summary>
+            /// 闊抽噺鍊�
+            /// <para>0xf1~0xfe  1-14闊抽噺</para>
+            /// <para>0 鏃犻煶閲忓��</para>
+            /// </summary>
+            public int value = -1;
+        }
+        #endregion
+
+        #region 甯稿紑妯″紡聽聽聽 聽聽聽聽聽
+        /// <summary>
+        /// 璇诲彇甯稿紑妯″紡
+        /// </summary>
+        /// <returns></returns>
+        public async System.Threading.Tasks.Task<OpenModeResponseAllData> ReadNormallyOpenModeFuncAsync()
+        {
+            OpenModeResponseAllData result = null;
+            if (Gateway == null)
+            {
+                result = new OpenModeResponseAllData { errorMessageBase = "褰撳墠娌℃湁缃戝叧" };
+                return result;
+            }
+            return await System.Threading.Tasks.Task.Run(async () =>
+            {
+                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)
+                        {
+                            result = new OpenModeResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
+                        }
+
+                        else
+                        {
+                            result = new OpenModeResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
+                        }
+                    }
+                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
+                    {
+                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
+                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
+
+                        if (gatewayTemp.clientDataPassthroughResponseData == null)
+                        {
+                            result = new OpenModeResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
+                        }
+                        else
+                        {
+                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
+                            {
+                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
+                                if (data.Length == 12)
+                                {
+                                    var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
+                                    if (command == "0458")
+                                    {
+                                        result = new OpenModeResponseAllData();
+                                        result.command = data[10].ToString() + data[11].ToString();
+                                        DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0457_{ topic}");
+                                    }
+                                }
+                            }
+                        }
+                    }
+                };
+
+                Gateway.Actions += action;
+                DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString());
+
+                try
+                {
+                    var passData = OpenModeData(SwitchMode.Obtain);
+                    var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
+                    var data = new JObject { { "PassData", passData } };
+                    jObject.Add("Data", data);
+                    Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
+                }
+                catch { }
+
+                var dateTime = DateTime.Now;
+                while ((DateTime.Now - dateTime).TotalMilliseconds < 9000)// WaitReceiveDataTime)
+                {
+                    await System.Threading.Tasks.Task.Delay(10);
+                    if (result != null)
+                    {
+                        break;
+                    }
+                }
+                if ((DateTime.Now - dateTime).TotalMilliseconds > 9000)
+                {
+                    result = new OpenModeResponseAllData
+                    { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
+                }
+                Gateway.Actions -= action;
+                DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString());
+
+                return result;
+            });
+        }
+
+        /// <summary>
+        /// 璁剧疆甯稿紑妯″紡
+        /// </summary>
+        /// <param name="IsNormallyOpenMode">鏄惁鎵撳紑甯稿紑妯″紡锛歵rue锛氭墦寮� false锛氬叧闂�</param>
+        /// <returns></returns>
+        public async System.Threading.Tasks.Task<DefaultControlResponseAllData> SetNormallyOpenModeFuncAsync(bool IsNormallyOpenMode)
+        {
+            DefaultControlResponseAllData result = null;
+            if (Gateway == null)
+            {
+                result = new DefaultControlResponseAllData { errorMessageBase = "褰撳墠娌℃湁缃戝叧" };
+                return result;
+            }
+            return await System.Threading.Tasks.Task.Run(async () =>
+            {
+                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)
+                        {
+                            result = new DefaultControlResponseAllData { errorMessageBase = "缃戝叧閿欒鍥炲锛屼笖鏁版嵁鏄┖" };
+                        }
+
+                        else
+                        {
+                            result = new DefaultControlResponseAllData { errorResponData = temp, errorMessageBase = ErrorMess(temp.Error) };
+                        }
+                    }
+                    if (topic == gatewayID + "/" + "ZbDataPassthrough")
+                    {
+                        var gatewayTemp = new ZbGateway() { DataID = jobject.Value<int>("Data_ID") };
+                        gatewayTemp.clientDataPassthroughResponseData = Newtonsoft.Json.JsonConvert.DeserializeObject<ClientDataPassthroughResponseData>(jobject["Data"].ToString());
+
+                        if (gatewayTemp.clientDataPassthroughResponseData == null)
+                        {
+                            result = new DefaultControlResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
+                        }
+                        else
+                        {
+                            if (gatewayTemp.clientDataPassthroughResponseData?.PassData != null)
+                            {
+                                var data = gatewayTemp.clientDataPassthroughResponseData.PassData;
+                                if (data.Length == 16)
+                                {
+                                    var command = data[4].ToString() + data[5].ToString() + data[2].ToString() + data[3].ToString();
+                                    if (command == "0002")
+                                    {
+                                        var tempD = new DefaultControlResponseData();
+                                        tempD.command = data[12].ToString() + data[13].ToString() + data[10].ToString() + data[11].ToString();
+                                        tempD.status = Convert.ToInt32(data[14].ToString() + data[15].ToString(), 16);
+                                        if (tempD.command == "0457")
+                                        {
+                                            result = new DefaultControlResponseAllData { defaultControlResponseData = tempD };
+                                            DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0457_{ topic}");
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                };
+
+                Gateway.Actions += action;
+                DebugPrintLog("ClientDataPassthrough_Actions 鍚姩" + System.DateTime.Now.ToString());
+
+                try
+                {
+                    var passData = "";
+                    if (IsNormallyOpenMode)
+                    {
+                        passData = OpenModeData(SwitchMode.NormallyOpen);
+                    }
+                    else
+                    {
+                        passData = OpenModeData(SwitchMode.NormallyClose);
+                    }
+                    var jObject = new JObject { { "DeviceAddr", DeviceAddr }, { "Epoint", 200 }, { "Cluster_ID", 64513 }, { "Command", 0 } };
+                    var data = new JObject { { "PassData", passData } };
+                    jObject.Add("Data", data);
+                    Gateway.Send(("ClientDataPassthrough"), jObject.ToString());
+                }
+                catch { }
+
+                var dateTime = DateTime.Now;
+                while ((DateTime.Now - dateTime).TotalMilliseconds < 9000)// WaitReceiveDataTime)
+                {
+                    await System.Threading.Tasks.Task.Delay(10);
+                    if (result != null && result.defaultControlResponseData != null)
+                    {
+                        break;
+                    }
+                }
+                if ((DateTime.Now - dateTime).TotalMilliseconds > 9000)
+                {
+                    result = new DefaultControlResponseAllData
+                    { errorMessageBase = " 鍥炲瓒呮椂锛岃閲嶆柊鎿嶄綔" };
+                }
+                Gateway.Actions -= action;
+                DebugPrintLog("ClientDataPassthrough_Actions 閫�鍑�" + System.DateTime.Now.ToString());
+
+                return result;
+            });
+        }
+
+        /// <summary>
+        /// 甯稿紑妯″紡聽鍙戦�佹暟鎹�
+        /// </summary>
+        public string OpenModeData(SwitchMode switchMode)
+        {
+            string data = "";
+            string dataLength = "05";
+            string dataComand1 = "57";
+            string dataComand2 = "04";
+            string dataSerialNum = "01";
+            string addDataLength = "01";
+            string cValue = "";
+            try
+            {
+                switch (switchMode)
+                {
+                    case SwitchMode.Obtain:
+                        cValue = "10";
+                        break;
+                    case SwitchMode.NormallyOpen:
+                        cValue = "12";
+                        break;
+                    case SwitchMode.NormallyClose:
+                        cValue = "13";
+                        break;
+                }
+                data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
+                   cValue;
+            }
+            catch (Exception ex)
+            {
+                var mess = ex.Message;
+            };
+            return data;
+        }
+
+        /// <summary>
+        /// 甯稿紑妯″紡聽鍥炲鏁版嵁
+        /// </summary>
+        public OpenModeResponseAllData openModeResponseAllData;
+        [System.Serializable]
+        public class OpenModeResponseAllData
+        {
+            /// <summary>
+            /// 閿欒淇℃伅
+            /// </summary> 
+            public string errorMessageBase;
+            /// <summary>
+            /// 缃戝叧淇℃伅閿欒鍙嶉
+            /// <para>褰撶綉鍏虫帴鏀跺埌瀹㈡埛绔俊鎭悗锛屽嚭鐜颁互涓嬪紓甯告儏鍐靛皢鍙嶉閿欒銆�</para>
+            /// </summary>
+            public ErrorResponData errorResponData;
+            /// <summary> 
+            /// 0x10 甯稿紑宸插紑鍚� 
+            /// <para>0x11 甯稿紑宸插叧闂�</para>
+            /// </summary>
+            public string command;
+        }
+
+
+        /// <summary>
+        /// 寮�鍏虫ā寮�
+        /// </summary>
+        public enum SwitchMode
+        {
+            /// <summary>
+            /// 0x10 鏌ヨ甯稿紑鐘舵��
+            /// </summary>
+            Obtain = 0x10,
+            /// <summary>
+            /// 0x12 寮�鍚父寮�
+            /// </summary>
+            NormallyOpen = 0x12,
+            /// <summary>
+            /// 0x13 鍏抽棴甯稿紑
+            /// </summary>
+            NormallyClose = 0x13
+        }
+        #endregion
+
+        #endregion
+    }
+}

--
Gitblit v1.8.0