将数据写入USB设备
我需要向连接到 USB 端口的设备(现金抽屉)发送一些命令以打开抽屉。该设备可能来自不同的供应商和制造商,因此我需要一种通用的机制来写入设备,就像写入串行端口一样。我可以使用 LibUsb win32 来实现它,如果可以的话,有两个东西过滤驱动程序和设备驱动程序我应该使用哪一个?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经使用 WPD 成功完成了此操作(不适合新手)。也许并不适合所有场景,但这无疑是一个好的开始。我猜想有一个“打开设备”的标准命令。一些 WPD 命令此处。
否则,我将使用 busdog 对打开抽屉所需的设备命令进行逆向工程,并尝试编写使用 CreateFile 和 WriteFile API。
I've successfully done this using WPD (not for newbies). Perhaps not suitable for all scenarios, but it certainly is a good start. I would guess that there is a standard command to 'open device'. Some WPD commands here.
Otherwise I would reverse-engineer the device command needed to open the drawer using busdog and try to write this command to the USB device using the CreateFile and WriteFile APIs.