`
蓝色的墨
  • 浏览: 76655 次
  • 性别: Icon_minigender_1
  • 来自: 河南
社区版块
存档分类
最新评论

有关串口,并口通讯的使用

阅读更多

场景描述:

com1,com2我们常说串口,LPT1我们就说并口。
串口就是说数据流一串一串传输的,用途很广,数码相机啊,鼠标啊。等等。
并口就是说数据是同时传输的,。打印机之类的。
但以上的两种接口传输速率很慢,已经被现在的USB接口代替了。
都是硬件端口。

RXTX 是一个跨平台的 Java 串口通信程序开发包。MINA 就是使用 RXTX 来实现与串口的通讯。

附件有在eclipse、myeclipse下配置串口程序的文档说明,可参考。 以及RXTX的JAR包、API、以及原码。

分享到:
评论
1 楼 wangyingya 2013-01-24  
我编写了一个简短的程序,但是通过刷新可用端口:
Enumeration en = CommPortIdentifier.getPortIdentifiers();
en端口枚举对象是个空对象,环境是myeclipse,配置参照的一下步骤:
1. Copy RXTXcomm.jar, rxtxSerial.dll and rxtxParallel.dll files to the lib   directory of your project
复制RXTXcomm.jar, rxtxSerial.dll 和 rxtxParallel.dll文件到项目lib文件夹
2. Under Project | Properties | Java Build Path | Libraries
3. click Add JARs… Button
在工程属性下将lib包加入项目编译路径
4. Select the RXTXComm.jar from lib directory
5. Jar should now be in the Build Path
6. expand the RXTXComm.jar entry in the list and select “Native Library Location”
添加后,单击RXTXComm.jar展开,选择Native Library Location,选中rxtxSerial.dll 和 rxtxParallel.dll所在的目录,然后应用修改,OK。
7. Select the project lib directory and apply

您遇到过相类似的问题吗?

相关推荐

Global site tag (gtag.js) - Google Analytics