internal WiimoteDeviceInfo(string hidPath, bool dolphinBarMode) { HID = HIDDeviceInfo.GetDevice(hidPath); if (HID == null) { throw new IOException("Error opening HID device!"); } if (dolphinBarMode) { Bluetooth = new BluetoothDeviceInfo(); Type = GetTypeFromPID(HID.ProductID); } else { Bluetooth = WiimoteRegistry.GetBluetoothDevice(hidPath); if (Bluetooth == null) { throw new IOException("Error locating Bluetooth device!"); } Type = GetTypeFromName(Bluetooth.Name); } }
internal static BluetoothDeviceInfo GetDevice(string hidPath) { return(WiimoteRegistry.GetBluetoothDevice(hidPath)); }
internal static HIDDeviceInfo GetDevice(BluetoothAddress address) { return(EnumerateDevices(d => WiimoteRegistry.IsDriverInstalled(d.DevicePath, address)).FirstOrDefault()); }