Ich habe diesen Code:UsbDevice.FromIdAsync gibt null zurück
private async void OnDeviceAdded(DeviceWatcher watcher, DeviceInformation deviceInformation)
{
if (deviceInformation.Name.StartsWith("ClearShot") && deviceInformation.IsEnabled)
{
targetDevice = await UsbDevice.FromIdAsync(deviceInformation.Id);
OnConnected(EventArgs.Empty);
}
}
Dies ist eigentlich ein Ereignis, das von einem DeviceWatcher
Das Problem genannt wird, ist, dass targetDevice
immer null ist.
Keine Abstürze, nichts, es ist nur null, ändert sich nicht. Warum?
Edit: Das ist die Sache, die ich im Manifest haben:
<DeviceCapability Name="usb">
<Device Id="vidpid:184c 0001">
<Function Type="classId:ff * *"/>
</Device>
</DeviceCapability>
Haben Sie [USB-Funktionen hinzufügen zum Manifest] (https://msdn.microsoft.com/de-de s/library/windows/hardware/dn303351 (v = V.85) .aspx)? –
' DeviceCapability>' Nicht sicher, ob das ist, richtig oder nicht obwohl. –
Ahmad45123
Wie bekomme ich die ClassID und solche Informationen? – Ahmad45123