USB Input device on Archos a28: Read and Write directly to device
I have a Archos a28 internet tablet running Android Froyo 2.2. I have a HID Input class device that I would like to get working on Android. The tablet itself is already capable of handling a mouse and USB Flash drive out of the box.
I would like to my USB device with the a28. It is a custom designed device. I need to be able to read and write the raw USB input and output reports 开发者_如何学Cto and from the device.
How can I accomplish this? I have heard that it might be possible to create a module to do this.
Essentially you need to do two things:
First, you need to get the custom USB device working with linux. Eventually, the linux underlying the android stack on the tablet. But first, you probably want to get it working with a desktop linux where it is easier to experiment interactively. Probably this will involve loading or even modifying a kernel driver, and possibly setting up rules to have it automatically loaded. Once you have that going, document what you did and do the equivalent for the linux of the android tablet. This almost certainly requires root. In the android context, the method of autoloading the driver on connection may be different, but the driver itself would be essentially the same, only compiled against the appropriate kernel.
Second, you need to make the device available to application programs. If you only desire to make it available to custom programs, you may be able to do this via direct interaction with a device file, or creating something in /proc or /sys. Controversially, those files would have to either be world accessible, or you would have to patch another special group ID/android permission pair into the stack and let that group own the file to make it available to applications which have that android permission. A more sophisticated approach would be to write a low level service which manages the device, and exposes it to android applications via the usual binder-based android service communication mechanism.
精彩评论