diff --git a/ArtNetSharp/Messages/ArtRDM.cs b/ArtNetSharp/Messages/ArtRDM.cs index 57672be..db91fc1 100644 --- a/ArtNetSharp/Messages/ArtRDM.cs +++ b/ArtNetSharp/Messages/ArtRDM.cs @@ -21,6 +21,8 @@ public sealed class ArtRDM : AbstractArtPacketNetAddressCommand public UID Destination => RDMMessage.DestUID; public byte Transaction => RDMMessage.TransactionCounter; + public readonly byte FifoAvailable; + public readonly byte FifoMax; public readonly byte[] Data; public readonly RDMMessage RDMMessage; public readonly ERDMVersion RdmVersion; @@ -28,7 +30,9 @@ public ArtRDM(in PortAddress portAddress, in RDMMessage rdmMessage, in EArtRDMCommand command = EArtRDMCommand.ArProcess, in ERDMVersion rdmVersion = ERDMVersion.STANDARD_V1_0, - in ushort protocolVersion = Constants.PROTOCOL_VERSION) : this(portAddress.Net, portAddress.Address, rdmMessage, command, rdmVersion, protocolVersion) + in ushort protocolVersion = Constants.PROTOCOL_VERSION, + in byte fifoAvailable = 0, + in byte fifoMax = 0) : this(portAddress.Net, portAddress.Address, rdmMessage, command, rdmVersion, protocolVersion, fifoAvailable, fifoMax) { } public ArtRDM(in Net net, @@ -36,11 +40,15 @@ public ArtRDM(in Net net, in RDMMessage rdmMessage, in EArtRDMCommand command = EArtRDMCommand.ArProcess, in ERDMVersion rdmVersion = ERDMVersion.STANDARD_V1_0, - in ushort protocolVersion = Constants.PROTOCOL_VERSION) : base(net, address, command, protocolVersion) + in ushort protocolVersion = Constants.PROTOCOL_VERSION, + in byte fifoAvailable = 0, + in byte fifoMax = 0) : base(net, address, command, protocolVersion) { if (rdmMessage == null) throw new ArgumentNullException(nameof(rdmMessage)); - + + FifoAvailable= fifoAvailable; + FifoMax= fifoMax; RDMMessage = rdmMessage; RdmVersion = rdmVersion; Data = RDMMessage.BuildMessage(); @@ -49,6 +57,9 @@ public ArtRDM(in byte[] packet) : base(packet) { RdmVersion = (ERDMVersion)packet[12]; + FifoAvailable = packet[19]; + FifoMax = packet[20]; + Data = new byte[(packet.Length - 24) + 1]; Data[0] = 0xcc; Array.Copy(packet, 24, Data, 1, Data.Length - 1); @@ -66,8 +77,8 @@ protected sealed override void fillPacket(ref byte[] p) //p[16] = 0; // Spare 3 //p[17] = 0; // Spare 4 //p[18] = 0; // Spare 5 - //p[19] = 0; // Spare 6 - //p[20] = 0; // Spare 7 + p[19] = FifoAvailable; // FifoAvail + p[20] = FifoMax; // FifoMax //p[21] = 0; // Net (done by Abstract part) //p[22] = 0; // Command (done by Abstract part) //p[23] = 0; // Address (done by Abstract part) @@ -78,6 +89,8 @@ public override bool Equals(object obj) { return base.Equals(obj) && obj is ArtRDM other + && FifoAvailable == other.FifoAvailable + && FifoMax == other.FifoMax && RdmVersion == other.RdmVersion && Data.SequenceEqual(other.Data); }