示例#1
0
 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);
     }
 }
示例#2
0
 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());
 }