public void ProcessPacket(IPEndPoint source, AcnRootLayer header, AcnBinaryReader data) { StreamingAcnDmxPacket newPacket = AcnPacket.ReadPacket(header, data) as StreamingAcnDmxPacket; if (newPacket != null) { RaiseNewPacket(source, newPacket); } }
/// <summary> /// Processes the packet that have been recieved and allocated to this filter. /// </summary> /// <param name="source">The source IP address of the packet.</param> /// <param name="header">The header information for the ACN packet.</param> /// <param name="data">The data reader for the remaining packet data.</param> /// <remarks> /// Only packets that have supported protocol ID's will be sent to this function. /// </remarks> void IProtocolFilter.ProcessPacket(IPEndPoint source, AcnRootLayer header, AcnBinaryReader data) { RdmNetPacket newPacket = AcnPacket.ReadPacket(header, data) as RdmNetPacket; if (newPacket != null) { RdmBinaryReader dmxReader = new RdmBinaryReader(new MemoryStream(newPacket.RdmNet.RdmData)); //Skip Start Code and sub-start code dmxReader.BaseStream.Seek(1, SeekOrigin.Begin); RdmPacket rdmPacket = RdmPacket.ReadPacket(dmxReader); RaiseNewRdmPacket(new RdmEndPoint(source, newPacket.Framing.EndpointID), rdmPacket); } }
/// <summary> /// Processes the packet that have been recieved and allocated to this filter. /// </summary> /// <param name="source">The source IP address of the packet.</param> /// <param name="header">The header information for the ACN packet.</param> /// <param name="data">The data reader for the remaining packet data.</param> /// <remarks> /// Only packets that have supported protocol ID's will be sent to this function. /// </remarks> public void ProcessPacket(IPEndPoint source, AcnRootLayer header, AcnBinaryReader data) { AcnPacket packet = AcnPacket.ReadPacket(header, data); if (packet is StreamingAcnDmxPacket) { RaiseNewPacket(source, (StreamingAcnDmxPacket)packet); } if (packet is StreamingAcnSynchronizationPacket) { RaiseNewSynchronize(source, (StreamingAcnSynchronizationPacket)packet); } if (packet is StreamingAcnDiscoveryPacket) { RaiseNewDiscovery(source, (StreamingAcnDiscoveryPacket)packet); } }