Beispiel #1
0
        public void Send()
        {
            client = new UdpClient("192.168.1.99", 0x1936);
            byte[] artNet = new System.Text.ASCIIEncoding().GetBytes("Art-Net");
            byte[] data = new byte[18 + 512]; // 18 + number of channels

            // ID
            artNet.CopyTo(data, 0);
            data[7] = 0x00;

            // OpCode
            data[8] = 0x00;
            data[9] = 0x50;

            // ProtVerH
            data[10] = 0x00;
            //ProtVer
            data[11] = 0x0e;

            // Sequence
            data[12] = 0x01;

            // Physical
            data[13] = 0x00;

            // Universe
            data[14] = 0x00; // <- Universe Setting
            data[15] = 0x00;

            // LengthHi
            data[16] = 0x02; // Length High Byte
            // Length
            data[17] = 0x00; // Length Low Byte

            // Data[Length]
            channel1.CopyTo(data, 18);
            channel2.CopyTo(data, 19);
            channel3.CopyTo(data, 20);
            channel4.CopyTo(data, 21);
            channel5.CopyTo(data, 22);
            channel6.CopyTo(data, 23);
            channel7.CopyTo(data, 24);
            channel8.CopyTo(data, 25);
            channel9.CopyTo(data, 26);
            channel10.CopyTo(data, 27);


            client.Send(data, data.Length);
            Update_T_Bars();
        }