我目前正在使用 javax-usb (JSR-80) 实现/www.libusb.org/" rel="nofollow">libusb 0.1 作为后端。我需要测试批量传输功能,我的猜测是最简单的方法是与 USB 大容量存储设备(如 USB 闪存驱动器)进行通信。不幸的是我不知道这些设备是如何工作的。我猜想有某种协议,我必须先发送一些 USB 控制请求,然后才能在批量端点上启动传输。
我对编写完整的 USB 海量存储驱动程序或类似的东西不感兴趣,所以即使文件系统的东西也不重要。我的唯一目的是通过一些批量端点传输一些数据,以便我可以将我的实现与参考实现进行比较。
我需要的是一些示例代码(语言并不重要,而且很可能它使用 libusb 或不同的东西甚至不重要)或 USB 大容量存储的规范,这对于程序员来说很容易理解(我不是硬件)专家)。我已经在网上搜索过,但到目前为止还没有找到任何有用的东西。
I'm currently writing a javax-usb (JSR-80) implementation using libusb 0.1 as a backend. I need to test the bulk transfer functionality and my guess is that the easiest way to do this is to communicate with a USB mass storage device like a USB flash drive. Unfortunately I have no idea how these devices are working. I guess there is some kind of protocol and I have to send some USB control requests before I can initiate a transfer on the bulk endpoints.
I'm not interested in writing a full USB mass storage driver or something like that so even file system stuff doesn't matter. My only purpose is to transfer some data via some bulk endpoint so I can compare my implementation with the reference implementation.
What I need is some example code (Language doesn't matter and most likely it even doesn't matter if it uses libusb or something different) or a specification of USB mass storage which is easy to understand for programmers (I'm no hardware specialist). I already searched the web but haven't found anything useful so far.
发布评论
评论(1)
USB 设备类规范实际上并不那么困难假设您了解 USB 的基础知识,请阅读本文(因为您正在编写 USB 驱动程序,所以我假设您了解)。 Mass Storage Bulk Only v1.0 可能是您想要的文档。
The USB device class specifications are really not all that difficult to read assuming you know the basics of USB (since you're writing a USB driver, I assume you do). Mass Storage Bulk Only v1.0 is probably the document you want.