ICS 中的 USB HOST 模式

发布于 2024-12-24 20:49:41 字数 323 浏览 1 评论 0原文

我正在尝试将 USB 传感器(请参阅 Toradex)连接到运行 Android 4.0.3 的 Android 手机(Desire Z)。

为了测试这一点,我编写了一个小应用程序来枚举连接的设备。

这应该实现 USB 主机模式并为 USB 传感器(HID)供电......但事实并非如此。

我有一条 USB OTG 电缆,现在,当我连接电缆时,状态栏中会出现一个小图标(汽车模式)。

我很失望,因为我等待这个功能有一段时间了……

有什么想法吗?我读了几乎所有与此相关的内容(斯文的作品等等),但我可能错过了一些东西......

谢谢!

I'm trying to connect a usb sensor (see Toradex) to an android phone (Desire Z) running android 4.0.3.

To test this, I wrote a small app to enumerate the attached device(s).

This supposed to have USB HOST mode implemented and to power the usb sensor (HID)... but it doesn't.

I got a USB OTG cable and now, when I attach the cable, a small icon appears in the status bar (car mode).

I'm disappointed since I waited for this feature for awhile now...

Any thoughts? I read almost everything out there related to this (Sven work and whatnot) but I might have missed something...

Thanks!

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

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

发布评论

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

评论(1

俏︾媚 2024-12-31 20:49:41

在过去的一年半里,我做了很多工作来构建定制的 Android 平台。有些是在 Froyo 的领导下,但大部分是在 Gingerbread 上。我添加的硬件大部分位于 UART 或 USB 上,这正是您想要做的。不幸的是,在 Android 设备上添加 USB 外围设备并不像在 PC 或 MAC 上那么容易。 PC 和 MAC 拥有几乎无限的内存空间(硬盘)。它们可以容纳大量设备的驱动程序。这使得自动检测和自动加载驱动程序成为可能。在 Android 设备上,它要精简得多,只需将所需的驱动程序存储在设备上。每次添加新设备时,我都必须为我的平台编译驱动程序并在配置中进行一些修改。还可以将驱动程序作为模块加载,而不是与内核一起编译(提供 file.ko 输出)。尽管如此,驱动程序必须已相应编写。但是,您必须通过修改需要root权限的“init.rc”来安装它。

这里有一些关于 Android 驱动程序的问题/答案的链接。这应该会给你更多的信息:
USB触摸屏驱动程序

希望它有帮助,但不幸的是,它很安静很多工作做做。

I have worked a lot in the past year and a half to build custom android platform. Some was under Froyo but mostly on Gingerbread. Most on the hardware I added was on either a UART or on USB, which is what you want to do. Unfortunately, it is not as easy to add a USB peripheral on an Android device than on a PC or a MAC. PCs and MACs have virtually unlimited memory space (hard drive). They can hold the drivers of a very large number of devices. That makes it possible to do auto-detection and automatic loading of drivers. On an Android device, it is a lot more lean therefor, just the required drivers are stored on the device. Every time I added a new device, I had to compile the driver for my platform and make some modification in my configuration. It is also possible to load the driver as a module instead of compiling it with the kernel (gives a file.ko output). Although, the driver must have been written accordingly. But, you will have to install it by modifying the "init.rc" which requires root privilege.

here is a few link of question/answer about about drivers in Android. That should give you a little bit more info:
USB touchscreen driver

Hope it helps but unfortunately, it is quiet a lot of work do do.

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