Alter Endian from enum to partial class
This commit is contained in:
@@ -12,7 +12,7 @@ namespace Modbus.Net.Tests
|
||||
[TestMethod]
|
||||
public void GetUtility()
|
||||
{
|
||||
BaseMachine<int, int> baseMachine = new ModbusMachine<int, int>(1, ModbusType.Tcp, _machineIp, null, true, 2, 0);
|
||||
BaseMachine<int, int> baseMachine = new ModbusMachine<int, int>(1, ModbusType.Tcp, _machineIp, null, true, 2, 0, Endian.BigEndianLsb);
|
||||
var utility = baseMachine.GetUtilityMethods<IUtilityMethodDatas>();
|
||||
var methods = utility.GetType().GetRuntimeMethods();
|
||||
Assert.AreEqual(methods.FirstOrDefault(method => method.Name == "GetDatasAsync") != null, true);
|
||||
@@ -23,7 +23,7 @@ namespace Modbus.Net.Tests
|
||||
[TestMethod]
|
||||
public async Task InvokeUtility()
|
||||
{
|
||||
BaseMachine<int, int> baseMachine = new ModbusMachine<int, int>(1, ModbusType.Tcp, _machineIp, null, true, 2, 0);
|
||||
BaseMachine<int, int> baseMachine = new ModbusMachine<int, int>(1, ModbusType.Tcp, _machineIp, null, true, 2, 0, Endian.BigEndianLsb);
|
||||
await baseMachine.BaseUtility.ConnectAsync();
|
||||
var success = await baseMachine.BaseUtility.GetUtilityMethods<IUtilityMethodDatas>().SetDatasAsync("4X 1", new object[] { (byte)11 });
|
||||
Assert.AreEqual(success.IsSuccess, true);
|
||||
@@ -46,7 +46,7 @@ namespace Modbus.Net.Tests
|
||||
CommunicationTag = "A1",
|
||||
DataType = typeof(bool)
|
||||
}
|
||||
}, true, 2, 0);
|
||||
}, true, 2, 0, Endian.BigEndianLsb);
|
||||
var success = await baseMachine.GetMachineMethods<IMachineMethodDatas>().SetDatasAsync(
|
||||
MachineDataType.Address,
|
||||
new Dictionary<string, double>
|
||||
|
||||
Reference in New Issue
Block a user