Beispiel #1
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     data.WriteNetwork(SceneNumber);
     data.WriteNetwork(UpFadeTime);
     data.WriteNetwork(DownFadeTime);
     data.WriteNetwork(WaitTime);
 }
Beispiel #2
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     data.WriteNetwork(ListChangeNumber);
     foreach (short endpointId in EndpointIDs)
     {
         data.WriteNetwork(endpointId);
     }
 }
 protected override void WriteData(RdmBinaryWriter data)
 {
     foreach (SlotValue value in DefaultValues)
     {
         data.WriteNetwork(value.Offset);
         data.WriteNetwork(value.Value);
     }
 }
Beispiel #4
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     foreach (SlotInformation slot in Slots)
     {
         data.WriteNetwork(slot.Offset);
         data.WriteNetwork((byte)slot.Type);
         data.WriteNetwork((short)slot.SlotLink);
     }
 }
            protected override void WriteData(RdmBinaryWriter data)
            {
                data.WriteNetwork(EndpointID);
                data.WriteNetwork(ListChangeNumber);

                foreach (UId id in DeviceIds)
                {
                    data.Write(id);
                }
            }
Beispiel #6
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     if (Mode == PlayMode.Scene)
     {
         data.WriteNetwork((short)SceneNumber);
     }
     else
     {
         data.WriteNetwork((short)Mode);
     }
 }
Beispiel #7
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     data.WriteNetwork((ushort)ParameterId);
     data.Write(PDLSize);
     data.Write(DataType);
     data.Write(CommandClass);
     data.Write(Type);
     data.Write(Unit);
     data.Write(Prefix);
     data.WriteNetwork(MinValidValue);
     data.WriteNetwork(MaxValidValue);
     data.WriteNetwork(DefaultValue);
     data.Write(Encoding.ASCII.GetBytes(Description));
     ;
 }
Beispiel #8
0
            protected override void WriteData(RdmBinaryWriter data)
            {
                if (StatusMessages.Count > 25)
                {
                    throw new InvalidPacketException("A maximum of 25 status messages is allowed.");
                }

                foreach (Status item in StatusMessages)
                {
                    data.WriteNetwork(item.SubDeviceId);
                    data.Write((byte)item.StatusType);
                    data.WriteNetwork(item.StatusMessageId);
                    data.WriteNetwork(item.DataValue1);
                    data.WriteNetwork(item.DataValue2);
                }
            }
Beispiel #9
0
        public void SendBackgroundRdm(RdmPacket packet)
        {
            if (!IsTcpConnectionAlive())
            {
                throw new InvalidOperationException("No healthy TCP connection exists for RDMNet broadcast.");
            }

            //Fill in addition details
            packet.Header.SourceId      = RdmSourceId;
            packet.Header.DestinationId = UId.Broadcast;

            //Create Rdm Packet
            MemoryStream    rdmData   = new MemoryStream();
            RdmBinaryWriter rdmWriter = new RdmBinaryWriter(rdmData);

            //Write the RDM sub-start code.
            rdmWriter.Write((byte)RdmVersions.SubMessage);

            //Write the RDM packet
            RdmPacket.WritePacket(packet, rdmWriter);

            //Write the checksum
            rdmWriter.WriteNetwork((short)RdmPacket.CalculateChecksum(rdmData.GetBuffer()));

            //Create sACN Packet
            RdmNetPacket dmxPacket = new RdmNetPacket();

            dmxPacket.Framing.SourceName = SourceName;
            dmxPacket.Framing.EndpointID = (short)0;
            dmxPacket.RdmNet.RdmData     = rdmData.GetBuffer();

            AliveTcpSocket.SendPacket(dmxPacket);

            RaiseRdmPacketSent(new NewPacketEventArgs <RdmPacket>(null, packet));
        }
Beispiel #10
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     foreach (RdmParameters parameterId in ParameterIds)
     {
         data.WriteNetwork((ushort)parameterId);
     }
 }
Beispiel #11
0
        public void SendRdm(RdmPacket packet, RdmEndPoint targetAddress, UId targetId, UId sourceId)
        {
            //Fill in addition details
            packet.Header.SourceId      = sourceId;
            packet.Header.DestinationId = targetId;

            //Sub Devices
            if (targetId is SubDeviceUId)
            {
                packet.Header.SubDevice = ((SubDeviceUId)targetId).SubDeviceId;
            }

            //Create Rdm Packet
            using (var rdmData = new MemoryStream())
            {
                var rdmWriter = new RdmBinaryWriter(rdmData);

                //Write the RDM packet
                RdmPacket.WritePacket(packet, rdmWriter);

                //Write the checksum
                rdmWriter.WriteNetwork((short)(RdmPacket.CalculateChecksum(rdmData.GetBuffer()) + (int)RdmVersions.SubMessage + (int)DmxStartCodes.RDM));

                //Create sACN Packet
                var rdmPacket = new ArtRdmPacket();
                rdmPacket.Address      = (byte)targetAddress.Universe;
                rdmPacket.SubStartCode = (byte)RdmVersions.SubMessage;
                rdmPacket.RdmData      = rdmData.GetBuffer();

                Send(rdmPacket, targetAddress);

                RdmPacketSent?.Invoke(this, new NewPacketEventArgs <RdmPacket>(new IPEndPoint(targetAddress.IpAddress, Port), packet));
            }
        }
