如何使用 JAVA 向 COM PORT 发送数据?

2022-01-18 00:00:00 serial-port java

可能重复:
Windows 上的 Java 串行通信

朋友们,我想在 JAVA 中连接并传输数据到 COM PORT(虚拟或原始)?

Friends, I want to connect and transfer data to COM PORT (either virtual or original) in JAVA?

推荐答案

这个问题已经被问过很多次了:

This question has been asked and answered many times:

使用Java从串口读取文件

用Java读取串口

用Java从串口读取文件

是否有用于访问 Serial 的 Java 库或框架端口?

Windows 上的 Java 串行通信

参考一些.

我个人推荐 http://serialio.com 的 SerialPort - 它不是免费的,但非常值得任何商业项目的开发商(无版税)许可费.可悲的是,它不再是免版税的,而且 SerialIO.com 似乎已将自己重塑为硬件销售商.我不得不搜索有关 SerialPort 的信息.

Personally I recommend SerialPort from http://serialio.com - it's not free, but it's well worth the developer (no royalties) licensing fee for any commercial project. Sadly, it is no longer royalty free to deploy, and SerialIO.com seems to have remade themselves as a hardware seller; I had to search for information on SerialPort.

根据个人经验,我强烈建议反对 Sun、IBM 和 RxTx 实施,所有这些实施在 24/7 使用时都不稳定.有关详细信息,请参阅我对上述一些问题的回答.公平地说,自从我尝试 RxTx 以来,它可能已经走了很长一段路,尽管 Sun 和 IBM 的实现基本上已经被放弃了,即使在那时也是如此.

From personal experience, I strongly recommend against the Sun, IBM and RxTx implementations, all of which were unstable in 24/7 use. Refer to my answers on some of the aforementioned questions for details. To be perfectly fair, RxTx may have come a long way since I tried it, though the Sun and IBM implementations were essentially abandoned, even back then.

jSSC (Java 简单串行连接器),正如@Jodes 评论所建议的那样.

A newer free option that looks promising and may be worth trying is jSSC (Java Simple Serial Connector), as suggested by @Jodes comment.

相关文章