Windows 上的 Java RS-232 通信
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/264469/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Java RS-232 Communication on Windows
提问by Steve
Does anyone know of a good Java API for controlling RS-232 devices in a WIN32 enviroment? I've tried RXTX but they don't support RS232, only RS-485.
有谁知道用于在 WIN32 环境中控制 RS-232 设备的良好 Java API?我试过 RXTX 但它们不支持 RS232,只支持 RS-485。
回答by Lawrence Dol
Without reservation, I recommend Java Serial Port from serialio.com. I had significant stability problems with the Sun, IBM and RxTx serial packages. SerialPort has been rock solid in production for over 2 years 24/7.
毫无保留地,我推荐来自serialio.com 的Java Serial Port 。我在 Sun、IBM 和 RxTx 串行包方面遇到了严重的稳定性问题。SerialPort 在 2 年多来的 24/7 生产中一直坚如磐石。
They support the standard Java serial API, as well as their own alternative proprietary one. I would stick with the standard API though, unless you really need something theirs has that the standard one doesn't, just to keep your options open.
它们支持标准的 Java 串行 API,以及它们自己的替代专有 API。不过,我会坚持使用标准 API,除非你真的需要他们的一些标准 API 没有的东西,只是为了让你的选择保持开放。
回答by scream3r
I advise you to try jSSC. This lib support Win32(Win98 - Win7) and Win64. Linux version under construction. Project page on Google code: http://code.google.com/p/java-simple-serial-connector/
我建议你试试 jSSC。这个库支持 Win32(Win98 - Win7) 和 Win64。Linux 版本正在建设中。Google 代码上的项目页面:http: //code.google.com/p/java-simple-serial-connector/
回答by VonC
回答by happyburnout
I've just implemented a single-direction interface (device->computer) with Scream3r's jSSC library using Java 1.6 and Windows 7 64 bit quickly and without problems.
我刚刚使用 Java 1.6 和 Windows 7 64 位快速且没有问题地实现了带有 Scream3r 的 jSSC 库的单向接口(设备-> 计算机)。
Hint: If you look at his additional code in jSSC-Terminal.zip you get a nice (and essential for using the lib) example how to work with the library!
提示:如果你查看他在 jSSC-Terminal.zip 中的附加代码,你会得到一个很好的(对于使用 lib 来说是必不可少的)示例如何使用库!
Thank you Scream3r for sharing this, you made my day!
感谢 Scream3r 分享这个,你让我开心!
回答by john miller
I stumbled upon scm which is another open source library for RS232 serial port communication. Project page is https://github.com/RishiGupta12/serial-communication-manager
我偶然发现了 scm,它是另一个用于 RS232 串行端口通信的开源库。项目页面是https://github.com/RishiGupta12/serial-communication-manager