Beispiel #12
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     foreach (CultureInfo language in Languages)
     {
         data.WriteNetwork(language.TwoLetterISOLanguageName);
     }
 }
Beispiel #13
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     foreach (DetailId id in Details)
     {
         data.WriteNetwork((short)id);
     }
 }
Beispiel #14
0
        public override void WriteData(ArtNetBinaryWriter data)
        {
            RdmBinaryWriter writer = new RdmBinaryWriter(data.BaseStream);

            base.WriteData(data);

            writer.Write(RdmVersion);
            writer.Write(new byte[1]);
            writer.Write(DeviceId);
            writer.Write(new byte[1]);
            writer.Write((byte)Command);
            writer.WriteNetwork((short)ParameterId);
            writer.WriteNetwork(SubDevice);
            writer.WriteNetwork(SubCount);
            writer.Write(new byte[4]);
            writer.Write(RdmData);
        }
Beispiel #15
0
            protected override void WriteData(RdmBinaryWriter data)
            {
                data.WriteNetwork(EndpointID);

                switch (EndpointMode)
                {
                case UniverseMode.Disabled:
                    data.WriteNetwork((short)0);
                    break;

                case UniverseMode.Composite:
                    data.WriteNetwork((ushort)65535);
                    break;

                default:
                    data.WriteNetwork(UniverseNumber);
                    break;
                }
            }
Beispiel #16
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     data.WriteNetwork(RdmProtocolVersion);
     data.WriteNetwork(DeviceModelId);
     data.WriteNetwork((short)ProductCategory);
     data.WriteNetwork(SoftwareVersionId);
     data.WriteNetwork(DmxFootprint);
     data.Write(DmxPersonality);
     data.Write(DmxPersonalityCount);
     data.WriteNetwork(DmxStartAddress);
     data.WriteNetwork(SubDeviceCount);
     data.Write(SensorCount);
 }
Beispiel #17
0
        public void SendRdm(RdmPacket packet, RdmEndPoint targetAddress, UId targetId, UId sourceId)
        {
            if (BlockRDM)
            {
                return;
            }

            //Fill in addition details
            packet.Header.SourceId      = sourceId;
            packet.Header.DestinationId = targetId;

            SubDeviceUId id = targetId as SubDeviceUId;

            if (id != null)
            {
                packet.Header.SubDevice = id.SubDeviceId;
            }

            //Create Rdm Packet
            MemoryStream    rdmData   = new MemoryStream();
            RdmBinaryWriter rdmWriter = new RdmBinaryWriter(rdmData);

            //Write the RDM sub-start code.
            rdmWriter.Write((byte)RdmVersions.SubMessage);

            //Write the RDM packet
            RdmPacket.WritePacket(packet, rdmWriter);

            //Write the checksum
            rdmWriter.WriteNetwork((short)RdmPacket.CalculateChecksum(rdmData.GetBuffer()) + (byte)DmxStartCodes.RDM);

            //Create sACN Packet
            RdmNetPacket dmxPacket = new RdmNetPacket();

            dmxPacket.Framing.SourceName = SourceName;
            dmxPacket.Framing.EndpointID = (short)targetAddress.Universe;
            dmxPacket.RdmNet.RdmData     = rdmData.GetBuffer();

            SendPacket(dmxPacket, targetAddress);

            RaiseRdmPacketSent(new NewPacketEventArgs <RdmPacket>(targetAddress, packet));
        }
        public override void WriteData(ArtNetBinaryWriter data)
        {
            base.WriteData(data);

            var rdmWriter = new RdmBinaryWriter(data.BaseStream);

            data.Write(RdmVersion);
            data.Write(Port);
            data.Write(new byte[7]);
            data.Write(Net);
            data.Write(Command);
            data.Write(Universe);
            rdmWriter.WriteNetwork(UIdTotal);
            data.Write(BlockCount);
            data.Write((byte)Devices.Count);

            foreach (UId id in Devices)
            {
                rdmWriter.Write(id);
            }
        }
Beispiel #19
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     data.WriteNetwork(LampStrikes);
 }
Beispiel #20
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     data.WriteNetwork(DeviceHours);
 }
Beispiel #21
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     data.WriteNetwork(EndpointID);
 }
Beispiel #22
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     data.WriteNetwork(EndpointID);
     data.Write(Encoding.ASCII.GetBytes(Label));
 }
Beispiel #23
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     data.Write(PolicyID);
     data.WriteNetwork(Description);
 }
 protected override void WriteData(RdmBinaryWriter data)
 {
     data.WriteNetwork(ControlField);
     data.Write(BindingId);
 }
 protected override void WriteData(RdmBinaryWriter data)
 {
     data.WriteNetwork(ListChangeNumber);
 }
Beispiel #26
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     data.WriteNetwork((short)ParameterId);
 }
Beispiel #27
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     data.Write(TestNumber);
     data.WriteNetwork(Description);
 }
Beispiel #28
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     data.Write(PersonalityIndex);
     data.WriteNetwork(DmxSlotsRequired);
     data.WriteNetwork(Description);
 }
Beispiel #29
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     data.WriteNetwork(DmxAddress);
 }
Beispiel #30
0
 protected override void WriteData(RdmBinaryWriter data)
 {
     data.WriteNetwork(EndpointID);
     data.Write(TargetUID);
     data.Write((byte)StatusType);
 }