简体   繁体   English

为 Android 编译 usb 指纹驱动程序

[英]Compiling usb fingeprint driver for Android

I am having the source code of DigitalPersona(DP) fingerprint reader.我有 DigitalPersona(DP) 指纹读取器的源代码。 Now, i need to compile it for Android.现在,我需要为 Android 编译它。 I have Android NDK r5.我有 Android NDK r5。 I replicated the Android.mk, default.properties and AndroidManifest.xml from the hello-jni sample project in NDK to the DP source code.我将 NDK 中的 hello-jni 示例项目中的 Android.mk、default.properties 和 AndroidManifest.xml 复制到了 DP 源代码。 But when i run 'ndk-build' inside the DP source code.但是当我在 DP 源代码中运行“ndk-build”时。 Its giving me huge bulk of errors.它给了我大量的错误。

Here are the configs.这是配置。 http://pastebin.com/khUbWQdE http://pastebin.com/khUbWQdE

I know i am doing something wrong, but please do enlighten me.我知道我做错了什么,但请赐教。 Thanks谢谢

It's quite likely that at least part of the code is a kernel mode device driver module, which this company is polite enough to supply in source form.很可能至少部分代码是 kernel 模式设备驱动程序模块,这家公司很有礼貌地以源代码形式提供。

Compiling kernel drivers is certainly possible, but it doesn't follow the ndk process.编译kernel驱动当然是可以的,但是不遵循ndk流程。 You'll need the kernel sources for the kernel running on your device or at least the headers from them.您将需要 kernel 在您的设备上运行的 kernel 源或至少来自它们的标头。 Do some web searching for hints on compiling android linux kernels, and pay attention to the part about packing the ramdisk image onto the kernel if your device requires that. Do some web searching for hints on compiling android linux kernels, and pay attention to the part about packing the ramdisk image onto the kernel if your device requires that.

You may also have userspace code to deal with.您可能还需要处理用户空间代码。 Getting that through the ndk build system (or perhaps the recently added 'stand alone toolchain' option) is not always trivial.通过 ndk 构建系统(或者最近添加的“独立工具链”选项)获得它并不总是微不足道的。 You have an unusual C library (bionic instead of glibc) plus all the generic issues involved in cross compiling, which some projects configuration scripts do not always handle well.您有一个不寻常的 C 库(仿生而不是 glibc)以及涉及交叉编译的所有一般问题,某些项目配置脚本并不总是能很好地处理这些问题。 There's also the possibility of using a different toolchain with a more standard library and statically linking.还有可能使用具有更标准库和静态链接的不同工具链。

Finally, you aren't going to be able to install and use the code unless you have a rooted device which allows replacing the kernel (or runs a kernel that allows modules) and the device has both the electrical capability and working drivers for operating in USB host mode.最后,您将无法安装和使用代码,除非您拥有允许更换 kernel(或运行允许模块的 kernel)的 root 设备,并且该设备同时具有电气功能和工作驱动程序以在USB 主机模式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM