From e96e11d6f8b965ea522c983e040d41e3b9ef105a Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期一, 18 五月 2020 21:33:19 +0800 Subject: [PATCH] 2020-05-18-4 --- ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs | 63 ++++++++++++++++++------------- 1 files changed, 36 insertions(+), 27 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs index 1fc9f8f..6a54df8 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs @@ -35,6 +35,12 @@ public string currentUserDisplayMethod = string.Empty;//褰撳墠鐢ㄦ埛鏄剧ず鏂瑰紡 //鏈湴鎵�鏈夎处鎴峰垪琛� public List<Shared.Phone.UserCenter.MemberInfoRes> localAllAccountList = new List<Shared.Phone.UserCenter.MemberInfoRes> { }; + + /// <summary> + /// 鏄惁甯稿紑妯″紡 + /// ture:甯稿紑锛� false:鍏抽棴 + /// </summary> + public bool IsDoorLockNormallyMode = false; public string LocalTempPassword = string.Empty;//鏈湴鐢熸垚鐨勪复鏃跺瘑鐮� public Dictionary<string, bool> IsFreezeAccount = new Dictionary<string, bool> { };//鏄惁鍐荤粨瀛愯处鎴� public Dictionary<string, bool> HasRemoteUnlockAccess = new Dictionary<string, bool> { };//鏄惁缁欏瓙璐︽埛鎷ユ湁杩滅▼寮�閿佺殑鏉′欢 @@ -979,8 +985,8 @@ /// <summary> /// 鐭闂ㄩ攣鏃堕棿 /// </summary> - /// <returns>The writable value async.</returns> - /// <param name="timestamp">鐭闂ㄩ攣鐨勬椂闂�</param> + /// <param name="timestamp"></param> + /// <returns></returns> public async System.Threading.Tasks.Task<SetWritableValueResponAllData> RectifyDoorLockTimeAsync(int timestamp) { if (Gateway == null) @@ -1164,8 +1170,11 @@ 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); - result = new DefaultControlResponseAllData { defaultControlResponseData = tempD }; - DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0450_{ topic}"); + if (tempD.command == "0450") + { + result = new DefaultControlResponseAllData { defaultControlResponseData = tempD }; + DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0450_{ topic}"); + } } } } @@ -1663,8 +1672,11 @@ 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); - result = new RemoteResponseAllData { responseData = tempD }; - DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0462_{ topic}"); + if (tempD.command == "0462") + { + result = new RemoteResponseAllData { responseData = tempD }; + DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0462_{ topic}"); + } } } } @@ -1844,8 +1856,11 @@ 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); - result = new TempPasswordResponseAllData { responseData = tempD }; - DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0463_{ topic}"); + if (tempD.command == "0463") + { + result = new TempPasswordResponseAllData { responseData = tempD }; + DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0463_{ topic}"); + } } } } @@ -2395,7 +2410,7 @@ { var tempD = new VolumeResponseData(); tempD.command = data[10].ToString() + data[11].ToString(); - tempD.value = Convert.ToInt32(data[13].ToString(), 16); + tempD.value = Convert.ToInt32(data[12].ToString() + data[13].ToString(), 16); result = new VolumeResponseAllData { volumeResponseData = tempD }; DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0456_{ topic}"); } @@ -2442,10 +2457,7 @@ ///<summary > ///闊抽噺 ///<para>鍛戒护鍊�: comandValue</para> - ///<para>comandValue: 0 闈欓煶</para> - ///<para>comandValue:1 鏈�灏忛煶閲�</para> - ///<para>comandValue:2~13 闊抽噺 </para> - ///<para>comandValue:14 鏈�澶ч煶閲�</para> + ///<para>comandValue: 0-0x64 闊抽噺</para> /// </summary> public async System.Threading.Tasks.Task<DefaultControlResponseAllData> SetVolumeAsync(int comandValue) { @@ -2502,7 +2514,7 @@ if (tempD.command == "0455") { result = new DefaultControlResponseAllData { defaultControlResponseData = tempD }; - DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0456_{ topic}"); + DebugPrintLog($"UI鏀跺埌閫氱煡鍚庣殑涓婚_command:0455_{ topic}"); } } } @@ -2547,10 +2559,7 @@ /// <summary> /// 闊抽噺鍙戦�佹暟鎹� - ///<para>comandValue: 0 闈欓煶</para> - ///<para>comandValue:1 鏈�灏忛煶閲�</para> - ///<para>comandValue:2~13 闊抽噺 </para> - ///<para>comandValue:14 鏈�澶ч煶閲�</para> + ///<para>comandValue: 0-100 闊抽噺</para> /// </summary> public string VolumeData(int comandValue) { @@ -2565,16 +2574,16 @@ { if (comandValue >= 1) { - //comandValue = comandValue * 100; - //float v = (float)100 / 15; - //int vv = Convert.ToInt32(v * 100); - //var comandValueTemp = comandValue / vv; - //if (comandValueTemp == 0) - //{ - // comandValueTemp = 1; - //} cValue = Convert.ToString(comandValue, 16).ToUpper(); - cValue = "F" + cValue; + if (cValue.Length == 1) + { + cValue = "0" + cValue; + } + else + { + cValue = cValue; + } + } else { -- Gitblit v1.8.0