Added VirtualModbusClient to Common
This commit is contained in:
@@ -17,15 +17,11 @@ namespace AMWD.Protocols.Modbus.Common
|
||||
{
|
||||
get
|
||||
{
|
||||
byte[] blob = [HighByte, LowByte];
|
||||
blob.SwapBigEndian();
|
||||
return BitConverter.ToUInt16(blob, 0);
|
||||
return new[] { HighByte, LowByte }.GetBigEndianUInt16();
|
||||
}
|
||||
set
|
||||
{
|
||||
byte[] blob = BitConverter.GetBytes(value);
|
||||
blob.SwapBigEndian();
|
||||
|
||||
var blob = value.ToBigEndianBytes();
|
||||
HighByte = blob[0];
|
||||
LowByte = blob[1];
|
||||
}
|
||||
|
||||
@@ -17,9 +17,7 @@ namespace AMWD.Protocols.Modbus.Common
|
||||
{
|
||||
get
|
||||
{
|
||||
byte[] blob = [HighByte, LowByte];
|
||||
blob.SwapBigEndian();
|
||||
return BitConverter.ToUInt16(blob, 0);
|
||||
return new[] { HighByte, LowByte }.GetBigEndianUInt16();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace AMWD.Protocols.Modbus.Common.Models
|
||||
/// Initializes a new instance of the <see cref="ModbusDevice"/> class.
|
||||
/// </remarks>
|
||||
/// <param name="id">The <see cref="ModbusDevice"/> ID.</param>
|
||||
public class ModbusDevice(byte id) : IDisposable
|
||||
internal class ModbusDevice(byte id) : IDisposable
|
||||
{
|
||||
private readonly ReaderWriterLockSlim _rwLockCoils = new();
|
||||
private readonly ReaderWriterLockSlim _rwLockDiscreteInputs = new();
|
||||
|
||||
Reference in New Issue
Block a user