简体   繁体   中英

libusb communicate with USB mass storage

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM