42 lines
979 B
C#
42 lines
979 B
C#
namespace Common.Hardware.WaterMeter.eRegister.Features
|
|
{
|
|
using Common.Utils.Extensions;
|
|
|
|
using System;
|
|
|
|
public class ChangeSensusRFEncryptionKey : Pam
|
|
{
|
|
public ChangeSensusRFEncryptionKey() : base(17, ChangeSensusRFEncryptionKey)
|
|
{
|
|
}
|
|
|
|
public ChangeSensusRFEncryptionKey(Byte[] encryptionKey) : this()
|
|
=> encryptionKey.CopyTo(this.bytes, 1);
|
|
|
|
public Byte[] Key
|
|
{
|
|
get
|
|
{
|
|
var key = new Byte[16];
|
|
|
|
Array.Copy(this.bytes, 1, key, 0, 16);
|
|
|
|
return key;
|
|
}
|
|
set
|
|
{
|
|
if (value?.Length == 16)
|
|
{
|
|
value.CopyTo(this.bytes, 1);
|
|
}
|
|
}
|
|
}
|
|
|
|
public String HexKey
|
|
{
|
|
get => BitConverter.ToString(this.Key).Replace("-", String.Empty);
|
|
set => this.Key = value.ToByteArray();
|
|
}
|
|
}
|
|
}
|