public USBDevice(string path) { hd = new skyetek_hid(path); this.Address = path; //this.readHandle = this.writeHandle = IntPtr.Zero; this.readBuffer = new Queue<byte>(65); this.writeBuffer = new Queue<byte>(65); }
/* public static Device[] Enumerate() { List<Device> devices; devices = new List<Device>(); USBDevice device; skyetek_hid h = new skyetek_hid(); //string[] d = new string[]; string[] d = h.FindTheHid(); Console.Out.WriteLine("Device Count" + devices.Count); for (int i = 0; i < d.Length; i++) { device = new USBDevice(d[i]); devices.Add(device); } //Console.Out.WriteLine("Device Count" + devices.Count); return devices.ToArray(); } */ public static Device[] Enumerate() { List<Device> devices; devices = new List<Device>(); USBDevice device; String emptyPath = ""; skyetek_hid h = new skyetek_hid(emptyPath); //string[] d = new string[]; //string[] d = h.FindTheHids(); string[] d = h.GetGuids(); //Console.Out.WriteLine("Device Count" + devices.Count); for (int i = 0; i < d.Length; i++) { device = new USBDevice(d[i]); devices.Add(device); } //Console.Out.WriteLine("Device Count" + devices.Count); return devices.ToArray(); }