0x0a in the chunks end is not sufficient to detected eof. It will return in the middle of data.
Device: Siglent SDS 2000X Plus
https://siglentna.com/wp-content/uploads/dlm_uploads/2024/03/ProgrammingGuide_EN11F.pdf

I make the following changes to workaround this bug. Maybe read length from header will be better idea.
ScpiConnectionExtensions.cs
public static async Task<byte[]> ReadBytes(this IScpiConnection conn, int numOfBytesToRead, int specialTimeout = 0, CancellationToken cancellationToken = default)
{
var result = new MemoryStream();
var buffer = new byte[conn.DefaultBufferSize];
ReadResult chunk;
while (result.Length < numOfBytesToRead)
{
chunk = await conn.Read(buffer, buffer.Length, specialTimeout, cancellationToken);
result.Write(buffer, 0, chunk.Length);
}
return result.ToArray();
}
0x0a in the chunks end is not sufficient to detected eof. It will return in the middle of data.
Device: Siglent SDS 2000X Plus
https://siglentna.com/wp-content/uploads/dlm_uploads/2024/03/ProgrammingGuide_EN11F.pdf

I make the following changes to workaround this bug. Maybe read length from header will be better idea.
ScpiConnectionExtensions.cs