Class JsscSerialPortAdapter

java.lang.Object
tj.epic.cashcode.JsscSerialPortAdapter
All Implemented Interfaces:
SerialPortAdapter

public class JsscSerialPortAdapter extends Object implements SerialPortAdapter
JSSC-based implementation of SerialPortAdapter.
  • Constructor Details

    • JsscSerialPortAdapter

      public JsscSerialPortAdapter(String portName)
  • Method Details

    • open

      public void open() throws jssc.SerialPortException
      Specified by:
      open in interface SerialPortAdapter
      Throws:
      jssc.SerialPortException
    • close

      public void close() throws jssc.SerialPortException
      Specified by:
      close in interface SerialPortAdapter
      Throws:
      jssc.SerialPortException
    • setParams

      public void setParams(int baudRate, int dataBits, int stopBits, int parity) throws jssc.SerialPortException
      Specified by:
      setParams in interface SerialPortAdapter
      Throws:
      jssc.SerialPortException
    • isOpened

      public boolean isOpened()
      Specified by:
      isOpened in interface SerialPortAdapter
    • write

      public void write(int[] data) throws jssc.SerialPortException
      Specified by:
      write in interface SerialPortAdapter
      Throws:
      jssc.SerialPortException
    • read

      public int[] read() throws jssc.SerialPortException
      Specified by:
      read in interface SerialPortAdapter
      Throws:
      jssc.SerialPortException