From 993ecf49ae04ccea89f6bc4a32cfc0c45def1215 Mon Sep 17 00:00:00 2001
From: 温居城 <wenjucheng@wenjuchengdeMacBook-Pro.local>
Date: 星期三, 27 十月 2021 14:23:30 +0800
Subject: [PATCH] 2021-10-27-01
---
ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs | 84 ++++++++++++++++++++---------------------
1 files changed, 41 insertions(+), 43 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs
index 826613d..df2c8d6 100755
--- a/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs
+++ b/ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs
@@ -662,10 +662,10 @@
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 = UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra);
- if (result == null)
- {
- return null;
+ string result = UserCenterLogic.GetResponseDataByRequestHttps("ZigbeeUsers/GetSubAccountByDistributedMark", false, pra);
+ if (result == null)
+ {
+ return null;
}
var listInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Shared.Phone.UserCenter.MemberInfoRes>>(result);
return listInfo;
@@ -934,9 +934,9 @@
/// Unlock鍛戒护锛歟rror,invalid schedule浜嬩欢
/// </summary>
UnlockInvalidScheduleEvent = 6,
- }
+ }
#endregion
-
+
#region 闂ㄩ攣缂栫▼浜嬩欢閫氱煡
/// <summary>
/// 闂ㄩ攣缂栫▼浜嬩欢閫氱煡
@@ -965,7 +965,7 @@
/// <summary>
/// 缂栫▼浜嬩欢瑙﹀彂婧�
/// 甯哥敤锛�
- /// 0:Keypad(閿洏/瀵嗙爜)锛�3:RFID(灏勯鍗�)锛�15:鎸囩汗
+ /// 0:Keypad(閿洏/瀵嗙爜)锛�3:RFID(灏勯鍗�)锛�15:鎸囩汗 58锛歠ace 59锛氶潤鑴�
///涓嶅父鐢細
/// 1:RF(Zigbee鏃犵嚎)锛�2:Manual(鎵嬪姩)锛�255:Indeterminate(涓嶇‘瀹�)
/// </summary>
@@ -1118,7 +1118,7 @@
result = new DefaultControlResponseAllData { errorMessageBase = "缃戝叧杩斿洖鐨勬暟鎹负绌�" };
}
else
- {
+ {
if (clientDataPassthroughResponseData?.PassData != null)
{
var data = clientDataPassthroughResponseData.PassData;
@@ -1250,27 +1250,26 @@
var sbString = new System.Text.StringBuilder();
foreach (var userId in userIdList)
{
- string temp = Convert.ToString(userId, 16);
- switch (temp.Length)
+ var tempBytes = new byte[2];
+ for (int i = 0; i < 2; i++)
{
- 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;
+ tempBytes[i] = (byte)(userId >> (i * 8) & 0xff);
}
- sbString.Append(userIdStr.ToString().ToUpper());
+ var curV1 = Convert.ToString(tempBytes[0], 16);
+ var curV2 = Convert.ToString(tempBytes[1], 16);
+ if (curV1.Length == 1)
+ {
+ curV1 = "0" + curV1;
+ }
+ if (curV2.Length == 1)
+ {
+ curV2 = "0" + curV2;
+ }
+
+ userIdStr = (curV1 + curV2).ToUpper();
}
data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
- delUserTypeStr + sbString;
+ delUserTypeStr + userIdStr;
}
catch { };
@@ -1307,28 +1306,27 @@
delUserTypeStr = "21";
break;
}
- var sbString = new System.Text.StringBuilder();
- string temp = Convert.ToString(userId, 16);
- switch (temp.Length)
+ var tempBytes = new byte[2];
+ for (int i = 0; i < 2; i++)
{
- 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;
+ tempBytes[i] = (byte)(userId >> (i * 8) & 0xff);
}
- sbString.Append(userIdStr.ToString().ToUpper());
+ var curV1 = Convert.ToString(tempBytes[0], 16);
+ var curV2 = Convert.ToString(tempBytes[1], 16);
+ if (curV1.Length == 1)
+ {
+ curV1 = "0" + curV1;
+ }
+ if (curV2.Length == 1)
+ {
+ curV2 = "0" + curV2;
+ }
+
+ userIdStr = (curV1 + curV2).ToUpper();
+
data = dataLength + dataComand1 + dataComand2 + dataSerialNum + addDataLength +
- delUserTypeStr + sbString;
+ delUserTypeStr + userIdStr;
}
catch { };
--
Gitblit v1.8.0