46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
namespace Common.Hardware.Interfaces.Protocols.SIRT
|
|
{
|
|
using System;
|
|
|
|
public class AuthLevel
|
|
{
|
|
public enum Level : UInt64
|
|
{
|
|
I = 0x004301143068D0,
|
|
II = 0x004302140E8040,
|
|
III = 0x00430363937322,
|
|
}
|
|
|
|
private readonly Level pin;
|
|
private readonly Byte[] bytes;
|
|
|
|
private AuthLevel(Level pin)
|
|
{
|
|
this.pin = pin;
|
|
this.bytes = new Byte[6];
|
|
|
|
var bytes = BitConverter.GetBytes((UInt64)this.pin);
|
|
Array.Copy(bytes, 0, this.bytes, 0, this.bytes.Length);
|
|
}
|
|
|
|
public static readonly AuthLevel I = Level.I;
|
|
public static readonly AuthLevel II = Level.II;
|
|
public static readonly AuthLevel III = Level.III;
|
|
|
|
public override String ToString()
|
|
=> BitConverter.ToString(this.bytes);
|
|
|
|
public static implicit operator AuthLevel(Level level)
|
|
=> new AuthLevel(level);
|
|
|
|
public static implicit operator UInt64(AuthLevel level)
|
|
=> (UInt64)level.pin;
|
|
|
|
public static implicit operator Byte[](AuthLevel level)
|
|
=> level.bytes;
|
|
|
|
public static implicit operator String (AuthLevel level)
|
|
=> level.ToString();
|
|
}
|
|
}
|