Package jssc

Examples of jssc.SerialPort.openPort()


   */
  public synchronized byte[] readBytes() throws SerialPortTimeoutException, SerialPortException {
    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);
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.