Android and custom Usb HID devices

I finally got an usb OTG cable for my Galaxy Nexus (JB4.2.1) and wondered whether or not my custom usb HID devices could be controlled through an app… the answer is YES! And there is no need of rooting or special ROMs or packages since there is 100% native support.
The first try was using the hardware of the USB RGB Facebook notifier, which is based only on a attiny85 AVR mcu.
I just followed the guidelines from here and the only thing i struggled for was to get match the parameters of the function used to send control transfer messages with the one used in the C version, it turned out the argument list was:

USBconnection.controlTransfer(0x40, CUSTOM_REQUEST_ID, CUSTOM_REQUEST_VALUE, 0, null, 0, 0);

for instance:

USBconnection.controlTransfer(0x40, 4, 0, 0, null, 0, 0);

The value 0x40 stands for “outbound connection”.
Source code is coming…

3 Risposte a “Android and custom Usb HID devices”

  1. Molto interessante , stavo cercando di fare lo stesso con WP8 ma ci sono un po di difficoltà , Solitamente uso VB ma sarebbe interessante un HID di questo tipo. Farai il tutorial? :)

  2. Ciao ho visto il tuo progetto è davvero molto interessante, io devo fare una cosa simile solo che devo comunicare via usb con un ft311d. Hai preparato il tutorial oppure puoi darmi i sorgendi della tua app? Il telefono che hai usato è roottato? Grazie mille

I commenti sono chiusi.