资源简介
包含RXTX源代码,各种环境下的jar包以及例子。
win32,64,linux测试通过。

代码片段和文件信息
JDK <= 1.4
/**
* @return A HashSet containing the CommPortIdentifier for all serial ports that are not currently being used.
*/
public static HashSet getAvailableSerialPorts() {
HashSet h = new HashSet();
Enumeration thePorts = CommPortIdentifier.getPortIdentifiers();
while (thePorts.hasMoreElements()) {
CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement();
switch (com.getPortType()) {
case CommPortIdentifier.PORT_SERIAL:
try {
CommPort thePort = com.open(“CommUtil“ 50);
thePort.close();
h.add(com);
} catch (PortInUseException e) {
System.out.println(“Port “ + com.getName() + “ is in use.“);
} catch (Exception e) {
System.err.println(“Failed to open port “ + com.getName());
e.printStackTrace();
}
}
}
return h;
}
JDK >= 5.0
/**
* @return A HashSet containing the CommPortIdentifier for all serial ports that are not currently being used.
*/
public static HashSet getAvailableSerialPorts() {
HashSet h = new HashSet();
Enumeration thePorts = CommPortIdentifier.getPortIdentifiers();
while (thePorts.hasMoreElements()) {
CommPortIdentifier com = (CommPortIdentifier) thePorts.nextElement();
switch (com.getPortType()) {
case CommPortIdentifier.PORT_SERIAL:
try {
CommPort thePort = com.open(“CommUtil“ 50);
thePort.close();
h.add(com);
} catch (PortInUseException e) {
System.out.println(“Port “ + com.getName() + “ is in use.“);
} catch (Exception e) {
System.err.println(“Failed to open port “ + com.getName());
e.printStackTrace();
}
}
}
return h;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2186 2018-03-27 12:28 rxtx\examples\Discovering available comm ports.java
文件 1026 2018-03-27 12:28 rxtx\examples\Discovering comm ports.java
文件 3782 2018-03-27 12:31 rxtx\examples\Event ba
文件 3029 2018-03-27 12:27 rxtx\examples\ParallelCommunication.java
文件 3077 2018-03-27 12:30 rxtx\examples\Two way communcation with the serial port.java
文件 166 2018-03-27 12:32 rxtx\readme.txt
文件 610316 2018-03-27 12:19 rxtx\rxtx-2.1-7-bins-r2.zip
文件 1345757 2018-03-27 12:20 rxtx\rxtx-2.1-7r2-source.zip
目录 0 2018-03-27 12:31 rxtx\examples
目录 0 2018-03-27 12:32 rxtx
----------- --------- ---------- ----- ----
1969339 10
相关资源
- java 毕业设计 进销存管理系统 源码
- java图片浏览器跨平台运行程序与源码
- 基于java的在线考试系统-毕业设计
- 微博系统(Java源码,servlet+jsp),适
- java串口通信全套完整代码-导入eclip
- jsonarray所必需的6个jar包.rar
- 三角网构TIN生成算法,Java语言实现
- java代码编写将excel数据导入到mysql数据
- Java写的cmm词法分析器源代码及javacc学
- JAVA JSP公司财务管理系统 源代码 论文
- JSP+MYSQL旅行社管理信息系统
- 推荐算法的JAVA实现
- 基于Java的酒店管理系统源码(毕业设
- java-图片识别 图片比较
- android毕业设计
- java23种设计模式+23个实例demo
- java Socket发送/接受报文
- JAVA828436
- java界面美化 提供多套皮肤直接使用
- 在线聊天系统(java代码)
- 基于Java的图书管理系统807185
- java中实现将页面数据导入Excel中
- java 企业销售管理系统
- java做的聊天系统(包括正规课程设计
- Java编写的qq聊天室
- 商店商品管理系统 JAVA写的 有界面
- JAVA开发聊天室程序
- 在linux系统下用java执行系统命令实例
- java期末考试试题两套(答案) 选择(
- JAVA3D编程示例(建模、交互)
评论
共有 条评论