vb.net - Cannot find usb device iot core -
trying connect apc ups via usb , send raw data.
package.appxmanifest
<devicecapability name="usb"> <device id="vidpid:051d 0002"> <function type="name:vendorspecific"/> </device> </devicecapability>
startuptask.vb
imports system imports system.collections.generic imports system.linq imports system.text imports system.net.http imports windows.applicationmodel.background ' background application template documented @ http://go.microsoft.com/fwlink/?linkid=533884&clcid=0x409 public notinheritable class startuptask implements ibackgroundtask public async sub mainpage_load(sender object, e routedeventargs) handles mybase.loaded dim vid uint32 = &h51d dim pid uint32 = &h2 dim filter string = windows.devices.usb.usbdevice.getdeviceselector(vid, pid) dim dev windows.devices.enumeration.deviceinformationcollection = await windows.devices.enumeration.deviceinformation.findallasync(filter, nothing) if dev.count > 0 dim device windows.devices.usb.usbdevice = await windows.devices.usb.usbdevice.fromidasync(dev(0).id) end if end sub
issue device
comes nothing. dev.count
1
.
Comments
Post a Comment