iPerl ASIC - implementation

This commit is contained in:
2026-03-12 14:50:47 +01:00
parent 3c964f2aab
commit a997c3d7be
378 changed files with 5684 additions and 295925 deletions
@@ -0,0 +1,34 @@
using System;
namespace TBF.Rig.TestMethods.iPerlCommunication.communication.C4.wiredProtocol
{
public sealed class TouchReadResponse
{
public byte Control { get; }
public byte Status { get; }
public byte[] Payload { get; }
public bool IsOk => Status == 0x01;
public TouchReadResponse(byte control, byte status, byte[] payload)
{
Control = control;
Status = status;
Payload = payload ?? Array.Empty<byte>();
}
public string GetAsciiPayload()
{
if (Payload.Length == 0)
return null;
int length = Array.IndexOf(Payload, (byte)0x00);
if (length < 0)
length = Payload.Length;
return System.Text.Encoding.ASCII.GetString(Payload, 0, length);
}
}
}