SerialReader.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:kkMulticopterFlashTool 作者:
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);
       }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号