Package jssc

Examples of jssc.SerialPort.readBytes()


    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;
    } catch (SerialPortException 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.