Files
laatzen/Common/SIRTBroadcaster.Client/Parameters/LastCMD.cs
T
2023-08-22 14:58:05 +02:00

31 lines
952 B
C#

namespace SIRTBroadcaster.Abstraction.Parameters
{
using static SIRTBroadcaster.Abstraction.SIRTFixed;
public struct LastCMD
{
private LastCMD(byte value)
{
this.Value = value;
switch (value)
{
case WritePAM: this.Name = nameof(WritePAM); break;
case ReadPAM: this.Name = nameof(ReadPAM); break;
case WriteRAC: this.Name = nameof(WriteRAC); break;
case ReadRAC: this.Name = nameof(ReadRAC); break;
case WriteRegister: this.Name = nameof(WriteRegister); break;
case ReadRegister: this.Name = nameof(ReadRegister); break;
default: this.Name = string.Empty; break;
}
}
public byte Value { get; }
public string Name { get; }
public static implicit operator LastCMD (byte value)
=> new LastCMD(value);
}
}