C++ 适用于 Windows 的 USB API
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12036077/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
USB API for Windows
提问by Display Name
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?
Windows 上是否有适用于 USB 设备的标准 API?我知道课程会对他们产生影响,但我根本找不到标准的课程/清单?
采纳答案by Software_Designer
Yes there is.
就在这里。
Its called WinUSB - http://msdn.microsoft.com/en-us/library/windows/hardware/ff540196(v=vs.85).aspx
它称为 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
此处找到示例 WinUSB 代码 - http://msdn.microsoft.com/en-us/library/windows/hardware/ff540174(v=vs.85).aspx
回答by Mahmoud Fayez
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.
所有 USB 设备都有唯一的 Pid、Vid。您可以使用通用库与它的端点进行交互,我使用的是 cypress 库,它有 2 个版本的托管和非托管语言。
http://www.cypress.com/?rID=34870
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.
请记住,如果仅用于 cypress 供电的设备,则此库的许可证是免费的。但是您可以检查它并使用本机 API 来实现相同的行为,但它支持一些很好的功能,尤其是到批量端点的高速传输。
Also check this question Working with USB devices in .NET
还要检查这个问题 Working with USB devices in .NET