有哪位高人可以指点一下,谢谢!
usb_init();
usb_find_busses();
usb_busses=usb_get_busses();
usb_find_devices();
for(bus=usb_busses; bus; bus=bus->next){
for(dev=bus->devices; dev; dev=dev->next){
if(dev->descriptor.idVendor == USBDEV_VENDOR1 && dev->descriptor.idProduct == USBDEV_PRODUCT1)
{
MessageDlg("yang2 USB device.." , mtError, TMsgDlgButtons() << mbOK, 0);
break;
}
}
if(dev)
{
MessageDlg("yang2b USB device.." , mtError, TMsgDlgButtons() << mbOK, 0);
break;
}
MessageDlg("yang888b USB device.." , mtError, TMsgDlgButtons() << mbOK, 0);
}
if(!dev)
for(bus=usb_busses; bus; bus=bus->next){
for(dev=bus->devices; dev; dev=dev->next){
if(dev->descriptor.idVendor == USBDEV_VENDOR && dev->descriptor.idProduct == USBDEV_PRODUCT)
{
MessageDlg("yang3 USB device.." , mtError, TMsgDlgButtons() << mbOK, 0);
break;
}
}
if(dev)
{
MessageDlg("yang3b USB device.." , mtError, TMsgDlgButtons() << mbOK, 0);
break;
}
MessageDlg("yang999b USB device.." , mtError, TMsgDlgButtons() << mbOK, 0);
}
DEV 返回值没有,找不到对应的USB HID