private void openPort() throws Exception{
CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(port);
CommPort commPort = portIdentifier.open("LightController",2000);
if ( commPort instanceof SerialPort )
{
serialPort = (SerialPort) commPort;
serialPort.setSerialPortParams(baud,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
in = serialPort.getInputStream();
isr = new InputStreamReader(in);
br = new BufferedReader(isr);
}
}
SerialReader.java 文件源码
java
阅读 21
收藏 0
点赞 0
评论 0
项目:kkMulticopterFlashTool
作者:
评论列表
文章目录