Examples of purgePort()


Examples of jssc.SerialPort.purgePort()

    SerialPort sp = new SerialPort(serialPort);
    byte[] buffer = null;
    try {
      sp.openPort();
      sp.setParams(baud, dataBits, stopBits, parity);
      sp.purgePort(SerialPort.PURGE_RXCLEAR);
      sp.purgePort(SerialPort.PURGE_TXCLEAR);
      buffer = sp.readBytes(byteCount, timeout);
      log.info("Byte Count: " + byteCount);
      log.info("Value: " + new String(buffer));
    } catch (SerialPortTimeoutException e) {
View Full Code Here

Examples of jssc.SerialPort.purgePort()

    byte[] buffer = null;
    try {
      sp.openPort();
      sp.setParams(baud, dataBits, stopBits, parity);
      sp.purgePort(SerialPort.PURGE_RXCLEAR);
      sp.purgePort(SerialPort.PURGE_TXCLEAR);
      buffer = sp.readBytes(byteCount, timeout);
      log.info("Byte Count: " + byteCount);
      log.info("Value: " + new String(buffer));
    } catch (SerialPortTimeoutException e) {
      throw e;
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.