Package gnu.io

Examples of gnu.io.CommPortIdentifier.open()


  public void connect() throws SwegonVentilationException {

    try {
      CommPortIdentifier portIdentifier = CommPortIdentifier
          .getPortIdentifier(portName);
      CommPort commPort = portIdentifier.open(this.getClass().getName(),
          2000);
      serialPort = (SerialPort) commPort;
      serialPort.setSerialPortParams(BAUDRATE, SerialPort.DATABITS_8,
          SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
View Full Code Here


       *  setProperty() call below helps
       */
      System.setProperty("gnu.io.rxtx.SerialPorts", m_devName);
      CommPortIdentifier ci =
          CommPortIdentifier.getPortIdentifier(m_devName);
      CommPort cp = ci.open(m_appName, 1000);
      if (cp instanceof SerialPort) {
        m_port = (SerialPort)cp;
      } else {
        throw new IllegalStateException("unknown port type");
      }
View Full Code Here

       
        CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement();
        if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
          //System.out.println("found " + portId.getName());
          if (portId.getName().equals(iname)) {
            port = (SerialPort)portId.open("serial madness", 2000);
            input = port.getInputStream();
            output = port.getOutputStream();
            port.setSerialPortParams(rate, databits, stopbits, parity);
            port.addEventListener(this);
            port.notifyOnDataAvailable(true);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.