Files
HC_APTBS/Infrastructure/Kwp/Packets/AsciiDataPacket.cs
2026-04-11 12:45:18 +02:00

39 lines
935 B
C#

using System;
using System.Collections.Generic;
using System.Text;
namespace HC_APTBS.Infrastructure.Kwp.Packets
{
public class AsciiDataPacket : Packet
{
public AsciiDataPacket(List<byte> bytes) : base(bytes)
{
// Dump();
}
public bool MoreDataAvailable => Bytes[3] > 0x7F;
public override string ToString()
{
var sb = new StringBuilder();
foreach (var b in Body)
{
sb.Append((char)(b & 0x7F));
}
return sb.ToString();
}
private void Dump()
{
System.Diagnostics.Debug.Write($"Received Ascii data packet: \"{ToString()}\"");
if (MoreDataAvailable)
{
System.Diagnostics.Debug.Write(" (More data available via ReadIdent)");
}
System.Diagnostics.Debug.WriteLine("");
}
}
}