Andrea Fiorito
unread,Jan 6, 2025, 9:30:13 AMJan 6Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to android-ndk
Hi,
I'm delving into usb and Android, and I'm intrigued by the possibilities given by gadgetFs, functionFs and ConfigFs.
Background: Usb protocol requires that physical devices assume one of the two roles, host or device. Physical devices are usually limited to one of the two, but Android devices usually support OnTheGo, which allow them to switch and be both host or device. Software-wise, Android allows to customise the host behaviour using Java API to retrieve a file descriptor relative to one of the devices connected, and pass that to libraries like libusb that allow to customise the low level behaviour and protocols used for communication. Regarding the device role customisation, Linux offers three possibilities:
- gadgetfs, allows full USB protocol control on user space
- functionfs, allows USB function-level control, providing implementation for standard USB classes, on user space
- configfs, allows configuration of gadgets through file system.
I'm wondering if in any degree, one of those functionalities are usable on Android, and if not if there are any thoughts about exposing an equivalent functionality through a combination of permissions/api.
Ps. I'm aware of UsbAccessory, but I don't consider it a replacement to the aforementioned functionalities due to the fact it's not truly P'n'P.