using System; namespace AMWD.Protocols.Modbus.Common.Events { /// /// Represents the register written event arguments. /// [System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] public class RegisterWrittenEventArgs : EventArgs { internal RegisterWrittenEventArgs(byte unitId, ushort address, byte highByte, byte lowByte) { UnitId = unitId; Address = address; HighByte = highByte; LowByte = lowByte; Value = new[] { highByte, lowByte }.GetBigEndianUInt16(); } /// /// Gets or sets the unit id. /// public byte UnitId { get; } /// /// Gets or sets the address of the register. /// public ushort Address { get; } /// /// Gets or sets the value of the register. /// public ushort Value { get; } /// /// Gets or sets the high byte of the register. /// public byte HighByte { get; } /// /// Gets or sets the low byte of the register. /// public byte LowByte { get; } } }