fix:修复示波器获取失败的问题

This commit is contained in:
alivender
2025-07-20 13:17:36 +08:00
parent 5103145d01
commit 422aaa89d5
2 changed files with 8 additions and 18 deletions

View File

@@ -70,7 +70,7 @@ class Oscilloscope
private static readonly NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
readonly int timeout = 2000;
readonly int taskID = 1;
readonly int taskID = 0;
readonly int port;
readonly string address;
@@ -327,7 +327,7 @@ class Oscilloscope
return new(ret.Error);
}
var data = ret.Value;
if (data == null || data.Length != OscilloscopeAddr.RD_DATA_LENGTH)
if (data == null || data.Length != OscilloscopeAddr.RD_DATA_LENGTH / 8)
{
logger.Error($"Waveform data length mismatch: {data?.Length}");
return new(new Exception("Waveform data length mismatch"));