Ejemplo n.º 1
0
        public static List <string> GetAllDevices()
        {
            var ret = new List <string>();

            var candidates = HIDDevice.GetAllDevices(_VENDOR_ID, _PRODUCT_ID1);

            foreach (var c in HIDDevice.GetAllDevices(_VENDOR_ID, _PRODUCT_ID2))
            {
                candidates.Add(c);
            }

            foreach (var device in candidates)
            {
                var d = new WiiInputDevice(device, null);
                Thread.Sleep(1000);
                bool found = d.ExtensionType.HasValue && d.ExtensionType.Value == 0xFF00A4200112;
                d.Disconnect();
                d.Dispose();
                d = null;

                if (found)
                {
                    ret.Add(device);
                }
            }

            return(ret);
        }
Ejemplo n.º 2
0
        public static List<string> GetAllDevices()
        {
            var ret = new List<string>();

              var candidates = HIDDevice.GetAllDevices(_VENDOR_ID, _PRODUCT_ID1);
              foreach (var c in HIDDevice.GetAllDevices(_VENDOR_ID, _PRODUCT_ID2))
              {
            candidates.Add(c);
              }

              foreach (var device in candidates)
              {
            var d = new WiiInputDevice(device, null);
            Thread.Sleep(1000);
            bool found = d.ExtensionType.HasValue && d.ExtensionType.Value == 0xFF00A4200112;
            d.Disconnect();
            d.Dispose();
            d = null;

            if (found)
            {
              ret.Add(device);
            }
              }

              return ret;
        }