21 lines
596 B
C#
21 lines
596 B
C#
using System;
|
|
|
|
namespace TBF.Rig.RegisterReaders.iPerlASICReader.communication.C4.led
|
|
{
|
|
public class TouchReadLedMessage
|
|
{
|
|
public string Raw { get; }
|
|
public string[] Fields { get; }
|
|
|
|
public TouchReadLedMessage(string raw)
|
|
{
|
|
Raw = raw ?? throw new ArgumentNullException(nameof(raw));
|
|
|
|
if (!raw.StartsWith(";") || !raw.EndsWith(";"))
|
|
throw new FormatException("Invalid LED message framing");
|
|
|
|
string content = raw.Substring(1, raw.Length - 2);
|
|
Fields = content.Split(',');
|
|
}
|
|
}
|
|
} |