mirror of
https://github.com/evopro-ag/Sharp7Reactive.git
synced 2025-12-16 11:42:52 +00:00
Remove extra byte array
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reactive.Disposables;
|
using System.Reactive.Disposables;
|
||||||
@@ -54,7 +53,7 @@ namespace Sharp7.Rx
|
|||||||
if (result != 0)
|
if (result != 0)
|
||||||
{
|
{
|
||||||
await EvaluateErrorCode(result);
|
await EvaluateErrorCode(result);
|
||||||
throw new InvalidOperationException($"Error in MultiVar request for variables: {string.Join(",", enumerable)}");
|
throw new InvalidOperationException($"Error in MultiVar request for variables: {string.Join(",", variableNames)}");
|
||||||
}
|
}
|
||||||
|
|
||||||
return buffers.ToDictionary(arg => arg.VariableName, arg => arg.Buffer);
|
return buffers.ToDictionary(arg => arg.VariableName, arg => arg.Buffer);
|
||||||
@@ -225,9 +224,7 @@ namespace Sharp7.Rx
|
|||||||
throw new InvalidOperationException($"Error reading {operand}{dBNr}:{startByteAddress}->{bytesToRead} ({errorText})");
|
throw new InvalidOperationException($"Error reading {operand}{dBNr}:{startByteAddress}->{bytesToRead} ({errorText})");
|
||||||
}
|
}
|
||||||
|
|
||||||
var retBuffer = new byte[bytesToRead];
|
return buffer;
|
||||||
Array.Copy(buffer, 0, retBuffer, 0, bytesToRead);
|
|
||||||
return (retBuffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int FromOperand(Operand operand)
|
private int FromOperand(Operand operand)
|
||||||
@@ -269,7 +266,7 @@ namespace Sharp7.Rx
|
|||||||
if (result != 0)
|
if (result != 0)
|
||||||
{
|
{
|
||||||
await EvaluateErrorCode(result);
|
await EvaluateErrorCode(result);
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
return (ushort)(data.Length);
|
return (ushort)(data.Length);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user