Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android USB HID Device

Does anyone know how to configure an Android device (tablet) to appear as a USB HID device when connected to a PC? Is there any other way of getting data from the tablet to the PC (via USB) other than writing it to a file, and have the PC retrieve the (updated) file from the tablet which is acting as a 'mass storage device' for the PC? Can USB carry a TCP/IP end-end connection? Using a tablet as a high-end intelligent 'keyboard' or 'mouse' or similar device would be immensely powerful, and open up lots of possibilities. Controlling a model railway layout is the end I have in mind. Thanks

like image 458
radders Avatar asked Feb 03 '11 13:02

radders


People also ask

What is USB HID mode?

Human Interface Devices (HID) is a device class definition to replace PS/2-style connectors with a generic USB driver to support HID devices such as keyboards, mice, game controllers, and so on. Prior to HID, devices could only utilize strictly-defined protocols for mice and keyboards.

What is HID devices in Chrome?

Human Interface Device (HID) refers to the HID protocol, a standard communication with connected devices. Examples of HID devices are keyboards, mice, headsets, and game controllers. Sites can use HID to access buttons, turn LEDs on and off, or mute and unmute microphones.

What does HID compliant device mean?

Universal Serial Bus devices are used to connect various components to a computer. A HID (Human Interface Device) compliant USB follows a specific protocol for communication that allows it to be used with virtually any system.

What is HID device example?

An HID device takes input from or provides output to humans. Examples of devices include keyboards, pointing devices (mice, touchscreens, etc.), and gamepads. The HID protocol makes it possible to access these devices on desktop computers using operating system drivers.


2 Answers

If I set up a web server on my phone and enable usb tethering, I can access that server from my PC. If that's not enough for you, this might help: https://market.android.com/details?id=usbwebcam.application&hl=en

I'm running cyanogenmod on a Desire CDMA (BravoC)

Let me know what you find out; it would be pretty handy to use my phone as a USB keyboard in the field. An android server with a PC client is gonna be easiest though.

like image 27
Josh Cooley Avatar answered Nov 21 '22 12:11

Josh Cooley


It's possible to do this using the linux gadget framework http://www.linux-usb.org/gadget/ using a custom composite USB device. The gadget framework is part of the Android kernel source tree by inheritance from Linux.

Unfortunately, Android has its own customizations that restrict the ability to dynamically register new USB gadgets so you will need to patch the kernel source tree for your particular device and add your HID gadget (otherwise you could create a module and load it that way) to the supported Android list.

I have done this before and will update this answer to contain more detail if there is interest. Unfortunately I lost the code so I will have to start from scratch.

like image 173
insitusec Avatar answered Nov 21 '22 13:11

insitusec