HDL Home App 第二版本 旧平台金堂用 正在使用
ZigbeeApp/Shared/Phone/ZigBee/Device/DoorLock.cs
@@ -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 { };