Exemple #1
0
        public List <Controller> SearchController()
        {
            List <Controller> list = new List <Controller>();

            try
            {
                WGPacket packet = new WGPacket(0x94);
                if (DoSend(packet))
                {
                    List <byte[]> dics = this.RecieveFrom(64);
                    if (dics.Count > 0)
                    {
                        foreach (var item in dics)
                        {
                            WGPacket   p    = ToWGPacket(item);
                            Controller ctrl = p.ToController();
                            ctrl.port = 60000;
                            if (ctrl != null)
                            {
                                list.Add(ctrl);
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
            }
            finally
            {
                this.Close();
            }
            return(list);
        }