|
From: Tim R. <ti...@pr...> - 2024-05-31 19:14:22
|
hacka thon wrote: > Thanks for your response, > You are absolutely right, > that Operating systems will automatically mount USB devices, However, > I tried this in my mobile application where I received an events for > USB attach and detach, but USB Mass storage not displayed in Mobile's > default File Manager, Then I found that most of the smart phones are > only supporting FAT32 systems, but I have FAT16 USB mass storage > device which is not supported by some latest phones like Redmi, some > series of Samsung phones,etc. > So, how can I use your library to communicate with USB > FAT16/32 devices as you mentioned on your libusb Info page. You don't want to do this. Really. The USB Mass Storage Class specification is a very low-level specification. The communication is in SCSI commands -- essentially "read this sector", "write this sector". Those are absolute sector numbers; the Mass Storage spec knows nothing at all about files. You will need to download and understand this specification. Even if you could figure out how to communicate with the device using those SCSI commands, you would THEN have to have a complete implementation of the FAT16 file system. FAT16 is not terribly complicated, especially if you're only interested in reading, but in the end it's just not going to be worth the trouble. Do you see these devices get exposed as /dev devices, like /dev/sdc? If you can talk to the raw device, you may be able to bypass the USB Mass Storage commands and just do the FAT16 part using raw bytes. -- Tim Roberts, ti...@pr... Providenza & Boekelheide, Inc. |