使用Java中C语言的本机代码进行编程微控制器
我有一个 renesas 用于其二氧化碳传感器。源代码库完全用C语言编写,A 静态库(带有 .a 扩展)给了二氧化碳传感器在使用C/C ++语言的任何微控制器中。即使有很多例子。
因此,我有一个名为DPM5050的微控制器,该微控制器以Java编程语言运行。因此,我知道,可以使用JNI(Java本机接口)在Java中使用本机代码。我也知道要在Java中使用本机源代码,我需要一个动态链接库。但是我只有一个由 renesas 。
我的问题是,我该如何使用 renesas ?
我可以自己不联系 renesas ?
以及如何使用JNI在Java中实施此功能,以使用 renesas> Renesas ?
- 由于我只是知道使用本地的JNI技术 Java中的源代码。 所以,我也想请你给我 关于此主题的建议或意见。我也在寻找一些 良好的文档,包括示例或教程或指导来继续 此外。
现在,我正在阅读 Java Apis,扩展和库:使用Javafx,JDBC,JMOD,JLINK,网络和API -Kishori Sharan的在本书第7章中的书中,他们有一些有关JNI的详细信息。
我期待您的回应。提前致谢。
亲切的问候, 穆斯塔克。
I have a source code library from Renesas for their Co2 sensor. The source code library is completely written in C language and a static library (with .a extension) of it is given for the Co2 sensor which was helpful for me to use it in any microcontroller that uses C/C++ language. Even there are a lot of examples of it.
So, I have a microcontroller called DPM5050 which runs in Java programming language. Therefore, I came to know, that it is possible to use the native code in JAVA using JNI (Java Native Interface). I also came to know that to use native source code in Java, I need a dynamic link library. But I only have a static library which is provided by the Renesas.
My question is how can I do that using a static library that was given by Renesas?
Can I able to change the static library to the dynamic link library by myself without contacting Renesas?
And how to implement this in Java using JNI to use the native source code library provided by the Renesas?
- Since I just came to know about this JNI technology to use native
source code in Java. So, I would also like to ask you to give me
suggestions or opinions on this topic. And I am also looking for some
good documentation with examples or tutorials or guidance to proceed
further.
Right now, I am reading Java APIs, Extensions and Libraries: With JavaFX, JDBC, jmod, jlink, Networking, and the Process API - by Kishori Sharan's book in Chapter 7 of this book they have some details about JNI.
I am looking forward to your responses. Thanks in advance.
Kind Regards,
Mustaq.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论