Archos a28 上的 USB 输入设备:直接读取和写入设备

发布于 2024-10-10 03:07:08 字数 222 浏览 8 评论 0原文

我有一台运行 Android Froyo 2.2 的 Archos a28 互联网平板电脑。我有一个 HID 输入类设备,我想在 Android 上使用它。平板电脑本身已经能够处理开箱即用的鼠标和 USB 闪存驱动器。

我想要我的 USB 设备带有 a28。它是一个定制设计的设备。我需要能够从设备读取和写入原始 USB 输入和输出报告。

我怎样才能做到这一点?我听说可以创建一个模块来执行此操作。

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 to and from the device.

How can I accomplish this? I have heard that it might be possible to create a module to do this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

〆一缕阳光ご 2024-10-17 03:07:08

本质上,您需要做两件事:

首先,您需要让自定义 USB 设备与 Linux 配合使用。最终,Linux 成为平板电脑上 Android 堆栈的底层。但首先,您可能希望让它与桌面 Linux 一起工作,这样更容易进行交互式实验。这可能涉及加载甚至修改内核驱动程序,并可能设置规则以自动加载它。完成后,记录您所做的事情,并为 Android 平板电脑的 Linux 执行等效操作。这几乎肯定需要 root。在 android 环境中,连接时自动加载驱动程序的方法可能不同,但驱动程序本身本质上是相同的,只是针对适当的内核进行编译。

其次,您需要使该设备可供应用程序使用。如果您只想使其可供自定义程序使用,您可以通过与设备文件直接交互或在 /proc 或 /sys 中创建某些内容来完成此操作。有争议的是,这些文件必须是全世界都可以访问的,或者您必须将另一个特殊的组 ID/android 权限对修补到堆栈中,并让该组拥有该文件,以使其可供具有该 android 权限的应用程序使用。更复杂的方法是编写一个低级服务来管理设备,并通过通常的基于 Binder 的 Android 服务通信机制将其公开给 Android 应用程序。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文