USB interface in android

前端 未结 5 1822
天命终不由人
天命终不由人 2021-02-06 10:02

I rooted my device and working in host mode. I can able to detect the usb device connected to my tab but Am having two questions.

1) i try to display my device name usi

5条回答
  •  时光说笑
    2021-02-06 10:40

    device name

    This looks like the internal device name from the Linux Kernel.

    manufacturer name

    You only get this indirectly via the USB VID (Vendor ID). They are assigned and maintained by the USB-IF.

    A device may provide a name for the manufacturer in its string descriptor, but AFAIK this is optional - and not exposed in the high level android java interface.

    You can try your luck with UsbDeviceConnection.getRawDescriptors, but that would require rather ugly fiddeling with bytes.

    to mass storage

    USB Mass storage is a rather complex protocol, so talking directly via USB Host API would be rather difficult to implement. Some Android firmware images can mount USB flash drives, that would be much simpler.

提交回复
热议问题