|
From: Jörn M. [A. V. <Joe...@al...> - 2024-05-31 08:39:55
|
Hi, |> I do not know if even the next level above that is universal i.e. if there is a universal way to read/right sectors/blocks in mass storage. I would expect thumb/hard drives generally to utilize the mass storage class (08h), so there should be a common standard for the protocol level. https://www.usb.org/sites/default/files/Mass_Storage_Specification_Overview_v1.4_2-19-2010.pdf On top of this you would need to implement the FAT16 file system driver. https://academy.cba.mit.edu/classes/networking_communications/SD/FAT.pdf As all this is going to be a ton of work just to support an outdated standard (defined in ´83 for DOS 3.0) I would rather recommend to investigate if there is really no way to reformat these drives to a more modern file system. Kind regards, Jörn -----Ursprüngliche Nachricht----- Von: Kustaa Nyholm <ea...@ea...> Gesendet: Freitag, 31. Mai 2024 08:59 An: hacka thon <hac...@gm...> Cc: lib...@li... Betreff: Re: [libusb] LibUSB C library use in Andoid Studio [Sie erhalten nicht häufig E-Mails von mailto:ea...@ea.... Weitere Informationen, warum dies wichtig ist, finden Sie unter https://aka.ms/LearnAboutSenderIdentification ] On 31.5.2024 9.06, 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. I'm no expert in this but I think you are heading for a lot of trouble/work. libUSB just provides the low level access to the USB end points. I do not know if even the next level above that is universal i.e. if there is a universal way to read/right sectors/blocks in mass storage. If not then you will have to cope with emulating what the operating system driver does for every different type of mass storage you want to support. Then above that you need to be able to do what the file system in the OS does. Some almost 40 years ago I wrote a FAT16/32 file system component from scratch with minimal info (just reverse engineering). Today you can probably find some code that does this, for example from the Linux sources, but that and the drivers are C-code. You can access C-code from Java with JNI and more easily IMO using JNA (if supported on Android) but it will not be as trivial as just calling some Linux driver or file system calls. So it is doable. But I think it will not be a trivial few hours to apply that knowledge in Java. In any case libUSB AFAIK just provides you with access to the end point descriptors and access to the end points, the rest is up to you. wbr Kusti _______________________________________________ libusb-devel mailing list mailto:lib...@li... https://lists.sourceforge.net/lists/listinfo/libusb-devel |