コード例 #1
0
        public static ArtPollReply ParsePollReply(byte[] rawData)
        {
            //throw new NotImplementedException();

            ArtPollReply packet = new ArtPollReply(rawData);

            return(packet);
        }
コード例 #2
0
        void RegisterDeviceAndUniverse(Packet.ArtPollReply pktPollReply)
        {
            foreach (var n in pktPollReply.Ports)
            {
                Debug.WriteLine($"Register Device : {pktPollReply.IpNode}:{pktPollReply.IpPortNode}  netswitch={pktPollReply.NetSwitch} subswitch={pktPollReply.SubSwitch}   InputUniverse={n.InputUniverse}   OutputUniverse={n.OutputUniverse}");

                // HACK : directly set the IP of the node that pollReply
                if (dmxSender != null)
                {
                    if (dmxSender.TargetNodeIp != pktPollReply.IpNode) // si nouvelle IP -> on l'affecte
                    {
                        dmxSender.TargetNodeIp = pktPollReply.IpNode;
                    }
                }


                // TODO : dynamicly update the liste of detected Artnet Node

                //bool found = false;
                //foreach(var dt in dmxTargets)
                //{

                //}
                //if (!found)
                //{
                //    ArtNetDmxTarget adt = new ArtNetDmxTarget();
                //    adt.Name = pktPollReply.LongName;
                //    adt.ShortName = pktPollReply.ShortName;
                //    IPAddress adr;
                //    if (IPAddress.TryParse(pktPollReply.IpNode, out adr))
                //    {
                //        IPEndPoint
                //        adt.IpAddress.
                //    }
                //}
            }
        }