12

Is there a standard API for USB devices on windows? I know classes will have an impact on them but I cant find a standard one/list at all?

Asteroids With Wings
  • 17,071
  • 2
  • 21
  • 35
Display Name
  • 1,025
  • 2
  • 15
  • 34

2 Answers2

8

Yes there is.

Its called WinUSB - http://msdn.microsoft.com/en-us/library/windows/hardware/ff540196(v=vs.85).aspx

Sample WinUSB code found here - http://msdn.microsoft.com/en-us/library/windows/hardware/ff540174(v=vs.85).aspx

Software_Designer
  • 8,490
  • 3
  • 24
  • 28
  • Only if you are using Winusb.sys as a USB device's function driver, you can call WinUSB Functions https://learn.microsoft.com/en-us/windows-hardware/drivers/usbcon/windows-desktop-app-for-a-usb-device otherwise check libusb.info – Juan Rojas Sep 06 '19 at 16:14
1

All USB devices has unique Pid, Vid. You can use generic library to interact with its end points for me I am using cypress library which has 2 versions for managed and unmanaged languages.

http://www.cypress.com/?rID=34870

Keep in mind the license for this library is free of charge if used with cypress powered devices only. But you can check it and use native APIs to achieve the same behavior but it supports some good features epically high speed transfer to bulk end points.

Also check this question Working with USB devices in .NET

Community
  • 1
  • 1
Mahmoud Fayez
  • 3,398
  • 2
  • 19
  • 36