为Android/arm设备制作数码显微镜驱动程序
我有一台平板电脑,使用 Android 系统。
它的配置:
marvell mohawk rev 0 v51
博戈MIPS:797.00
功能:swp、half、thumb、fastmult、edsp、java、iwmmxt
CPU实现者:0x56
CPU架构:5te
CPU部分:0x840
CPU 版本:0
硬件:pxa168边缘开发平台
我的目标是开发自己的驱动程序,它将从USB(从显微镜)获取流,然后在我的平板电脑的Android应用程序中渲染它。
据我了解,我不仅必须学习arm v5 arch,还需要获得arm-gnu C编译器,并且必须知道如何处理来自usb的字节流。
我看过usblib(OpenUSB)项目,但似乎对于arm arch来说这不是那么清晰的项目,并且会导致很多问题。
那么,我如何从平板电脑(armv5/android)的USB本地获取流,然后在本机部分(ndk)获取流,而不是通过JNI将数据发送到Java并将其呈现在我的平板电脑中。
我的想法正确吗?这条路上我会遇到什么麻烦?
塔纳克斯,
此致
I have tablet pc, which uses Android.
It's config:
marvell mohawk rev 0 v51
bogoMIPS: 797.00
Features: swp, half, thumb, fastmult, edsp, java, iwmmxt
cpu implementer: 0x56
cpu arch: 5te
cpu part: 0x840
cpu revision: 0
Hardware: pxa168 edge development platform
My aim is to develop my own driver, which will get stream from usb ( from the microscope ) and then render it in Android app in my tablet pc.
As I understand , I must learn not only arm v5 arch, but need to get arm-gnu C compiler and must know hot to handle byte stream from usb.
I have looked at usblib (OpenUSB) project, but seems to be it's not such clear project for arm arch and will cause a lot of problems.
So, how can I natively get stream from usb of my tablet pc ( armv5/android ), then obtain in in native part ( ndk ) than through JNI send data to Java and render it in my tablet pc.
Is the way I think correct and what troubles I shall get on this way?
Thanaks,
Best Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Android 在 Linux 内核上运行。因此,您需要的要么是显微镜的 Linux 内核驱动程序,要么是与之交互的用户模式程序(某些 USB 设备可以完全从用户态驱动)。无论哪种情况,您都需要对设备进行root。如果需要编写本机模式程序,请使用 Android NDK。如果您需要编写内核模块,请获取适合您平台的内核源代码(从 https:// android.googlesource.com/kernel/common.git 或(如果适用)来自制造商特定的存储库)。在开始编写驱动程序之前,请检查是否还没有适用于 Linux 的驱动程序;如果有的话,它可能会在 Android 上进行一些小的修改(任何 Linux GUI 应用程序肯定都行不通)。
Android runs on a Linux kernel. So what you're after is either a Linux kernel driver for your microscope, or a user mode program to interface with it (some USB devices can be driven entirely from user land). In either case, you'll need to root your device. Use the Android NDK if you need to write a native mode program. If you need to write a kernel module, get the kernel sources for your platform (either from https://android.googlesource.com/kernel/common.git or, if applicable, from a manufacturer-specific repository). Before you embark on writing a driver, check if there isn't already one for Linux; chances that it will work with minor adaptations if at all on Android (what definitely won't work is any Linux GUI application).
Android 目前不支持 USB 设备的第三方驱动程序。然而,从Android 3.1(Honeycomb)开始,有一个Java API可以直接与USB设备通信。您可以完全使用 Java 编写一个 Android 应用程序来检测显微镜并直接与显微镜通信。如果处理来自显微镜的数据需要更高的性能,您可以编写本机代码(通过 NDK/JNI)来进行处理。
Android doesn't currently support 3rd party drivers for USB devices. However, starting with Android 3.1 (Honeycomb), there is a Java API to directly communicate with USB devices. You can write an Android application which detects and communicates directly with your microscope completely in Java. If the processing of the data coming from the microscope requires higher performance, you can write native code (through the NDK/JNI) to do the processing.