public RequestDataOperation(byte srcNodeId, byte destNodeId, byte[] data, TransmitOptions txOptions, byte[] dataToCompare, int bytesToCompare, int timeoutMs) : this(srcNodeId, destNodeId, data, txOptions, timeoutMs) { _dataToCompare = new ByteIndex[bytesToCompare]; for (int i = 0; i < bytesToCompare; i++) { _dataToCompare[i] = new ByteIndex(dataToCompare[i]); } }
public override int GetHashCode() { var hashCode = 1862217691; hashCode = hashCode * -1521134295 + ByteIndex.GetHashCode(); hashCode = hashCode * -1521134295 + Line.GetHashCode(); hashCode = hashCode * -1521134295 + Column.GetHashCode(); return(hashCode); }
public void SetDataToCompare(ByteIndex[] data) { if (data != null) { DataToCompare = new ByteIndex[data.Length]; for (int i = 0; i < data.Length; i++) { if (i == 1 && data[0].Value == COMMAND_CLASS_TRANSPORT_SERVICE_V2.ID) { DataToCompare[i] = new ByteIndex(data[i].Value, 0xF8); } else { DataToCompare[i] = data[i]; } } } }
public ApiAchOperation(byte destNodeId, byte srcNodeId, byte[] data, int bytesToCompare) : base(false, null, false) { IsFillReceived = true; ReceivedAchData = new AchData(); DestNodeId = destNodeId; SrcNodeId = srcNodeId; if (data != null) { bytesToCompare = data.Length < bytesToCompare ? data.Length : bytesToCompare; var compareData = new ByteIndex[bytesToCompare]; for (int i = 0; i < bytesToCompare && i < data.Length; i++) { compareData[i] = new ByteIndex(data[i]); } SetDataToCompare(compareData); } }
public ApiAchOperation(byte destNodeId, byte srcNodeId, byte[] data, int bytesToCompare, ExtensionTypes[] extensionTypes) : base(false, null, false) { _extensionS2Types = extensionTypes.Select(val => (byte)((byte)val & 0x3F)).ToArray(); ExtensionS2TypeSpecified = true; IsFillReceived = true; ReceivedAchData = new AchData(); DestNodeId = destNodeId; SrcNodeId = srcNodeId; var compareData = new ByteIndex[bytesToCompare]; if (data != null) { for (int i = 0; i < bytesToCompare && i < data.Length; i++) { compareData[i] = new ByteIndex(data[i]); } SetDataToCompare(compareData); } }
public ApiHandler(CommandTypes command) { Mask = new ByteIndex[] { new ByteIndex((byte)FrameTypes.Response), new ByteIndex((byte)command) }; }
public ApiProgHandler(byte command) { Mask = new ByteIndex[] { ByteIndex.AnyValue, new ByteIndex((byte)FrameTypes.Response), new ByteIndex(command) }; }
public ApiHandler(FrameTypes frameType, CommandTypes command) { Mask = new ByteIndex[] { new ByteIndex((byte)frameType), new ByteIndex((byte)command) }; }