Package purejavacomm

Examples of purejavacomm.SerialPortEventListener


        fail("closing failed to interrupt a blocking write()");

      Thread.sleep(4000); // the port maybe busy if previously written data has not been transmitted so we need to wait before continuing testing
      // interrupting the internal thread -------------------------
      openPort();
      m_Port.addEventListener(new SerialPortEventListener() {
        public void serialEvent(SerialPortEvent event) {
        }
      });
      m_Port.notifyOnDataAvailable(true);
View Full Code Here


      m_Port.notifyOnOutputEmpty(true);
      m_Port.setFlowControlMode(SerialPort.FLOWCONTROL_XONXOFF_IN + SerialPort.FLOWCONTROL_XONXOFF_OUT);
      m_Port.setSerialPortParams(speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
      final boolean[] stop = { false };
      m_T0 = System.currentTimeMillis();
      m_Port.addEventListener(new SerialPortEventListener() {
        public void serialEvent(SerialPortEvent event) {
          try {
            if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) {
              byte[] buffer = new byte[m_In.available()];
              int n = m_In.read(buffer);
View Full Code Here

      m_Port.notifyOnCTS(true);
      m_Port.notifyOnRingIndicator(true);
      m_Port.notifyOnCarrierDetect(true);
      m_Port.notifyOnDSR(true);
      final int[] counts = new int[11];
      m_Port.addEventListener(new SerialPortEventListener() {
        public void serialEvent(SerialPortEvent event) {
          try {
            if (event.getEventType() == SerialPortEvent.CTS)
              counts[SerialPortEvent.CTS]++;
            if (event.getEventType() == SerialPortEvent.RI)
View Full Code Here

    result.setFlowControlMode( flowControl );
    result.enableReceiveTimeout( 100 );
    result.enableReceiveThreshold( 0 );

    result.notifyOnDataAvailable( true );
    result.addEventListener( new SerialPortEventListener()
    {
      @Override
      public void serialEvent( SerialPortEvent event )
      {
        if ( ( event.getEventType() & SerialPortEvent.DATA_AVAILABLE ) != 0 )
View Full Code Here

TOP

Related Classes of purejavacomm.SerialPortEventListener

Copyright © 2018 www.massapicom. 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.