public static UserCodeValue Parse(byte[] message) { UserCodeValue userCode = new UserCodeValue(); userCode.UserId = message[2]; userCode.UserIdStatus = message[3]; userCode.TagCode = new byte[10]; for (int i = 0; i < 10; i++) { userCode.TagCode[i] = message[4 + i]; } return userCode; }
public static UserCodeValue Parse(byte[] message) { UserCodeValue userCode = new UserCodeValue(); userCode.UserId = message[2]; userCode.UserIdStatus = message[3]; userCode.TagCode = new byte[10]; for (int i = 0; i < 10; i++) { userCode.TagCode[i] = message[4 + i]; } return(userCode); }
public static void Set(ZWaveNode node, UserCodeValue newUserCode) { var userCode = GetUserCodeData(node); userCode.TagCode = newUserCode.TagCode; userCode.UserId = newUserCode.UserId; userCode.UserIdStatus = newUserCode.UserIdStatus; List<byte> message = new List<byte>(); message.Add((byte)CommandClass.UserCode); message.Add((byte)Command.UserCodeSet); message.Add(userCode.UserId); message.Add(userCode.UserIdStatus); message.AddRange(userCode.TagCode); node.SendRequest(message.ToArray()); }
public static UserCodeValue Parse(byte[] message) { byte cmdClass = message[7]; byte cmdType = message[8]; UserCodeValue userCode = new UserCodeValue(); if (cmdClass == (byte)CommandClass.UserCode && ((byte)Command.UserCodeSet == cmdType || (byte)Command.UserCodeReport == cmdType)) { userCode.UserId = message[9]; userCode.UserIdStatus = message[10]; userCode.TagCode = new byte[10]; for (int i = 0; i < 10; i++) { userCode.TagCode[i] = message[11 + i]; } } return(userCode); }
public static UserCodeValue Parse(byte[] message) { byte cmdClass = message[7]; byte cmdType = message[8]; UserCodeValue userCode = new UserCodeValue(); if (cmdClass == (byte)CommandClass.UserCode && ((byte)Command.UserCodeSet == cmdType || (byte)Command.UserCodeReport == cmdType)) { userCode.UserId = message[9]; userCode.UserIdStatus = message[10]; userCode.TagCode = new byte[10]; for (int i = 0; i < 10; i++) { userCode.TagCode[i] = message[11 + i]; } } return userCode; }