日期:2014-05-20 浏览次数:20973 次
try {
serialPort = (SerialPort) portId.open("ReadComm", 2000);
out_message.setText("已打开端口COM1 ,正在接收数据..... ");
}
catch (PortInUseException e) {
System.out.println("串口已被使用");
mark=false;
System.out.println(serialPort);
serialPort.close(); }